@carto/airship-bridge
Advanced tools
Comparing version 2.2.0-rc.1 to 2.2.0-rc.2
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.AsBridge=e():t.AsBridge=e()}(window,function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=2)}([function(t,e,r){(function(r){var n;e=t.exports=X,n="object"==typeof r&&r.env&&r.env.NODE_DEBUG&&/\bsemver\b/i.test(r.env.NODE_DEBUG)?function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)}:function(){},e.SEMVER_SPEC_VERSION="2.0.0";var i=256,o=Number.MAX_SAFE_INTEGER||9007199254740991,a=e.re=[],s=e.src=[],u=0,l=u++;s[l]="0|[1-9]\\d*";var c=u++;s[c]="[0-9]+";var p=u++;s[p]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var h=u++;s[h]="("+s[l]+")\\.("+s[l]+")\\.("+s[l]+")";var f=u++;s[f]="("+s[c]+")\\.("+s[c]+")\\.("+s[c]+")";var m=u++;s[m]="(?:"+s[l]+"|"+s[p]+")";var _=u++;s[_]="(?:"+s[c]+"|"+s[p]+")";var d=u++;s[d]="(?:-("+s[m]+"(?:\\."+s[m]+")*))";var v=u++;s[v]="(?:-?("+s[_]+"(?:\\."+s[_]+")*))";var g=u++;s[g]="[0-9A-Za-z-]+";var y=u++;s[y]="(?:\\+("+s[g]+"(?:\\."+s[g]+")*))";var b=u++,w="v?"+s[h]+s[d]+"?"+s[y]+"?";s[b]="^"+w+"$";var x="[v=\\s]*"+s[f]+s[v]+"?"+s[y]+"?",L=u++;s[L]="^"+x+"$";var O=u++;s[O]="((?:<|>)?=?)";var j=u++;s[j]=s[c]+"|x|X|\\*";var E=u++;s[E]=s[l]+"|x|X|\\*";var N=u++;s[N]="[v=\\s]*("+s[E]+")(?:\\.("+s[E]+")(?:\\.("+s[E]+")(?:"+s[d]+")?"+s[y]+"?)?)?";var P=u++;s[P]="[v=\\s]*("+s[j]+")(?:\\.("+s[j]+")(?:\\.("+s[j]+")(?:"+s[v]+")?"+s[y]+"?)?)?";var z=u++;s[z]="^"+s[O]+"\\s*"+s[N]+"$";var k=u++;s[k]="^"+s[O]+"\\s*"+s[P]+"$";var T=u++;s[T]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var C=u++;s[C]="(?:~>?)";var D=u++;s[D]="(\\s*)"+s[C]+"\\s+",a[D]=new RegExp(s[D],"g");var S=u++;s[S]="^"+s[C]+s[N]+"$";var H=u++;s[H]="^"+s[C]+s[P]+"$";var A=u++;s[A]="(?:\\^)";var R=u++;s[R]="(\\s*)"+s[A]+"\\s+",a[R]=new RegExp(s[R],"g");var V=u++;s[V]="^"+s[A]+s[N]+"$";var F=u++;s[F]="^"+s[A]+s[P]+"$";var M=u++;s[M]="^"+s[O]+"\\s*("+x+")$|^$";var W=u++;s[W]="^"+s[O]+"\\s*("+w+")$|^$";var $=u++;s[$]="(\\s*)"+s[O]+"\\s*("+x+"|"+s[N]+")",a[$]=new RegExp(s[$],"g");var I=u++;s[I]="^\\s*("+s[N]+")\\s+-\\s+("+s[N]+")\\s*$";var B=u++;s[B]="^\\s*("+s[P]+")\\s+-\\s+("+s[P]+")\\s*$";var q=u++;s[q]="(<|>)?=?\\s*\\*";for(var U=0;U<35;U++)n(U,s[U]),a[U]||(a[U]=new RegExp(s[U]));function Z(t,e){if(t instanceof X)return t;if("string"!=typeof t)return null;if(t.length>i)return null;if(!(e?a[L]:a[b]).test(t))return null;try{return new X(t,e)}catch(t){return null}}function X(t,e){if(t instanceof X){if(t.loose===e)return t;t=t.version}else if("string"!=typeof t)throw new TypeError("Invalid Version: "+t);if(t.length>i)throw new TypeError("version is longer than "+i+" characters");if(!(this instanceof X))return new X(t,e);n("SemVer",t,e),this.loose=e;var r=t.trim().match(e?a[L]:a[b]);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>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(function(t){if(/^[0-9]+$/.test(t)){var e=+t;if(e>=0&&e<o)return e}return t}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}e.parse=Z,e.valid=function(t,e){var r=Z(t,e);return r?r.version:null},e.clean=function(t,e){var r=Z(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null},e.SemVer=X,X.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},X.prototype.toString=function(){return this.version},X.prototype.compare=function(t){return n("SemVer.compare",this.version,this.loose,t),t instanceof X||(t=new X(t,this.loose)),this.compareMain(t)||this.comparePre(t)},X.prototype.compareMain=function(t){return t instanceof X||(t=new X(t,this.loose)),J(this.major,t.major)||J(this.minor,t.minor)||J(this.patch,t.patch)},X.prototype.comparePre=function(t){if(t instanceof X||(t=new X(t,this.loose)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;var e=0;do{var r=this.prerelease[e],i=t.prerelease[e];if(n("prerelease compare",e,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return J(r,i)}while(++e)},X.prototype.inc=function(t,e){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",e);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",e);break;case"prepatch":this.prerelease.length=0,this.inc("patch",e),this.inc("pre",e);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",e),this.inc("pre",e);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var r=this.prerelease.length;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);-1===r&&this.prerelease.push(0)}e&&(this.prerelease[0]===e?isNaN(this.prerelease[1])&&(this.prerelease=[e,0]):this.prerelease=[e,0]);break;default:throw new Error("invalid increment argument: "+t)}return this.format(),this.raw=this.version,this},e.inc=function(t,e,r,n){"string"==typeof r&&(n=r,r=void 0);try{return new X(t,r).inc(e,n).version}catch(t){return null}},e.diff=function(t,e){if(tt(t,e))return null;var r=Z(t),n=Z(e);if(r.prerelease.length||n.prerelease.length){for(var i in r)if(("major"===i||"minor"===i||"patch"===i)&&r[i]!==n[i])return"pre"+i;return"prerelease"}for(var i in r)if(("major"===i||"minor"===i||"patch"===i)&&r[i]!==n[i])return i},e.compareIdentifiers=J;var G=/^[0-9]+$/;function J(t,e){var r=G.test(t),n=G.test(e);return r&&n&&(t=+t,e=+e),r&&!n?-1:n&&!r?1:t<e?-1:t>e?1:0}function K(t,e,r){return new X(t,r).compare(new X(e,r))}function Q(t,e,r){return K(t,e,r)>0}function Y(t,e,r){return K(t,e,r)<0}function tt(t,e,r){return 0===K(t,e,r)}function et(t,e,r){return 0!==K(t,e,r)}function rt(t,e,r){return K(t,e,r)>=0}function nt(t,e,r){return K(t,e,r)<=0}function it(t,e,r,n){var i;switch(e){case"===":"object"==typeof t&&(t=t.version),"object"==typeof r&&(r=r.version),i=t===r;break;case"!==":"object"==typeof t&&(t=t.version),"object"==typeof r&&(r=r.version),i=t!==r;break;case"":case"=":case"==":i=tt(t,r,n);break;case"!=":i=et(t,r,n);break;case">":i=Q(t,r,n);break;case">=":i=rt(t,r,n);break;case"<":i=Y(t,r,n);break;case"<=":i=nt(t,r,n);break;default:throw new TypeError("Invalid operator: "+e)}return i}function ot(t,e){if(t instanceof ot){if(t.loose===e)return t;t=t.value}if(!(this instanceof ot))return new ot(t,e);n("comparator",t,e),this.loose=e,this.parse(t),this.semver===at?this.value="":this.value=this.operator+this.semver.version,n("comp",this)}e.rcompareIdentifiers=function(t,e){return J(e,t)},e.major=function(t,e){return new X(t,e).major},e.minor=function(t,e){return new X(t,e).minor},e.patch=function(t,e){return new X(t,e).patch},e.compare=K,e.compareLoose=function(t,e){return K(t,e,!0)},e.rcompare=function(t,e,r){return K(e,t,r)},e.sort=function(t,r){return t.sort(function(t,n){return e.compare(t,n,r)})},e.rsort=function(t,r){return t.sort(function(t,n){return e.rcompare(t,n,r)})},e.gt=Q,e.lt=Y,e.eq=tt,e.neq=et,e.gte=rt,e.lte=nt,e.cmp=it,e.Comparator=ot;var at={};function st(t,e){if(t instanceof st)return t.loose===e?t:new st(t.raw,e);if(t instanceof ot)return new st(t.value,e);if(!(this instanceof st))return new st(t,e);if(this.loose=e,this.raw=t,this.set=t.split(/\s*\|\|\s*/).map(function(t){return this.parseRange(t.trim())},this).filter(function(t){return t.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+t);this.format()}function ut(t){return!t||"x"===t.toLowerCase()||"*"===t}function lt(t,e,r,n,i,o,a,s,u,l,c,p,h){return((e=ut(r)?"":ut(n)?">="+r+".0.0":ut(i)?">="+r+"."+n+".0":">="+e)+" "+(s=ut(u)?"":ut(l)?"<"+(+u+1)+".0.0":ut(c)?"<"+u+"."+(+l+1)+".0":p?"<="+u+"."+l+"."+c+"-"+p:"<="+s)).trim()}function ct(t,e){for(var r=0;r<t.length;r++)if(!t[r].test(e))return!1;if(e.prerelease.length){for(r=0;r<t.length;r++)if(n(t[r].semver),t[r].semver!==at&&t[r].semver.prerelease.length>0){var i=t[r].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}function pt(t,e,r){try{e=new st(e,r)}catch(t){return!1}return e.test(t)}function ht(t,e,r,n){var i,o,a,s,u;switch(t=new X(t,n),e=new st(e,n),r){case">":i=Q,o=nt,a=Y,s=">",u=">=";break;case"<":i=Y,o=rt,a=Q,s="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(pt(t,e,n))return!1;for(var l=0;l<e.set.length;++l){var c=e.set[l],p=null,h=null;if(c.forEach(function(t){t.semver===at&&(t=new ot(">=0.0.0")),p=p||t,h=h||t,i(t.semver,p.semver,n)?p=t:a(t.semver,h.semver,n)&&(h=t)}),p.operator===s||p.operator===u)return!1;if((!h.operator||h.operator===s)&&o(t,h.semver))return!1;if(h.operator===u&&a(t,h.semver))return!1}return!0}ot.prototype.parse=function(t){var e=this.loose?a[M]:a[W],r=t.match(e);if(!r)throw new TypeError("Invalid comparator: "+t);this.operator=r[1],"="===this.operator&&(this.operator=""),r[2]?this.semver=new X(r[2],this.loose):this.semver=at},ot.prototype.toString=function(){return this.value},ot.prototype.test=function(t){return n("Comparator.test",t,this.loose),this.semver===at||("string"==typeof t&&(t=new X(t,this.loose)),it(t,this.operator,this.semver,this.loose))},ot.prototype.intersects=function(t,e){if(!(t instanceof ot))throw new TypeError("a Comparator is required");var r;if(""===this.operator)return r=new st(t.value,e),pt(this.value,r,e);if(""===t.operator)return r=new st(this.value,e),pt(t.semver,r,e);var n=!(">="!==this.operator&&">"!==this.operator||">="!==t.operator&&">"!==t.operator),i=!("<="!==this.operator&&"<"!==this.operator||"<="!==t.operator&&"<"!==t.operator),o=this.semver.version===t.semver.version,a=!(">="!==this.operator&&"<="!==this.operator||">="!==t.operator&&"<="!==t.operator),s=it(this.semver,"<",t.semver,e)&&(">="===this.operator||">"===this.operator)&&("<="===t.operator||"<"===t.operator),u=it(this.semver,">",t.semver,e)&&("<="===this.operator||"<"===this.operator)&&(">="===t.operator||">"===t.operator);return n||i||o&&a||s||u},e.Range=st,st.prototype.format=function(){return this.range=this.set.map(function(t){return t.join(" ").trim()}).join("||").trim(),this.range},st.prototype.toString=function(){return this.range},st.prototype.parseRange=function(t){var e=this.loose;t=t.trim(),n("range",t,e);var r=e?a[B]:a[I];t=t.replace(r,lt),n("hyphen replace",t),t=t.replace(a[$],"$1$2$3"),n("comparator trim",t,a[$]),t=(t=(t=t.replace(a[D],"$1~")).replace(a[R],"$1^")).split(/\s+/).join(" ");var i=e?a[M]:a[W],o=t.split(" ").map(function(t){return function(t,e){return n("comp",t),t=function(t,e){return t.trim().split(/\s+/).map(function(t){return function(t,e){n("caret",t,e);var r=e?a[F]:a[V];return t.replace(r,function(e,r,i,o,a){var s;return n("caret",t,e,r,i,o,a),ut(r)?s="":ut(i)?s=">="+r+".0.0 <"+(+r+1)+".0.0":ut(o)?s="0"===r?">="+r+"."+i+".0 <"+r+"."+(+i+1)+".0":">="+r+"."+i+".0 <"+(+r+1)+".0.0":a?(n("replaceCaret pr",a),"-"!==a.charAt(0)&&(a="-"+a),s="0"===r?"0"===i?">="+r+"."+i+"."+o+a+" <"+r+"."+i+"."+(+o+1):">="+r+"."+i+"."+o+a+" <"+r+"."+(+i+1)+".0":">="+r+"."+i+"."+o+a+" <"+(+r+1)+".0.0"):(n("no pr"),s="0"===r?"0"===i?">="+r+"."+i+"."+o+" <"+r+"."+i+"."+(+o+1):">="+r+"."+i+"."+o+" <"+r+"."+(+i+1)+".0":">="+r+"."+i+"."+o+" <"+(+r+1)+".0.0"),n("caret return",s),s})}(t,e)}).join(" ")}(t,e),n("caret",t),t=function(t,e){return t.trim().split(/\s+/).map(function(t){return function(t,e){var r=e?a[H]:a[S];return t.replace(r,function(e,r,i,o,a){var s;return n("tilde",t,e,r,i,o,a),ut(r)?s="":ut(i)?s=">="+r+".0.0 <"+(+r+1)+".0.0":ut(o)?s=">="+r+"."+i+".0 <"+r+"."+(+i+1)+".0":a?(n("replaceTilde pr",a),"-"!==a.charAt(0)&&(a="-"+a),s=">="+r+"."+i+"."+o+a+" <"+r+"."+(+i+1)+".0"):s=">="+r+"."+i+"."+o+" <"+r+"."+(+i+1)+".0",n("tilde return",s),s})}(t,e)}).join(" ")}(t,e),n("tildes",t),t=function(t,e){return n("replaceXRanges",t,e),t.split(/\s+/).map(function(t){return function(t,e){t=t.trim();var r=e?a[k]:a[z];return t.replace(r,function(e,r,i,o,a,s){n("xRange",t,e,r,i,o,a,s);var u=ut(i),l=u||ut(o),c=l||ut(a),p=c;return"="===r&&p&&(r=""),u?e=">"===r||"<"===r?"<0.0.0":"*":r&&p?(l&&(o=0),c&&(a=0),">"===r?(r=">=",l?(i=+i+1,o=0,a=0):c&&(o=+o+1,a=0)):"<="===r&&(r="<",l?i=+i+1:o=+o+1),e=r+i+"."+o+"."+a):l?e=">="+i+".0.0 <"+(+i+1)+".0.0":c&&(e=">="+i+"."+o+".0 <"+i+"."+(+o+1)+".0"),n("xRange return",e),e})}(t,e)}).join(" ")}(t,e),n("xrange",t),t=function(t,e){return n("replaceStars",t,e),t.trim().replace(a[q],"")}(t,e),n("stars",t),t}(t,e)}).join(" ").split(/\s+/);return this.loose&&(o=o.filter(function(t){return!!t.match(i)})),o=o.map(function(t){return new ot(t,e)})},st.prototype.intersects=function(t,e){if(!(t instanceof st))throw new TypeError("a Range is required");return this.set.some(function(r){return r.every(function(r){return t.set.some(function(t){return t.every(function(t){return r.intersects(t,e)})})})})},e.toComparators=function(t,e){return new st(t,e).set.map(function(t){return t.map(function(t){return t.value}).join(" ").trim().split(" ")})},st.prototype.test=function(t){if(!t)return!1;"string"==typeof t&&(t=new X(t,this.loose));for(var e=0;e<this.set.length;e++)if(ct(this.set[e],t))return!0;return!1},e.satisfies=pt,e.maxSatisfying=function(t,e,r){var n=null,i=null;try{var o=new st(e,r)}catch(t){return null}return t.forEach(function(t){o.test(t)&&(n&&-1!==i.compare(t)||(i=new X(n=t,r)))}),n},e.minSatisfying=function(t,e,r){var n=null,i=null;try{var o=new st(e,r)}catch(t){return null}return t.forEach(function(t){o.test(t)&&(n&&1!==i.compare(t)||(i=new X(n=t,r)))}),n},e.validRange=function(t,e){try{return new st(t,e).range||"*"}catch(t){return null}},e.ltr=function(t,e,r){return ht(t,e,"<",r)},e.gtr=function(t,e,r){return ht(t,e,">",r)},e.outside=ht,e.prerelease=function(t,e){var r=Z(t,e);return r&&r.prerelease.length?r.prerelease:null},e.intersects=function(t,e,r){return t=new st(t,r),e=new st(e,r),t.intersects(e)},e.coerce=function(t){if(t instanceof X)return t;if("string"!=typeof t)return null;var e=t.match(a[T]);return null==e?null:Z((e[1]||"0")+"."+(e[2]||"0")+"."+(e[3]||"0"))}}).call(this,r(1))},function(t,e){var r,n,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var u,l=[],c=!1,p=-1;function h(){c&&u&&(c=!1,u.length?l=u.concat(l):p=-1,l.length&&f())}function f(){if(!c){var t=s(h);c=!0;for(var e=l.length;e;){for(u=l,l=[];++p<e;)u&&u[p].run();p=-1,e=l.length}u=null,c=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function m(t,e){this.fun=t,this.array=e}function _(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];l.push(new m(t,e)),1!==l.length||c||s(f)},m.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=_,i.addListener=_,i.once=_,i.off=_,i.removeListener=_,i.removeAllListeners=_,i.emit=_,i.prependListener=_,i.prependOnceListener=_,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,r){"use strict";function n(t){return"string"==typeof t?document.querySelector(t):t}function i(t){return"string"==typeof t?t:t.propertyName}function o(t){return"string"==typeof t?null:t}function a(t){return"#"+u(t.r)+u(t.g)+u(t.b)+u(Math.floor(255*t.a))}function s(t){return"rgba("+t.r+","+t.g+","+t.b+","+t.a+")"}function u(t){return isNaN(t)||void 0===t?"":t.toString(16).padStart(2,"0").toUpperCase()}function l(t,e,r){void 0===r&&(r=!1),r&&t.on("updated",function(){e(!1)}),t.viz?e(!0):t.on("loaded",function(){e(!0)})}r.r(e);var c=function(){return(c=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},p=16,h="#000";function f(t){var e=t.getLegendData(),r=Math.floor(e.data.length/2);return e.data[r].value}function m(t,e){var r=t[e];return"ramp"===r.expressionName||"opacity"===r.expressionName?s(f(r)):"color"===e||"strokeColor"===e?s(r.value):h}function _(t,e,r){var n=t[e];return"ramp"===n.expressionName?r||f(n):"number"===n.type?n.value:r}function d(t){var e=t.symbol;return"ramp"===e.expressionName?f(e):e.value}function v(t){var e=t.layer,r=t.props,n=e.viz;return n?c({color:m(n,"color"),label:r.label,marker:n.symbol.default?void 0:d(n),strokeColor:m(n,"strokeColor"),strokeStyle:0===_(n,"strokeWidth")?"hidden":void 0,type:e.metadata.geomType,width:_(n,"width",p)},r):{}}function g(t){return t.props?t:{layer:t,props:{label:t.id}}}var y=function(){function t(){}return t.layersLegend=function(t,e,r){void 0===r&&(r={}),t=n(t);var i=e.map(g);i.forEach(function(e,n,o){l(e.layer,function(){var e=i.map(v);r.format&&(e.label=r.format(e.label,n,o)),t.data=e,r.onLoad&&setTimeout(r.onLoad,0)},r.dynamic)})},t.rampLegend=function(t,e,r,i){void 0===i&&(i={}),t=n(t);var o=g(e);l(o.layer,function(){var e=v(o),n=o.layer.viz[r],s=i.config,u=o.layer.viz[r].getLegendData(s).data,l=u.map(function(t,o,s){var u,l,p,h,f;return c({},e,((u={})[r]=function(t,e){return"color"===t.type?a(e):e}(n,t.value),u.label=i.format?i.format(t.key,o,s):(l=t.key,Array.isArray(l)?(h=(p=l)[0],f=p[1],h===-1/0?"< "+f.toFixed(2):f===1/0?"> "+h.toFixed(2):h.toFixed(2)+" - "+f.toFixed(2)):l.toFixed?l.toFixed(2):l),u))});Array.isArray(o.props)&&o.props.length===u.length?t.data=l.map(function(t,e){return c({},t,o.props[e])}):t.data=l,i.onLoad&&setTimeout(i.onLoad,0)},i.dynamic)},t}(),b=r(0),w=r.n(b),x=function(){function t(t,e,r,i,o,a,s,u,l,c){var p=this;void 0===a&&(a=10),void 0===s&&(s=[.15,.15]),this._animationWidget=n(t),this._column=r,this._variableName=i||"animation",this._propertyName=o||"filter",this._carto=e,this._duration=a,this._fade=s,this._animationWidget.playing=!1,this._animationWidget.isLoading=!0,this._layer=u,this._formatCb=c,u.viz?(this._onLayerLoaded(),l()):u.on("loaded",function(){p._onLayerLoaded(),l()})}return Object.defineProperty(t.prototype,"animation",{get:function(){return this._animation},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"variableName",{get:function(){return this._variableName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"propertyName",{get:function(){return this._propertyName},set:function(t){this._propertyName=t},enumerable:!0,configurable:!0}),t.prototype.setRange=function(){},t.prototype._onLayerLoaded=function(){var t=this;this._viz=this._layer.viz;var e=this._getAnimationExpression();e.a&&e.b?this._animation="animation"===e.a.expressionName?e.a:e.b:this._animation=e,this._viz[this._propertyName].blendTo(e,0),this._animation.parent=this._viz,this._animation.notify=this._viz._changed.bind(this._viz),this._animationWidget.duration=this._animation.duration.value,this._animationWidget.playing=!0,this._animationWidget.isLoading=!1,this._animationWidget.addEventListener("play",function(){t._animation.play()}),this._animationWidget.addEventListener("pause",function(){t._animation.pause()}),this._animationWidget.addEventListener("seek",function(e){t._animation.setProgressPct(e.detail[0]/100),t._animation.notify(),t._animationWidget.progressValue=t._formatProgressValue()}),this._layer.on("updated",function(){t._animationWidget.progress=100*t._animation.getProgressPct(),t._animationWidget.progressValue=t._formatProgressValue()})},t.prototype._getAnimationExpression=function(){return this._variableName&&this._viz.variables[this._variableName]?this._viz.variables[this._variableName]:(this._viz.variables[this._variableName]=this._propertyName&&this._viz[this._propertyName].isAnimated()?this._viz[this._propertyName]:this._createDefaultAnimation(),this._viz.variables[this._variableName])},t.prototype._formatProgressValue=function(){var t=this._animation.getProgressValue();return t instanceof Date?this._formatCb?this._formatCb(t):t.toISOString():t instanceof Object&&this._isVLTimeZoneDate(t)?this._formatCb?this._formatCb(t._date):t._date.toISOString():this._formatCb?this._formatCb(t):t},t.prototype._isVLTimeZoneDate=function(t){return"_date"in t},t.prototype._createDefaultAnimation=function(){var t=this._carto.expressions;return t.animation(t.linear(t.prop(this._column),t.globalMin(t.prop(this._column)),t.globalMax(t.prop(this._column))),this._duration,t.fade(this._fade[0],this._fade[1]))},t}();var L=function(t){return t=t||Object.create(null),{on:function(e,r){(t[e]||(t[e]=[])).push(r)},off:function(e,r){t[e]&&t[e].splice(t[e].indexOf(r)>>>0,1)},emit:function(e,r){(t[e]||[]).slice().map(function(t){t(r)}),(t["*"]||[]).slice().map(function(t){t(e,r)})}}},O=function(){function t(e,r,n,i,o){void 0===o&&(o=!0),this._emitter=new L,this._name="asbind_"+e+"_"+r+"_"+t._counter,this._column=r,this._layer=n,this._source=i,this._readOnly=o,t._counter++,this._loadLegendData=this._loadLegendData.bind(this)}return Object.defineProperty(t.prototype,"globalExpression",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"column",{get:function(){return this._column},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"columnPropName",{get:function(){return this._name+"_col"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"readOnly",{get:function(){return this._readOnly},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"layer",{get:function(){return this._layer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"source",{get:function(){return this._source},enumerable:!0,configurable:!0}),t.prototype.on=function(t,e){this._emitter.on(t,e)},t.prototype.setLegendData=function(t){this._legendData=t.data},t.prototype.enableColorMapping=function(){this._mapColors=!0,this._layer.viz?this._loadLegendData():this._layer.on("loaded",this._loadLegendData)},t.prototype._filterChanged=function(){this._emitter.emit("filterChanged",this._name)},t.prototype._loadLegendData=function(){var t=this._layer.viz.color;t.getLegendData&&this.setLegendData(t.getLegendData(this._getLegendConfig()))},t.prototype._getLegendConfig=function(){},t._counter=0,t}();function j(t,e){return N(t.value,e.value,P)}function E(t,e){return N(t.value,e.value,z)}function N(t,e,r){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(r(t[n],e[n]))return!1;return!0}function P(t,e){return t.x[0]!==e.x[0]||t.x[1]!==e.x[1]||t.y!==e.y}function z(t,e){return t.x!==e.x||t.y!==e.y}function k(t){return t.value.map(function(t){return{end:t.x[1],start:t.x[0],value:t.y}})}function T(t){return t.value.map(function(t){return{end:new Date(t.x[1]),start:new Date(t.x[0]),value:t.y}})}function C(t,e){return t.value.map(function(t){return{category:t.x,color:D(t.x,e),end:void 0,start:void 0,value:t.y}})}function D(t,e){if(e){var r=e.find(function(e){return e.key===t});return r?function(t){return"string"==typeof t?t:a(t)}(r.value):void 0}}var S,H=function(t,e){return t.value.map(function(t){return{color:D(t.x,e),name:t.x,value:t.y}})},A=(S=function(t,e){return(S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}S(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),R=function(t){function e(e,r,i,o,a,s,u,l){void 0===s&&(s=!0);var c=t.call(this,"category",o,r,a,s)||this;return c._selection=[],c._lastHistogram=null,c._button=null,c._widget=n(i),c._carto=e,c._button=n(u),c._expression=l,c._widget.disableInteractivity=s,c._widget.showClearButton=!s,c.selectionChanged=c.selectionChanged.bind(c),s||(c._widget.addEventListener("categoriesSelected",c.selectionChanged),c._button&&c._button.addEventListener&&c._button.addEventListener("click",function(){c._filterChanged()})),c}return A(e,t),e.prototype.setDataLayer=function(t){var e=this;this._dataLayer=t,this._dataLayer.on("updated",function(){var t=e._dataLayer.viz.variables[e.name];t&&(null!==e._lastHistogram&&E(e._lastHistogram,t)||(e._lastHistogram={value:t.value},e._widget.categories=H(t,e._legendData)))})},Object.defineProperty(e.prototype,"filter",{get:function(){return 0===this._selection.length?null:"@"+this.columnPropName+" in ["+this._selection.map(function(t){return"'"+t+"'"}).join(",")+"]"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"expression",{get:function(){var t=this._carto.expressions;return t.viewportHistogram(this._expression?this._expression:t.prop(this._column))},enumerable:!0,configurable:!0}),e.prototype.selectionChanged=function(t){this._selection=t.detail,0!==this._selection.length&&this._button||this._filterChanged()},e}(O),V=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),F=function(t){function e(e,r,i,o,a,s,u,l,c){void 0===u&&(u=!0),void 0===l&&(l=!1),void 0===c&&(c=null);var p=t.call(this,"histogram_"+e,a,i,s,u)||this;return p._selection=null,p._inputExpression=null,p._totals=!1,p._widget=n(o),p._carto=r,p._totals=l,p._widget.disableInteractivity=u,p._widget.showClear=!u,p._inputExpression=c,p.selectionChanged=p.selectionChanged.bind(p),u||p._widget.addEventListener("selectionChanged",p.selectionChanged),p}return V(e,t),e.prototype.removeHistogramLayer=function(){this._layer.remove()},e.prototype.setDataLayer=function(t){this._dataLayer=t,this.bindDataLayer()},e.prototype._getLegendConfig=function(){return{samples:this._buckets}},e}(O),M=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),W=function(t){function e(e,r,n,i,o,a,s,u){void 0===a&&(a=!0),void 0===s&&(s=!1),void 0===u&&(u=null);var l=t.call(this,"categorical",e,r,n,i,o,a,s,u)||this;return l._lastHistogram=null,l}return M(e,t),Object.defineProperty(e.prototype,"filter",{get:function(){return null===this._selection?null:"@"+this.columnPropName+" in ["+this._selection.map(function(t){return"'"+t+"'"}).join(",")+"]"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"expression",{get:function(){var t=this._carto.expressions;return t.viewportHistogram(this._inputExpression?this._inputExpression:t.prop(this._column))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"globalExpression",{get:function(){if(!this._totals)return null;var t=this._carto.expressions;return t.globalHistogram(this._inputExpression?this._inputExpression:t.prop(this._column))},enumerable:!0,configurable:!0}),e.prototype.bindDataLayer=function(){var t=this;this._dataLayer.on("updated",function(){t._totals&&!t._globalHistogram&&(t._globalHistogram=t._dataLayer.viz.variables[t.name+"_global"],t._widget.backgroundData=C(t._globalHistogram));var e=t._dataLayer.viz.variables[t.name];if(e&&(null===t._lastHistogram||!E(t._lastHistogram,e)))if(t._lastHistogram={value:e.value},t._globalHistogram){var r=t._globalHistogram.value.map(function(t){var r=e.value.find(function(e){return e.x===t.x});return{x:t.x,y:r?r.y:0}});t._widget.data=C({value:r},t._legendData)}else t._widget.data=C(e,t._legendData)})},e.prototype.selectionChanged=function(t){if(null===t.detail)this._selection=null;else{var e=t.detail.selection;this._selection=e.map(function(t){return t})}this._filterChanged()},e}(F),$=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),I=function(t){function e(e,r,n,i,o,a,s,u,l,c){void 0===o&&(o=20),void 0===u&&(u=!0),void 0===l&&(l=!1),void 0===c&&(c=null);var p=t.call(this,"numerical",e,r,n,i,a,u,l,c)||this;return p._lastHistogram=null,p._buckets=void 0!==s?s.length:o,p._bucketRanges=s,p}return $(e,t),Object.defineProperty(e.prototype,"filter",{get:function(){return null===this._selection||this._isTimeSeries?null:"(@"+this.columnPropName+" >= "+this._selection[0]+" and @"+this.columnPropName+" < "+this._selection[1]+")"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"expression",{get:function(){if(this._totals&&!this._globalHistogram)return null;var t=this._carto.expressions;return t.viewportHistogram(this._inputExpression?this._inputExpression:t.prop(this._column),this._bucketArg())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"globalExpression",{get:function(){if(!this._totals)return null;var t=this._carto.expressions;return t.globalHistogram(this._inputExpression?this._inputExpression:t.prop(this._column),this._bucketArg())},enumerable:!0,configurable:!0}),e.prototype.setTimeSeries=function(t){this._isTimeSeries=t},e.prototype.enableColorMapping=function(){throw new Error("Unsupported for numerical histograms")},e.prototype.setLegendData=function(){throw new Error("Unsupported for numerical histograms")},e.prototype.bindDataLayer=function(){var t=this;this._dataLayer.on("updated",function(){if(t._totals&&!t._globalHistogram&&(t._globalHistogram=t._dataLayer.viz.variables[t.name+"_global"],t._globalHistogram)){var e=t._globalHistogram.input.type;t._bucketRanges=t._globalHistogram.value.map(function(t){return[t.x[0],t.x[1]]}),t._emitter.emit("expressionReady",{name:t.name,expression:t.expression}),t._widget.backgroundData="number"===e?k(t._globalHistogram):T(t._globalHistogram)}var r=t._dataLayer.viz.variables[t.name];if(r&&null!==r.value&&(null===t._lastHistogram||!j(t._lastHistogram,r))){e=r.input.type;t._emitter.emit("rangeChanged",[r.value[0].x[0],r.value[r.value.length-1].x[1]]),t._lastHistogram={value:r.value,input:{type:e}},t._widget.data="number"===e?k(r):T(r)}})},e.prototype.selectionChanged=function(t){if(null===t.detail)this._selection=null;else{var e=this._isTimeSeries?t.detail:t.detail.selection;this._selection=[e[0],e[1]]}this._emitter.emit("rangeChanged",this._selection),this._filterChanged()},e.prototype._bucketArg=function(){return void 0!==this._bucketRanges?this._bucketRanges:this._buckets},e}(F),B=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),q=function(t){function e(e,r,i,o,a){var s=t.call(this,"global_range",o,r,a,!1)||this;return s._value=null,s._widget=n(i),s._carto=e,s._widget.addEventListener("change",function(t){s._value=t.detail,s._filterChanged()}),s}return B(e,t),e.prototype.setDataLayer=function(t){var e=this;this._dataLayer=t,this._dataLayer.on("updated",function(){var t=e._dataLayer.viz.variables[e.name];t&&!e._populated&&(e._widget.minValue=t.value[0],e._widget.maxValue=t.value[1],e._widget.range=t.value,e._populated=!0)})},Object.defineProperty(e.prototype,"filter",{get:function(){return null===this._value?null:"@"+this.columnPropName+" > "+this._value[0]+" and @"+this.columnPropName+" < "+this._value[1]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"expression",{get:function(){var t=this._carto.expressions;return t.list([t.globalMin(t.prop(this._column)),t.globalMax(t.prop(this._column))])},enumerable:!0,configurable:!0}),e}(O),U=function(){function t(t,e,r,i,o,a,s,u,l){var c=this;void 0===a&&(a=10),void 0===s&&(s=[.15,.15]),this._timeSeriesWidget=n(i),this._layer=e,this._carto=t,this._columnName=r,this._duration=a,this._fade=s,this._variableName=u||"animation",this._propertyName=l||"filter",e.viz?(this._onLayerLoaded(),o()):e.on("loaded",function(){c._onLayerLoaded(),o()})}return t.prototype.removeHistogramLayer=function(){this._dataLayer.remove()},t.prototype.setRange=function(t){if(this._animation&&this._animation.input&&this._animation.input.min&&this._animation.input.max)if(null===t)this._animation.input.min.blendTo(this._min,0),this._animation.input.max.blendTo(this._max,0),this._animation.duration.blendTo(this._duration,0);else if(t[0]!==t[1]){var e=Math.min(1,(t[1]-t[0])/(this._max.value-this._min.value));this._animation.input.min.blendTo(t[0],0),this._animation.input.max.blendTo(t[1],0),this._animation.duration.blendTo(this._duration*e,0)}},Object.defineProperty(t.prototype,"variableName",{get:function(){return this._variableName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"propertyName",{get:function(){return this._propertyName},set:function(t){this._propertyName=t},enumerable:!0,configurable:!0}),t.prototype.setDuration=function(t){this._duration=t,this._animation.duration.blendTo(t,0)},Object.defineProperty(t.prototype,"animation",{get:function(){return this._animation},enumerable:!0,configurable:!0}),t.prototype._onLayerLoaded=function(){var t=this;this._viz=this._layer.viz;var e=this._getAnimationExpression();e.a&&e.b?this._animation="animation"===e.a.expressionName?e.a:e.b:this._animation=e,this._viz[this._propertyName].blendTo(e,0),this._animation.parent=this._viz,this._animation.notify=this._viz._changed.bind(this._viz),this._max=this._animation.input.max,this._min=this._animation.input.min,this._duration=this._animation.duration.value,this._layer.on("updated",function(){t._timeSeriesWidget.progress=100*t._animation.getProgressPct(),t._timeSeriesWidget.playing=t._animation.isPlaying()}),this._timeSeriesWidget.animated=!0,this._timeSeriesWidget.addEventListener("seek",function(e){t._animation.setProgressPct(e.detail/100),t._timeSeriesWidget.progress=e.detail}),this._timeSeriesWidget.addEventListener("play",function(){t._animation.play()}),this._timeSeriesWidget.addEventListener("pause",function(){t._animation.pause()})},t.prototype._getAnimationExpression=function(){return this._variableName&&this._viz.variables[this._variableName]?this._viz.variables[this._variableName]:(this._viz.variables[this._variableName]=this._propertyName&&this._viz[this._propertyName]&&this._viz[this._propertyName].isAnimated()?this._viz[this._propertyName]:this._createDefaultAnimation(),this._viz.variables[this._variableName])},t.prototype._createDefaultAnimation=function(){var t=this._carto.expressions;return t.animation(t.linear(t.prop(this._columnName),t.globalMin(t.prop(this._columnName)),t.globalMax(t.prop(this._columnName))),this._duration,t.fade(this._fade[0],this._fade[1]))},t}(),Z="^1.2.3",X=function(){function t(t){var e=t.carto,r=t.map,n=t.layer,i=t.source;if(this._vizFilters=[],this._carto=e,this._map=r,this._layer=n,this._source=i,this._id=this._layer.id,this._rebuildFilters=this._rebuildFilters.bind(this),this._updateDataLayerVariables=this._updateDataLayerVariables.bind(this),!this._carto.expressions.globalHistogram)throw new Error("Provided VL version "+this._carto.version+" lacks globalHistogram support.");if(!w.a.satisfies(this._carto.version,Z))throw new Error("Provided VL version "+this._carto.version+" not supported. Must satisfy "+Z)}return t.prototype.numericalHistogram=function(t,e,r){void 0===r&&(r={});var n=r.buckets,a=r.bucketRanges,s=r.readOnly,u=r.totals,l=i(e),c=o(e),p=new I(this._carto,this._layer,t,l,n,this._source,a,s,u,c);return this._addFilter(p),p},t.prototype.categoricalHistogram=function(t,e,r){void 0===r&&(r={});var n=r.readOnly,a=r.totals,s=i(e),u=o(e),l=new W(this._carto,this._layer,t,s,this._source,n,a,u);return this._addFilter(l),l},t.prototype.histogram=function(t,e,r){void 0===r&&(r={});var n=r.buckets,i=r.bucketRanges,o=r.readOnly,a=r.totals;if(void 0===n&&void 0===i){var s=t;return this.categoricalHistogram(s,e,{readOnly:o,totals:a})}return this.numericalHistogram(t,e,{readOnly:o,buckets:n,bucketRanges:i,totals:a})},t.prototype.category=function(t,e,r){void 0===r&&(r={});var n=r.readOnly,a=r.button,s=i(e),u=o(e),l=new R(this._carto,this._layer,t,s,this._source,n,a,u);return this._addFilter(l),l},t.prototype.timeSeries=function(t,e,r){var n=this;if(void 0===r&&(r={}),this._animation)throw new Error("There can only be one animation");var i=r.buckets,o=r.bucketRanges,a=r.readOnly,s=r.totals,u=r.duration,l=r.fade,c=r.variableName,p=r.propertyName;this._animation=new U(this._carto,this._layer,e,t,function(){"filter"===p&&n._rebuildFilters()},u,l,c,p);var h=this.numericalHistogram(t,e,{bucketRanges:o,buckets:i,readOnly:a,totals:s});return h.setTimeSeries(!0),h.on("rangeChanged",function(t){n._animation.setRange(t)}),this._animation},t.prototype.animationControls=function(t,e,r){var n=this;void 0===r&&(r={});var i=r.duration,o=r.fade,a=r.variableName,s=r.propertyName,u=void 0===s?"filter":s;return this._animation=new x(t,this._carto,e,a,u,i,o,this._layer,function(){"filter"===u&&n._rebuildFilters()},null),this._animation},t.prototype.globalRange=function(t,e){var r=new q(this._carto,this._layer,t,e,this._source);return this._addFilter(r),r},t.prototype.build=function(){var t=this;if(0!==this._vizFilters.length){var e=function(){t._appendVariables(),t._buildDataLayer()};this._layer.viz?e():this._layer.on("loaded",e)}},t.prototype._addFilter=function(t){t.on("filterChanged",this._rebuildFilters),t.on("expressionReady",this._updateDataLayerVariables),this._vizFilters.push(t)},t.prototype._appendVariables=function(){var t=this,e=this._carto.expressions;this._vizFilters.forEach(function(r){return t._layer.viz.variables[r.columnPropName]=e.prop(r.column)})},t.prototype._buildDataLayer=function(){var t=this,e=this._getVariables(),r=this._carto.expressions,n=new this._carto.Viz({color:r.rgba(0,0,0,0),strokeWidth:0,variables:e});this._readOnlyLayer=new this._carto.Layer("asbind_ro_"+this._id,this._source,n),this._readOnlyLayer.addTo(this._map),this._vizFilters.forEach(function(e){return e.setDataLayer(t._readOnlyLayer)})},t.prototype._getVariables=function(){for(var t=void 0!==this._readOnlyLayer?this._readOnlyLayer.viz.variables:{},e=0,r=this._vizFilters;e<r.length;e++){var n=r[e],i=n.name;n.globalExpression&&(t[i+"_global"]=n.globalExpression),n.expression&&(t[i]=n.expression),t[n.columnPropName]=this._carto.expressions.prop(n.column)}return t},t.prototype._updateDataLayerVariables=function(t){this._readOnlyLayer.viz&&(this._readOnlyLayer.viz.variables[t.name]=t.expression)},t.prototype._rebuildFilters=function(){var t=this._combineFilters(this._vizFilters.filter(function(t){return null!==t.filter}).map(function(t){return t.filter}));this._readOnlyLayer&&this._readOnlyLayer.viz.filter.blendTo(t,0),this._layer.viz.filter.isAnimated()&&(t="@"+this._animation.variableName+" and "+t),this._layer.viz.filter.blendTo(t,0)},t.prototype._combineFilters=function(t){return 0===t.length?"1":t.join(" and ")},t}();r.d(e,"VL",function(){return G}),r.d(e,"VLBridge",function(){return X});var G={Bridge:X,Legends:y}}])}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.AsBridge=e():t.AsBridge=e()}(window,function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=2)}([function(t,e,r){(function(r){var n;e=t.exports=X,n="object"==typeof r&&r.env&&r.env.NODE_DEBUG&&/\bsemver\b/i.test(r.env.NODE_DEBUG)?function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)}:function(){},e.SEMVER_SPEC_VERSION="2.0.0";var i=256,o=Number.MAX_SAFE_INTEGER||9007199254740991,a=e.re=[],s=e.src=[],u=0,l=u++;s[l]="0|[1-9]\\d*";var c=u++;s[c]="[0-9]+";var p=u++;s[p]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var h=u++;s[h]="("+s[l]+")\\.("+s[l]+")\\.("+s[l]+")";var f=u++;s[f]="("+s[c]+")\\.("+s[c]+")\\.("+s[c]+")";var m=u++;s[m]="(?:"+s[l]+"|"+s[p]+")";var _=u++;s[_]="(?:"+s[c]+"|"+s[p]+")";var d=u++;s[d]="(?:-("+s[m]+"(?:\\."+s[m]+")*))";var v=u++;s[v]="(?:-?("+s[_]+"(?:\\."+s[_]+")*))";var g=u++;s[g]="[0-9A-Za-z-]+";var y=u++;s[y]="(?:\\+("+s[g]+"(?:\\."+s[g]+")*))";var b=u++,w="v?"+s[h]+s[d]+"?"+s[y]+"?";s[b]="^"+w+"$";var x="[v=\\s]*"+s[f]+s[v]+"?"+s[y]+"?",L=u++;s[L]="^"+x+"$";var O=u++;s[O]="((?:<|>)?=?)";var j=u++;s[j]=s[c]+"|x|X|\\*";var E=u++;s[E]=s[l]+"|x|X|\\*";var N=u++;s[N]="[v=\\s]*("+s[E]+")(?:\\.("+s[E]+")(?:\\.("+s[E]+")(?:"+s[d]+")?"+s[y]+"?)?)?";var P=u++;s[P]="[v=\\s]*("+s[j]+")(?:\\.("+s[j]+")(?:\\.("+s[j]+")(?:"+s[v]+")?"+s[y]+"?)?)?";var T=u++;s[T]="^"+s[O]+"\\s*"+s[N]+"$";var z=u++;s[z]="^"+s[O]+"\\s*"+s[P]+"$";var k=u++;s[k]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var D=u++;s[D]="(?:~>?)";var C=u++;s[C]="(\\s*)"+s[D]+"\\s+",a[C]=new RegExp(s[C],"g");var S=u++;s[S]="^"+s[D]+s[N]+"$";var H=u++;s[H]="^"+s[D]+s[P]+"$";var A=u++;s[A]="(?:\\^)";var R=u++;s[R]="(\\s*)"+s[A]+"\\s+",a[R]=new RegExp(s[R],"g");var V=u++;s[V]="^"+s[A]+s[N]+"$";var F=u++;s[F]="^"+s[A]+s[P]+"$";var W=u++;s[W]="^"+s[O]+"\\s*("+x+")$|^$";var $=u++;s[$]="^"+s[O]+"\\s*("+w+")$|^$";var M=u++;s[M]="(\\s*)"+s[O]+"\\s*("+x+"|"+s[N]+")",a[M]=new RegExp(s[M],"g");var I=u++;s[I]="^\\s*("+s[N]+")\\s+-\\s+("+s[N]+")\\s*$";var B=u++;s[B]="^\\s*("+s[P]+")\\s+-\\s+("+s[P]+")\\s*$";var q=u++;s[q]="(<|>)?=?\\s*\\*";for(var U=0;U<35;U++)n(U,s[U]),a[U]||(a[U]=new RegExp(s[U]));function Z(t,e){if(t instanceof X)return t;if("string"!=typeof t)return null;if(t.length>i)return null;if(!(e?a[L]:a[b]).test(t))return null;try{return new X(t,e)}catch(t){return null}}function X(t,e){if(t instanceof X){if(t.loose===e)return t;t=t.version}else if("string"!=typeof t)throw new TypeError("Invalid Version: "+t);if(t.length>i)throw new TypeError("version is longer than "+i+" characters");if(!(this instanceof X))return new X(t,e);n("SemVer",t,e),this.loose=e;var r=t.trim().match(e?a[L]:a[b]);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>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(function(t){if(/^[0-9]+$/.test(t)){var e=+t;if(e>=0&&e<o)return e}return t}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}e.parse=Z,e.valid=function(t,e){var r=Z(t,e);return r?r.version:null},e.clean=function(t,e){var r=Z(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null},e.SemVer=X,X.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},X.prototype.toString=function(){return this.version},X.prototype.compare=function(t){return n("SemVer.compare",this.version,this.loose,t),t instanceof X||(t=new X(t,this.loose)),this.compareMain(t)||this.comparePre(t)},X.prototype.compareMain=function(t){return t instanceof X||(t=new X(t,this.loose)),J(this.major,t.major)||J(this.minor,t.minor)||J(this.patch,t.patch)},X.prototype.comparePre=function(t){if(t instanceof X||(t=new X(t,this.loose)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;var e=0;do{var r=this.prerelease[e],i=t.prerelease[e];if(n("prerelease compare",e,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return J(r,i)}while(++e)},X.prototype.inc=function(t,e){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",e);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",e);break;case"prepatch":this.prerelease.length=0,this.inc("patch",e),this.inc("pre",e);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",e),this.inc("pre",e);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var r=this.prerelease.length;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);-1===r&&this.prerelease.push(0)}e&&(this.prerelease[0]===e?isNaN(this.prerelease[1])&&(this.prerelease=[e,0]):this.prerelease=[e,0]);break;default:throw new Error("invalid increment argument: "+t)}return this.format(),this.raw=this.version,this},e.inc=function(t,e,r,n){"string"==typeof r&&(n=r,r=void 0);try{return new X(t,r).inc(e,n).version}catch(t){return null}},e.diff=function(t,e){if(tt(t,e))return null;var r=Z(t),n=Z(e);if(r.prerelease.length||n.prerelease.length){for(var i in r)if(("major"===i||"minor"===i||"patch"===i)&&r[i]!==n[i])return"pre"+i;return"prerelease"}for(var i in r)if(("major"===i||"minor"===i||"patch"===i)&&r[i]!==n[i])return i},e.compareIdentifiers=J;var G=/^[0-9]+$/;function J(t,e){var r=G.test(t),n=G.test(e);return r&&n&&(t=+t,e=+e),r&&!n?-1:n&&!r?1:t<e?-1:t>e?1:0}function K(t,e,r){return new X(t,r).compare(new X(e,r))}function Q(t,e,r){return K(t,e,r)>0}function Y(t,e,r){return K(t,e,r)<0}function tt(t,e,r){return 0===K(t,e,r)}function et(t,e,r){return 0!==K(t,e,r)}function rt(t,e,r){return K(t,e,r)>=0}function nt(t,e,r){return K(t,e,r)<=0}function it(t,e,r,n){var i;switch(e){case"===":"object"==typeof t&&(t=t.version),"object"==typeof r&&(r=r.version),i=t===r;break;case"!==":"object"==typeof t&&(t=t.version),"object"==typeof r&&(r=r.version),i=t!==r;break;case"":case"=":case"==":i=tt(t,r,n);break;case"!=":i=et(t,r,n);break;case">":i=Q(t,r,n);break;case">=":i=rt(t,r,n);break;case"<":i=Y(t,r,n);break;case"<=":i=nt(t,r,n);break;default:throw new TypeError("Invalid operator: "+e)}return i}function ot(t,e){if(t instanceof ot){if(t.loose===e)return t;t=t.value}if(!(this instanceof ot))return new ot(t,e);n("comparator",t,e),this.loose=e,this.parse(t),this.semver===at?this.value="":this.value=this.operator+this.semver.version,n("comp",this)}e.rcompareIdentifiers=function(t,e){return J(e,t)},e.major=function(t,e){return new X(t,e).major},e.minor=function(t,e){return new X(t,e).minor},e.patch=function(t,e){return new X(t,e).patch},e.compare=K,e.compareLoose=function(t,e){return K(t,e,!0)},e.rcompare=function(t,e,r){return K(e,t,r)},e.sort=function(t,r){return t.sort(function(t,n){return e.compare(t,n,r)})},e.rsort=function(t,r){return t.sort(function(t,n){return e.rcompare(t,n,r)})},e.gt=Q,e.lt=Y,e.eq=tt,e.neq=et,e.gte=rt,e.lte=nt,e.cmp=it,e.Comparator=ot;var at={};function st(t,e){if(t instanceof st)return t.loose===e?t:new st(t.raw,e);if(t instanceof ot)return new st(t.value,e);if(!(this instanceof st))return new st(t,e);if(this.loose=e,this.raw=t,this.set=t.split(/\s*\|\|\s*/).map(function(t){return this.parseRange(t.trim())},this).filter(function(t){return t.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+t);this.format()}function ut(t){return!t||"x"===t.toLowerCase()||"*"===t}function lt(t,e,r,n,i,o,a,s,u,l,c,p,h){return((e=ut(r)?"":ut(n)?">="+r+".0.0":ut(i)?">="+r+"."+n+".0":">="+e)+" "+(s=ut(u)?"":ut(l)?"<"+(+u+1)+".0.0":ut(c)?"<"+u+"."+(+l+1)+".0":p?"<="+u+"."+l+"."+c+"-"+p:"<="+s)).trim()}function ct(t,e){for(var r=0;r<t.length;r++)if(!t[r].test(e))return!1;if(e.prerelease.length){for(r=0;r<t.length;r++)if(n(t[r].semver),t[r].semver!==at&&t[r].semver.prerelease.length>0){var i=t[r].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}function pt(t,e,r){try{e=new st(e,r)}catch(t){return!1}return e.test(t)}function ht(t,e,r,n){var i,o,a,s,u;switch(t=new X(t,n),e=new st(e,n),r){case">":i=Q,o=nt,a=Y,s=">",u=">=";break;case"<":i=Y,o=rt,a=Q,s="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(pt(t,e,n))return!1;for(var l=0;l<e.set.length;++l){var c=e.set[l],p=null,h=null;if(c.forEach(function(t){t.semver===at&&(t=new ot(">=0.0.0")),p=p||t,h=h||t,i(t.semver,p.semver,n)?p=t:a(t.semver,h.semver,n)&&(h=t)}),p.operator===s||p.operator===u)return!1;if((!h.operator||h.operator===s)&&o(t,h.semver))return!1;if(h.operator===u&&a(t,h.semver))return!1}return!0}ot.prototype.parse=function(t){var e=this.loose?a[W]:a[$],r=t.match(e);if(!r)throw new TypeError("Invalid comparator: "+t);this.operator=r[1],"="===this.operator&&(this.operator=""),r[2]?this.semver=new X(r[2],this.loose):this.semver=at},ot.prototype.toString=function(){return this.value},ot.prototype.test=function(t){return n("Comparator.test",t,this.loose),this.semver===at||("string"==typeof t&&(t=new X(t,this.loose)),it(t,this.operator,this.semver,this.loose))},ot.prototype.intersects=function(t,e){if(!(t instanceof ot))throw new TypeError("a Comparator is required");var r;if(""===this.operator)return r=new st(t.value,e),pt(this.value,r,e);if(""===t.operator)return r=new st(this.value,e),pt(t.semver,r,e);var n=!(">="!==this.operator&&">"!==this.operator||">="!==t.operator&&">"!==t.operator),i=!("<="!==this.operator&&"<"!==this.operator||"<="!==t.operator&&"<"!==t.operator),o=this.semver.version===t.semver.version,a=!(">="!==this.operator&&"<="!==this.operator||">="!==t.operator&&"<="!==t.operator),s=it(this.semver,"<",t.semver,e)&&(">="===this.operator||">"===this.operator)&&("<="===t.operator||"<"===t.operator),u=it(this.semver,">",t.semver,e)&&("<="===this.operator||"<"===this.operator)&&(">="===t.operator||">"===t.operator);return n||i||o&&a||s||u},e.Range=st,st.prototype.format=function(){return this.range=this.set.map(function(t){return t.join(" ").trim()}).join("||").trim(),this.range},st.prototype.toString=function(){return this.range},st.prototype.parseRange=function(t){var e=this.loose;t=t.trim(),n("range",t,e);var r=e?a[B]:a[I];t=t.replace(r,lt),n("hyphen replace",t),t=t.replace(a[M],"$1$2$3"),n("comparator trim",t,a[M]),t=(t=(t=t.replace(a[C],"$1~")).replace(a[R],"$1^")).split(/\s+/).join(" ");var i=e?a[W]:a[$],o=t.split(" ").map(function(t){return function(t,e){return n("comp",t),t=function(t,e){return t.trim().split(/\s+/).map(function(t){return function(t,e){n("caret",t,e);var r=e?a[F]:a[V];return t.replace(r,function(e,r,i,o,a){var s;return n("caret",t,e,r,i,o,a),ut(r)?s="":ut(i)?s=">="+r+".0.0 <"+(+r+1)+".0.0":ut(o)?s="0"===r?">="+r+"."+i+".0 <"+r+"."+(+i+1)+".0":">="+r+"."+i+".0 <"+(+r+1)+".0.0":a?(n("replaceCaret pr",a),"-"!==a.charAt(0)&&(a="-"+a),s="0"===r?"0"===i?">="+r+"."+i+"."+o+a+" <"+r+"."+i+"."+(+o+1):">="+r+"."+i+"."+o+a+" <"+r+"."+(+i+1)+".0":">="+r+"."+i+"."+o+a+" <"+(+r+1)+".0.0"):(n("no pr"),s="0"===r?"0"===i?">="+r+"."+i+"."+o+" <"+r+"."+i+"."+(+o+1):">="+r+"."+i+"."+o+" <"+r+"."+(+i+1)+".0":">="+r+"."+i+"."+o+" <"+(+r+1)+".0.0"),n("caret return",s),s})}(t,e)}).join(" ")}(t,e),n("caret",t),t=function(t,e){return t.trim().split(/\s+/).map(function(t){return function(t,e){var r=e?a[H]:a[S];return t.replace(r,function(e,r,i,o,a){var s;return n("tilde",t,e,r,i,o,a),ut(r)?s="":ut(i)?s=">="+r+".0.0 <"+(+r+1)+".0.0":ut(o)?s=">="+r+"."+i+".0 <"+r+"."+(+i+1)+".0":a?(n("replaceTilde pr",a),"-"!==a.charAt(0)&&(a="-"+a),s=">="+r+"."+i+"."+o+a+" <"+r+"."+(+i+1)+".0"):s=">="+r+"."+i+"."+o+" <"+r+"."+(+i+1)+".0",n("tilde return",s),s})}(t,e)}).join(" ")}(t,e),n("tildes",t),t=function(t,e){return n("replaceXRanges",t,e),t.split(/\s+/).map(function(t){return function(t,e){t=t.trim();var r=e?a[z]:a[T];return t.replace(r,function(e,r,i,o,a,s){n("xRange",t,e,r,i,o,a,s);var u=ut(i),l=u||ut(o),c=l||ut(a),p=c;return"="===r&&p&&(r=""),u?e=">"===r||"<"===r?"<0.0.0":"*":r&&p?(l&&(o=0),c&&(a=0),">"===r?(r=">=",l?(i=+i+1,o=0,a=0):c&&(o=+o+1,a=0)):"<="===r&&(r="<",l?i=+i+1:o=+o+1),e=r+i+"."+o+"."+a):l?e=">="+i+".0.0 <"+(+i+1)+".0.0":c&&(e=">="+i+"."+o+".0 <"+i+"."+(+o+1)+".0"),n("xRange return",e),e})}(t,e)}).join(" ")}(t,e),n("xrange",t),t=function(t,e){return n("replaceStars",t,e),t.trim().replace(a[q],"")}(t,e),n("stars",t),t}(t,e)}).join(" ").split(/\s+/);return this.loose&&(o=o.filter(function(t){return!!t.match(i)})),o=o.map(function(t){return new ot(t,e)})},st.prototype.intersects=function(t,e){if(!(t instanceof st))throw new TypeError("a Range is required");return this.set.some(function(r){return r.every(function(r){return t.set.some(function(t){return t.every(function(t){return r.intersects(t,e)})})})})},e.toComparators=function(t,e){return new st(t,e).set.map(function(t){return t.map(function(t){return t.value}).join(" ").trim().split(" ")})},st.prototype.test=function(t){if(!t)return!1;"string"==typeof t&&(t=new X(t,this.loose));for(var e=0;e<this.set.length;e++)if(ct(this.set[e],t))return!0;return!1},e.satisfies=pt,e.maxSatisfying=function(t,e,r){var n=null,i=null;try{var o=new st(e,r)}catch(t){return null}return t.forEach(function(t){o.test(t)&&(n&&-1!==i.compare(t)||(i=new X(n=t,r)))}),n},e.minSatisfying=function(t,e,r){var n=null,i=null;try{var o=new st(e,r)}catch(t){return null}return t.forEach(function(t){o.test(t)&&(n&&1!==i.compare(t)||(i=new X(n=t,r)))}),n},e.validRange=function(t,e){try{return new st(t,e).range||"*"}catch(t){return null}},e.ltr=function(t,e,r){return ht(t,e,"<",r)},e.gtr=function(t,e,r){return ht(t,e,">",r)},e.outside=ht,e.prerelease=function(t,e){var r=Z(t,e);return r&&r.prerelease.length?r.prerelease:null},e.intersects=function(t,e,r){return t=new st(t,r),e=new st(e,r),t.intersects(e)},e.coerce=function(t){if(t instanceof X)return t;if("string"!=typeof t)return null;var e=t.match(a[k]);return null==e?null:Z((e[1]||"0")+"."+(e[2]||"0")+"."+(e[3]||"0"))}}).call(this,r(1))},function(t,e){var r,n,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var u,l=[],c=!1,p=-1;function h(){c&&u&&(c=!1,u.length?l=u.concat(l):p=-1,l.length&&f())}function f(){if(!c){var t=s(h);c=!0;for(var e=l.length;e;){for(u=l,l=[];++p<e;)u&&u[p].run();p=-1,e=l.length}u=null,c=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function m(t,e){this.fun=t,this.array=e}function _(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];l.push(new m(t,e)),1!==l.length||c||s(f)},m.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=_,i.addListener=_,i.once=_,i.off=_,i.removeListener=_,i.removeAllListeners=_,i.emit=_,i.prependListener=_,i.prependOnceListener=_,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,r){"use strict";function n(t){return"string"==typeof t?document.querySelector(t):t}function i(t){return"string"==typeof t?t:t.propertyName}function o(t){return"string"==typeof t?null:t}function a(t){return"#"+u(t.r)+u(t.g)+u(t.b)+u(Math.floor(255*t.a))}function s(t){return"rgba("+t.r+","+t.g+","+t.b+","+t.a+")"}function u(t){return isNaN(t)||void 0===t?"":t.toString(16).padStart(2,"0").toUpperCase()}function l(t,e,r){void 0===r&&(r=!1),r&&t.on("updated",function(){e(!1)}),t.viz?e(!0):t.on("loaded",function(){e(!0)})}r.r(e);var c=function(){return(c=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},p=16,h="#000";function f(t){var e=t.getLegendData(),r=Math.floor(e.data.length/2);return e.data[r].value}function m(t,e){var r=t[e];return"ramp"===r.expressionName||"opacity"===r.expressionName?s(f(r)):"color"===e||"strokeColor"===e?s(r.value):h}function _(t,e,r){var n=t[e];return"ramp"===n.expressionName?r||f(n):"number"===n.type?n.value:r}function d(t){var e=t.symbol;return"ramp"===e.expressionName?f(e):e.value}function v(t){var e=t.layer,r=t.props,n=e.viz;return n?c({color:m(n,"color"),label:r.label,marker:n.symbol.default?void 0:d(n),strokeColor:m(n,"strokeColor"),strokeStyle:0===_(n,"strokeWidth")?"hidden":void 0,type:e.metadata.geomType,width:_(n,"width",p)},r):{}}function g(t){return t.props?t:{layer:t,props:{label:t.id}}}var y=function(){function t(){}return t.layersLegend=function(t,e,r){void 0===r&&(r={}),t=n(t);var i=e.map(g);i.forEach(function(e,n,o){l(e.layer,function(){var e=i.map(v);r.format&&(e.label=r.format(e.label,n,o)),t.data=e,r.onLoad&&setTimeout(r.onLoad,0)},r.dynamic)})},t.rampLegend=function(t,e,r,i){void 0===i&&(i={}),t=n(t);var o=g(e);l(o.layer,function(){var e=v(o),n=o.layer.viz[r],s=i.config,u=o.layer.viz[r].getLegendData(s).data,l=u.map(function(t,o,s){var u,l,p,h,f;return c({},e,((u={})[r]=function(t,e){return"color"===t.type?a(e):e}(n,t.value),u.label=i.format?i.format(t.key,o,s):(l=t.key,Array.isArray(l)?(h=(p=l)[0],f=p[1],h===-1/0?"< "+f.toFixed(2):f===1/0?"> "+h.toFixed(2):h.toFixed(2)+" - "+f.toFixed(2)):l.toFixed?l.toFixed(2):l),u))});Array.isArray(o.props)&&o.props.length===u.length?t.data=l.map(function(t,e){return c({},t,o.props[e])}):t.data=l,i.onLoad&&setTimeout(i.onLoad,0)},i.dynamic)},t}(),b=r(0),w=r.n(b),x=function(){function t(t,e,r,i,o,a,s,u,l,c){var p=this;void 0===a&&(a=10),void 0===s&&(s=[.15,.15]),this._animationWidget=n(t),this._column=r,this._variableName=i||"animation",this._propertyName=o||"filter",this._carto=e,this._duration=a,this._fade=s,this._animationWidget.playing=!1,this._animationWidget.isLoading=!0,this._layer=u,this._formatCb=c,u.viz?(this._onLayerLoaded(),l()):u.on("loaded",function(){p._onLayerLoaded(),l()})}return Object.defineProperty(t.prototype,"animation",{get:function(){return this._animation},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"variableName",{get:function(){return this._variableName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"propertyName",{get:function(){return this._propertyName},set:function(t){this._propertyName=t},enumerable:!0,configurable:!0}),t.prototype.setRange=function(){},t.prototype._onLayerLoaded=function(){var t=this;this._viz=this._layer.viz;var e=this._getAnimationExpression();e.a&&e.b?this._animation="animation"===e.a.expressionName?e.a:e.b:this._animation=e,this._viz[this._propertyName].blendTo(e,0),this._animation.parent=this._viz,this._animation.notify=this._viz._changed.bind(this._viz),this._animationWidget.duration=this._animation.duration.value,this._animationWidget.playing=!0,this._animationWidget.isLoading=!1,this._animationWidget.addEventListener("play",function(){t._animation.play()}),this._animationWidget.addEventListener("pause",function(){t._animation.pause()}),this._animationWidget.addEventListener("seek",function(e){t._animation.setProgressPct(e.detail[0]/100),t._animation.notify(),t._animationWidget.progressValue=t._formatProgressValue()}),this._layer.on("updated",function(){t._animationWidget.progress=100*t._animation.getProgressPct(),t._animationWidget.progressValue=t._formatProgressValue()})},t.prototype._getAnimationExpression=function(){return this._variableName&&this._viz.variables[this._variableName]?this._viz.variables[this._variableName]:(this._viz.variables[this._variableName]=this._propertyName&&this._viz[this._propertyName].isAnimated()?this._viz[this._propertyName]:this._createDefaultAnimation(),this._viz.variables[this._variableName])},t.prototype._formatProgressValue=function(){var t=this._animation.getProgressValue();return t instanceof Date?this._formatCb?this._formatCb(t):t.toISOString():t instanceof Object&&this._isVLTimeZoneDate(t)?this._formatCb?this._formatCb(t._date):t._date.toISOString():this._formatCb?this._formatCb(t):t},t.prototype._isVLTimeZoneDate=function(t){return"_date"in t},t.prototype._createDefaultAnimation=function(){var t=this._carto.expressions;return t.animation(t.linear(t.prop(this._column),t.globalMin(t.prop(this._column)),t.globalMax(t.prop(this._column))),this._duration,t.fade(this._fade[0],this._fade[1]))},t}();var L=function(t){return t=t||Object.create(null),{on:function(e,r){(t[e]||(t[e]=[])).push(r)},off:function(e,r){t[e]&&t[e].splice(t[e].indexOf(r)>>>0,1)},emit:function(e,r){(t[e]||[]).slice().map(function(t){t(r)}),(t["*"]||[]).slice().map(function(t){t(e,r)})}}},O=function(){function t(e,r,n,i,o){void 0===o&&(o=!0),this._emitter=new L,this._name="asbind_"+e+"_"+r+"_"+t._counter,this._column=r,this._layer=n,this._source=i,this._readOnly=o,t._counter++,this._loadLegendData=this._loadLegendData.bind(this)}return Object.defineProperty(t.prototype,"globalExpression",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"column",{get:function(){return this._column},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"columnPropName",{get:function(){return this._name+"_col"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"readOnly",{get:function(){return this._readOnly},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"layer",{get:function(){return this._layer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"source",{get:function(){return this._source},enumerable:!0,configurable:!0}),t.prototype.on=function(t,e){this._emitter.on(t,e)},t.prototype.setLegendData=function(t){this._legendData=t.data},t.prototype.enableColorMapping=function(){this._mapColors=!0,this._layer.viz?this._loadLegendData():this._layer.on("loaded",this._loadLegendData)},t.prototype._filterChanged=function(){this._emitter.emit("filterChanged",this._name)},t.prototype._loadLegendData=function(){var t=this._layer.viz.color;t.getLegendData&&this.setLegendData(t.getLegendData(this._getLegendConfig()))},t.prototype._getLegendConfig=function(){},t._counter=0,t}();function j(t,e){return N(t.value,e.value,P)}function E(t,e){return N(t.value,e.value,T)}function N(t,e,r){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(r(t[n],e[n]))return!1;return!0}function P(t,e){return t.x[0]!==e.x[0]||t.x[1]!==e.x[1]||t.y!==e.y}function T(t,e){return t.x!==e.x||t.y!==e.y}function z(t){return t.value.map(function(t){return{end:t.x[1],start:t.x[0],value:t.y}})}function k(t){return t.value.map(function(t){return{end:new Date(t.x[1]),start:new Date(t.x[0]),value:t.y}})}function D(t,e){return t.value.map(function(t){return{category:t.x,color:C(t.x,e),end:void 0,start:void 0,value:t.y}})}function C(t,e){if(e){var r=e.find(function(e){return e.key===t});return r?function(t){return"string"==typeof t?t:a(t)}(r.value):void 0}}var S,H=function(t,e){return t.value.map(function(t){return{color:C(t.x,e),name:t.x,value:t.y}})},A=(S=function(t,e){return(S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}S(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),R=function(t){function e(e,r,i,o,a,s,u,l){void 0===s&&(s=!0);var c=t.call(this,"category",o,r,a,s)||this;return c._selection=[],c._lastHistogram=null,c._button=null,c._widget=n(i),c._carto=e,c._button=n(u),c._expression=l,c._widget.disableInteractivity=s,c._widget.showClearButton=!s,c.selectionChanged=c.selectionChanged.bind(c),s||(c._widget.addEventListener("categoriesSelected",c.selectionChanged),c._button&&c._button.addEventListener&&c._button.addEventListener("click",function(){c._filterChanged()})),c}return A(e,t),e.prototype.setDataLayer=function(t){var e=this;this._dataLayer=t,this._dataLayer.on("updated",function(){var t=e._dataLayer.viz.variables[e.name];t&&(null!==e._lastHistogram&&E(e._lastHistogram,t)||(e._lastHistogram={value:t.value},e._widget.categories=H(t,e._legendData)))})},Object.defineProperty(e.prototype,"filter",{get:function(){return 0===this._selection.length?null:"@"+this.columnPropName+" in ["+this._selection.map(function(t){return"'"+t+"'"}).join(",")+"]"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"expression",{get:function(){var t=this._carto.expressions;return t.viewportHistogram(this._expression?this._expression:t.prop(this._column))},enumerable:!0,configurable:!0}),e.prototype.selectionChanged=function(t){this._selection=t.detail,0!==this._selection.length&&this._button||this._filterChanged()},e}(O),V=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),F=function(t){function e(e,r,i,o,a,s,u,l,c){void 0===u&&(u=!0),void 0===l&&(l=!1),void 0===c&&(c=null);var p=t.call(this,"histogram_"+e,a,i,s,u)||this;return p._selection=null,p._inputExpression=null,p._totals=!1,p._widget=n(o),p._carto=r,p._totals=l,p._widget.disableInteractivity=u,p._widget.showClear=!u,p._inputExpression=c,p.selectionChanged=p.selectionChanged.bind(p),u||p._widget.addEventListener("selectionChanged",p.selectionChanged),p}return V(e,t),e.prototype.removeHistogramLayer=function(){this._layer.remove()},e.prototype.setDataLayer=function(t){this._dataLayer=t,this.bindDataLayer()},e.prototype._getLegendConfig=function(){return{samples:this._buckets}},e}(O),W=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),$=function(t){function e(e,r,n,i,o,a,s,u){void 0===a&&(a=!0),void 0===s&&(s=!1),void 0===u&&(u=null);var l=t.call(this,"categorical",e,r,n,i,o,a,s,u)||this;return l._lastHistogram=null,l}return W(e,t),Object.defineProperty(e.prototype,"filter",{get:function(){return null===this._selection?null:"@"+this.columnPropName+" in ["+this._selection.map(function(t){return"'"+t+"'"}).join(",")+"]"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"expression",{get:function(){var t=this._carto.expressions;return t.viewportHistogram(this._inputExpression?this._inputExpression:t.prop(this._column))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"globalExpression",{get:function(){if(!this._totals)return null;var t=this._carto.expressions;return t.globalHistogram(this._inputExpression?this._inputExpression:t.prop(this._column))},enumerable:!0,configurable:!0}),e.prototype.bindDataLayer=function(){var t=this;this._dataLayer.on("updated",function(){t._totals&&!t._globalHistogram&&(t._globalHistogram=t._dataLayer.viz.variables[t.name+"_global"],t._widget.backgroundData=D(t._globalHistogram));var e=t._dataLayer.viz.variables[t.name];if(e&&(null===t._lastHistogram||!E(t._lastHistogram,e)))if(t._lastHistogram={value:e.value},t._globalHistogram){var r=t._globalHistogram.value.map(function(t){var r=e.value.find(function(e){return e.x===t.x});return{x:t.x,y:r?r.y:0}});t._widget.data=D({value:r},t._legendData)}else t._widget.data=D(e,t._legendData)})},e.prototype.selectionChanged=function(t){if(null===t.detail)this._selection=null;else{var e=t.detail.selection;this._selection=e.map(function(t){return t})}this._filterChanged()},e}(F),M=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),I=function(t){function e(e,r,n,i,o,a,s,u,l,c){void 0===o&&(o=20),void 0===u&&(u=!0),void 0===l&&(l=!1),void 0===c&&(c=null);var p=t.call(this,"numerical",e,r,n,i,a,u,l,c)||this;return p._lastHistogram=null,p._buckets=void 0!==s?s.length:o,p._bucketRanges=s,p}return M(e,t),Object.defineProperty(e.prototype,"filter",{get:function(){if(null===this._selection||this._isTimeSeries)return null;var t=this._selection[0],e=this._selection[1],r=t instanceof Date?"date('"+t.toISOString()+"')":t,n=e instanceof Date?"date('"+e.toISOString()+"')":e;return"(@"+this.columnPropName+" >= "+r+" and @"+this.columnPropName+" < "+n+")"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"expression",{get:function(){if(this._totals&&!this._globalHistogram)return null;var t=this._carto.expressions;return t.viewportHistogram(this._inputExpression?this._inputExpression:t.prop(this._column),this._bucketArg())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"globalExpression",{get:function(){if(!this._totals)return null;var t=this._carto.expressions;return t.globalHistogram(this._inputExpression?this._inputExpression:t.prop(this._column),this._bucketArg())},enumerable:!0,configurable:!0}),e.prototype.setTimeSeries=function(t){this._isTimeSeries=t},e.prototype.enableColorMapping=function(){throw new Error("Unsupported for numerical histograms")},e.prototype.setLegendData=function(){throw new Error("Unsupported for numerical histograms")},e.prototype.bindDataLayer=function(){var t=this;this._dataLayer.on("updated",function(){if(t._totals&&!t._globalHistogram&&(t._globalHistogram=t._dataLayer.viz.variables[t.name+"_global"],t._globalHistogram)){var e=t._globalHistogram.input.type;t._bucketRanges=t._globalHistogram.value.map(function(t){return[t.x[0],t.x[1]]}),t._emitter.emit("expressionReady",{name:t.name,expression:t.expression}),t._widget.backgroundData="number"===e?z(t._globalHistogram):k(t._globalHistogram)}var r=t._dataLayer.viz.variables[t.name];if(r&&null!==r.value&&(null===t._lastHistogram||!j(t._lastHistogram,r))){e=r.input.type;t._emitter.emit("rangeChanged",[r.value[0].x[0],r.value[r.value.length-1].x[1]]),t._lastHistogram={value:r.value,input:{type:e}},t._widget.data="number"===e?z(r):k(r)}})},e.prototype.selectionChanged=function(t){if(null===t.detail)this._selection=null;else{var e=this._isTimeSeries?t.detail:t.detail.selection;this._selection=[e[0],e[1]]}this._emitter.emit("rangeChanged",this._selection),this._filterChanged()},e.prototype._bucketArg=function(){return void 0!==this._bucketRanges?this._bucketRanges:this._buckets},e}(F),B=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),q=function(t){function e(e,r,i,o,a){var s=t.call(this,"global_range",o,r,a,!1)||this;return s._value=null,s._widget=n(i),s._carto=e,s._widget.addEventListener("change",function(t){s._value=t.detail,s._filterChanged()}),s}return B(e,t),e.prototype.setDataLayer=function(t){var e=this;this._dataLayer=t,this._dataLayer.on("updated",function(){var t=e._dataLayer.viz.variables[e.name];t&&!e._populated&&(e._widget.minValue=t.value[0],e._widget.maxValue=t.value[1],e._widget.range=t.value,e._populated=!0)})},Object.defineProperty(e.prototype,"filter",{get:function(){return null===this._value?null:"@"+this.columnPropName+" > "+this._value[0]+" and @"+this.columnPropName+" < "+this._value[1]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"expression",{get:function(){var t=this._carto.expressions;return t.list([t.globalMin(t.prop(this._column)),t.globalMax(t.prop(this._column))])},enumerable:!0,configurable:!0}),e}(O),U=function(){function t(t,e,r,i,o,a,s,u,l){var c=this;void 0===a&&(a=10),void 0===s&&(s=[.15,.15]),this._timeSeriesWidget=n(i),this._layer=e,this._carto=t,this._columnName=r,this._duration=a,this._fade=s,this._variableName=u||"animation",this._propertyName=l||"filter",e.viz?(this._onLayerLoaded(),o()):e.on("loaded",function(){c._onLayerLoaded(),o()})}return t.prototype.removeHistogramLayer=function(){this._dataLayer.remove()},t.prototype.setRange=function(t){if(this._animation&&this._animation.input&&this._animation.input.min&&this._animation.input.max)if(null===t)this._animation.input.min.blendTo(this._min,0),this._animation.input.max.blendTo(this._max,0),this._animation.duration.blendTo(this._duration,0);else if(t[0]!==t[1]){var e=this._carto.expressions,r=void 0,n=void 0,i=void 0;"Blend"===this._animation.input.min.expressionName&&"Transition"!==this._animation.input.min.mix.expressionName&&("number"==typeof t[0]&&"number"==typeof t[1]?(r=t[0],n=t[1],i=Math.min(1,(n-r)/(this._max.value-this._min.value))):t[0]instanceof Date&&t[1]instanceof Date&&(r=e.time(t[0]),n=e.time(t[1]),i=Math.min(1,(t[0].getTime()-t[1].getTime())/(this._max.value-this._min.value))),this._animation.input.min.blendTo(r,0),this._animation.input.max.blendTo(n,0),this._animation.duration.blendTo(this._duration*i,0))}},Object.defineProperty(t.prototype,"variableName",{get:function(){return this._variableName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"propertyName",{get:function(){return this._propertyName},set:function(t){this._propertyName=t},enumerable:!0,configurable:!0}),t.prototype.setDuration=function(t){this._duration=t,this._animation.duration.blendTo(t,0)},Object.defineProperty(t.prototype,"animation",{get:function(){return this._animation},enumerable:!0,configurable:!0}),t.prototype._onLayerLoaded=function(){var t=this;this._viz=this._layer.viz;var e=this._getAnimationExpression();e.a&&e.b?this._animation="animation"===e.a.expressionName?e.a:e.b:this._animation=e,this._viz.variables[this._variableName]=this._animation,this._viz[this._propertyName].blendTo(e,0),this._animation.parent=this._viz,this._animation.notify=this._viz._changed.bind(this._viz),this._max=this._animation.input.max,this._min=this._animation.input.min,this._duration=this._animation.duration.value,this._layer.on("updated",function(){t._timeSeriesWidget.progress=100*t._animation.getProgressPct(),t._timeSeriesWidget.playing=t._animation.isPlaying()}),this._timeSeriesWidget.animated=!0,this._timeSeriesWidget.addEventListener("seek",function(e){t._animation.setProgressPct(e.detail/100),t._timeSeriesWidget.progress=e.detail}),this._timeSeriesWidget.addEventListener("play",function(){t._animation.play()}),this._timeSeriesWidget.addEventListener("pause",function(){t._animation.pause()})},t.prototype._getAnimationExpression=function(){return this._variableName&&this._viz.variables[this._variableName]?this._viz.variables[this._variableName]:this._propertyName&&this._viz[this._propertyName]&&this._viz[this._propertyName].isAnimated()?this._viz[this._propertyName]:this._createDefaultAnimation()},t.prototype._createDefaultAnimation=function(){var t=this._carto.expressions;return t.animation(t.linear(t.prop(this._columnName)),this._duration,t.fade(this._fade[0],this._fade[1]))},t}(),Z="^1.2.3",X=function(){function t(t){var e=t.carto,r=t.map,n=t.layer,i=t.source;if(this._vizFilters=[],this._carto=e,this._map=r,this._layer=n,this._source=i,this._id=this._layer.id,this._rebuildFilters=this._rebuildFilters.bind(this),this._updateDataLayerVariables=this._updateDataLayerVariables.bind(this),!this._carto.expressions.globalHistogram)throw new Error("Provided VL version "+this._carto.version+" lacks globalHistogram support.");if(!w.a.satisfies(this._carto.version,Z))throw new Error("Provided VL version "+this._carto.version+" not supported. Must satisfy "+Z)}return t.prototype.numericalHistogram=function(t,e,r){void 0===r&&(r={});var n=r.buckets,a=r.bucketRanges,s=r.readOnly,u=r.totals,l=i(e),c=o(e),p=new I(this._carto,this._layer,t,l,n,this._source,a,s,u,c);return this._addFilter(p),p},t.prototype.categoricalHistogram=function(t,e,r){void 0===r&&(r={});var n=r.readOnly,a=r.totals,s=i(e),u=o(e),l=new $(this._carto,this._layer,t,s,this._source,n,a,u);return this._addFilter(l),l},t.prototype.histogram=function(t,e,r){void 0===r&&(r={});var n=r.buckets,i=r.bucketRanges,o=r.readOnly,a=r.totals;if(void 0===n&&void 0===i){var s=t;return this.categoricalHistogram(s,e,{readOnly:o,totals:a})}return this.numericalHistogram(t,e,{readOnly:o,buckets:n,bucketRanges:i,totals:a})},t.prototype.category=function(t,e,r){void 0===r&&(r={});var n=r.readOnly,a=r.button,s=i(e),u=o(e),l=new R(this._carto,this._layer,t,s,this._source,n,a,u);return this._addFilter(l),l},t.prototype.timeSeries=function(t,e,r){var n=this;if(void 0===r&&(r={}),this._animation)throw new Error("There can only be one animation");var i=r.buckets,o=r.bucketRanges,a=r.readOnly,s=r.totals,u=r.duration,l=r.fade,c=r.variableName,p=r.propertyName;this._animation=new U(this._carto,this._layer,e,t,function(){"filter"===p&&n._rebuildFilters()},u,l,c,p);var h=this.numericalHistogram(t,e,{bucketRanges:o,buckets:i,readOnly:a,totals:s});return h.setTimeSeries(!0),h.on("rangeChanged",function(t){n._animation.setRange(t)}),this._animation},t.prototype.animationControls=function(t,e,r){var n=this;void 0===r&&(r={});var i=r.duration,o=r.fade,a=r.variableName,s=r.propertyName,u=void 0===s?"filter":s;return this._animation=new x(t,this._carto,e,a,u,i,o,this._layer,function(){"filter"===u&&n._rebuildFilters()},null),this._animation},t.prototype.globalRange=function(t,e){var r=new q(this._carto,this._layer,t,e,this._source);return this._addFilter(r),r},t.prototype.build=function(){var t=this;if(0!==this._vizFilters.length){var e=function(){t._appendVariables(),t._buildDataLayer()};this._layer.viz?e():this._layer.on("loaded",e)}},t.prototype._addFilter=function(t){t.on("filterChanged",this._rebuildFilters),t.on("expressionReady",this._updateDataLayerVariables),this._vizFilters.push(t)},t.prototype._appendVariables=function(){var t=this,e=this._carto.expressions;this._vizFilters.forEach(function(r){return t._layer.viz.variables[r.columnPropName]=e.prop(r.column)})},t.prototype._buildDataLayer=function(){var t=this,e=this._getVariables(),r=this._carto.expressions,n=new this._carto.Viz({color:r.rgba(0,0,0,0),strokeWidth:0,variables:e});this._readOnlyLayer=new this._carto.Layer("asbind_ro_"+this._id,this._source,n),this._readOnlyLayer.addTo(this._map),this._vizFilters.forEach(function(e){return e.setDataLayer(t._readOnlyLayer)})},t.prototype._getVariables=function(){for(var t=void 0!==this._readOnlyLayer?this._readOnlyLayer.viz.variables:{},e=0,r=this._vizFilters;e<r.length;e++){var n=r[e],i=n.name;n.globalExpression&&(t[i+"_global"]=n.globalExpression),n.expression&&(t[i]=n.expression),t[n.columnPropName]=this._carto.expressions.prop(n.column)}return t},t.prototype._updateDataLayerVariables=function(t){this._readOnlyLayer.viz&&(this._readOnlyLayer.viz.variables[t.name]=t.expression)},t.prototype._rebuildFilters=function(){var t=this._combineFilters(this._vizFilters.filter(function(t){return null!==t.filter}).map(function(t){return t.filter}));this._readOnlyLayer&&this._readOnlyLayer.viz.filter.blendTo(t,0),this._layer.viz.filter.isAnimated()&&this._animation&&this._layer.viz.variables[this._animation.variableName]&&(t="@"+this._animation.variableName+" and "+t),this._layer.viz.filter.blendTo(t,0)},t.prototype._combineFilters=function(t){return 0===t.length?"1":t.join(" and ")},t}();r.d(e,"VL",function(){return G}),r.d(e,"VLBridge",function(){return X});var G={Bridge:X,Legends:y}}])}); |
@@ -16,3 +16,3 @@ import { BucketRange } from '../../types'; | ||
*/ | ||
export declare class NumericalHistogramFilter extends BaseHistogramFilter<[number, number]> { | ||
export declare class NumericalHistogramFilter extends BaseHistogramFilter<Array<number | Date>> { | ||
private _lastHistogram; | ||
@@ -19,0 +19,0 @@ private _isTimeSeries; |
@@ -75,3 +75,7 @@ var __extends = (this && this.__extends) || (function () { | ||
} | ||
return "(@" + this.columnPropName + " >= " + this._selection[0] + " and @" + this.columnPropName + " < " + this._selection[1] + ")"; | ||
var minN = this._selection[0]; | ||
var maxN = this._selection[1]; | ||
var min = minN instanceof Date ? "date('" + minN.toISOString() + "')" : minN; | ||
var max = maxN instanceof Date ? "date('" + maxN.toISOString() + "')" : maxN; | ||
return "(@" + this.columnPropName + " >= " + min + " and @" + this.columnPropName + " < " + max + ")"; | ||
}, | ||
@@ -78,0 +82,0 @@ enumerable: true, |
@@ -45,3 +45,3 @@ import { VLAnimation } from '../../types'; | ||
*/ | ||
setRange(range: [number, number]): void; | ||
setRange(range: [number, number] | [Date, Date]): void; | ||
readonly variableName: string; | ||
@@ -48,0 +48,0 @@ propertyName: string; |
@@ -66,6 +66,22 @@ import { select } from '../../util/Utils'; | ||
else if (range[0] !== range[1]) { | ||
var ratio = Math.min(1, (range[1] - range[0]) / (this._max.value - this._min.value)); | ||
this._animation.input.min.blendTo(range[0], 0); | ||
this._animation.input.max.blendTo(range[1], 0); | ||
this._animation.duration.blendTo(this._duration * ratio, 0); | ||
var s = this._carto.expressions; | ||
var min = void 0; | ||
var max = void 0; | ||
var ratio = void 0; | ||
if (this._animation.input.min.expressionName === 'Blend' && | ||
this._animation.input.min.mix.expressionName !== 'Transition') { | ||
if (typeof range[0] === 'number' && typeof range[1] === 'number') { | ||
min = range[0]; | ||
max = range[1]; | ||
ratio = Math.min(1, (max - min) / (this._max.value - this._min.value)); | ||
} | ||
else if (range[0] instanceof Date && range[1] instanceof Date) { | ||
min = s.time(range[0]); | ||
max = s.time(range[1]); | ||
ratio = Math.min(1, (range[0].getTime() - range[1].getTime()) / (this._max.value - this._min.value)); | ||
} | ||
this._animation.input.min.blendTo(min, 0); | ||
this._animation.input.max.blendTo(max, 0); | ||
this._animation.duration.blendTo(this._duration * ratio, 0); | ||
} | ||
} | ||
@@ -120,2 +136,3 @@ }; | ||
} | ||
this._viz.variables[this._variableName] = this._animation; | ||
this._viz[this._propertyName].blendTo(expr, 0); | ||
@@ -147,13 +164,12 @@ this._animation.parent = this._viz; | ||
} | ||
this._viz.variables[this._variableName] = this._propertyName && | ||
if (this._propertyName && | ||
this._viz[this._propertyName] && | ||
this._viz[this._propertyName].isAnimated() | ||
? this._viz[this._propertyName] | ||
: this._createDefaultAnimation(); | ||
return this._viz.variables[this._variableName]; | ||
this._viz[this._propertyName].isAnimated()) { | ||
return this._viz[this._propertyName]; | ||
} | ||
return this._createDefaultAnimation(); | ||
}; | ||
TimeSeries.prototype._createDefaultAnimation = function () { | ||
var s = this._carto.expressions; | ||
var animation = s.animation(s.linear(s.prop(this._columnName), s.globalMin(s.prop(this._columnName)), s.globalMax(s.prop(this._columnName))), this._duration, s.fade(this._fade[0], this._fade[1])); | ||
return animation; | ||
return s.animation(s.linear(s.prop(this._columnName)), this._duration, s.fade(this._fade[0], this._fade[1])); | ||
}; | ||
@@ -160,0 +176,0 @@ return TimeSeries; |
@@ -316,4 +316,6 @@ import semver from 'semver'; | ||
} | ||
if (this._layer.viz.filter.isAnimated()) { | ||
newFilter = "@" + this._animation.variableName + " and " + newFilter; | ||
if (this._layer.viz.filter.isAnimated() && this._animation) { | ||
if (this._layer.viz.variables[this._animation.variableName]) { | ||
newFilter = "@" + this._animation.variableName + " and " + newFilter; | ||
} | ||
} | ||
@@ -320,0 +322,0 @@ // Update the Visualization filter |
{ | ||
"name": "@carto/airship-bridge", | ||
"version": "2.2.0-rc.1", | ||
"version": "2.2.0-rc.2", | ||
"description": "Airship bridge to other libs (CARTO VL, CARTO.js)", | ||
@@ -27,4 +27,3 @@ "main": "dist/index.js", | ||
"mitt": "^1.1.3" | ||
}, | ||
"gitHead": "0fa94f26b7a70ae937d3f927e79adcf8f43c435d" | ||
} | ||
} |
@@ -19,3 +19,3 @@ import { BucketRange, VLNumericalHistogram } from '../../types'; | ||
*/ | ||
export class NumericalHistogramFilter extends BaseHistogramFilter<[number, number]> { | ||
export class NumericalHistogramFilter extends BaseHistogramFilter<Array<number | Date>> { | ||
private _lastHistogram: VLNumericalHistogram = null; | ||
@@ -75,3 +75,8 @@ private _isTimeSeries: boolean; | ||
return `(@${this.columnPropName} >= ${this._selection[0]} and @${this.columnPropName} < ${this._selection[1]})`; | ||
const minN = this._selection[0]; | ||
const maxN = this._selection[1]; | ||
const min = minN instanceof Date ? `date('${minN.toISOString()}')` : minN; | ||
const max = maxN instanceof Date ? `date('${maxN.toISOString()}')` : maxN; | ||
return `(@${this.columnPropName} >= ${min} and @${this.columnPropName} < ${max})`; | ||
} | ||
@@ -186,3 +191,3 @@ | ||
} else { | ||
const selection = (this._isTimeSeries ? evt.detail : evt.detail.selection) as [number, number]; | ||
const selection = (this._isTimeSeries ? evt.detail : evt.detail.selection); | ||
this._selection = [selection[0], selection[1]]; | ||
@@ -189,0 +194,0 @@ } |
@@ -81,3 +81,3 @@ import { VLAnimation, VLViz } from '../../types'; | ||
*/ | ||
public setRange(range: [number, number]) { | ||
public setRange(range: [number, number] | [ Date, Date ]) { | ||
if (!this._animation || !this._animation.input || !this._animation.input.min || !this._animation.input.max) { | ||
@@ -92,9 +92,24 @@ return; | ||
} else if (range[0] !== range[1]) { | ||
const ratio = Math.min(1, (range[1] - range[0]) / (this._max.value - this._min.value)); | ||
this._animation.input.min.blendTo(range[0], 0); | ||
this._animation.input.max.blendTo(range[1], 0); | ||
const s = this._carto.expressions; | ||
let min; | ||
let max; | ||
let ratio; | ||
this._animation.duration.blendTo(this._duration * ratio, 0); | ||
if (this._animation.input.min.expressionName === 'Blend' && | ||
this._animation.input.min.mix.expressionName !== 'Transition') { | ||
if (typeof range[0] === 'number' && typeof range[1] === 'number') { | ||
min = range[0]; | ||
max = range[1]; | ||
ratio = Math.min(1, (max - min) / (this._max.value - this._min.value)); | ||
} else if (range[0] instanceof Date && range[1] instanceof Date) { | ||
min = s.time(range[0]); | ||
max = s.time(range[1]); | ||
ratio = Math.min(1, (range[0].getTime() - range[1].getTime()) / (this._max.value - this._min.value)); | ||
} | ||
this._animation.input.min.blendTo(min, 0); | ||
this._animation.input.max.blendTo(max, 0); | ||
this._animation.duration.blendTo(this._duration * ratio, 0); | ||
} | ||
} | ||
} | ||
@@ -143,2 +158,3 @@ | ||
this._viz.variables[this._variableName] = this._animation; | ||
this._viz[this._propertyName].blendTo(expr, 0); | ||
@@ -180,9 +196,9 @@ | ||
this._viz.variables[this._variableName] = this._propertyName && | ||
if (this._propertyName && | ||
this._viz[this._propertyName] && | ||
this._viz[this._propertyName].isAnimated() | ||
? this._viz[this._propertyName] | ||
: this._createDefaultAnimation(); | ||
this._viz[this._propertyName].isAnimated()) { | ||
return this._viz[this._propertyName]; | ||
} | ||
return this._viz.variables[this._variableName]; | ||
return this._createDefaultAnimation(); | ||
} | ||
@@ -192,8 +208,5 @@ | ||
const s = this._carto.expressions; | ||
const animation = s.animation( | ||
s.linear( | ||
s.prop(this._columnName), | ||
s.globalMin(s.prop(this._columnName)), | ||
s.globalMax(s.prop(this._columnName)) | ||
), | ||
return s.animation( | ||
s.linear(s.prop(this._columnName)), | ||
this._duration, | ||
@@ -205,4 +218,2 @@ s.fade( | ||
); | ||
return animation; | ||
} | ||
@@ -209,0 +220,0 @@ } |
@@ -434,3 +434,2 @@ import semver from 'semver'; | ||
const variables = this._readOnlyLayer !== undefined ? this._readOnlyLayer.viz.variables : {}; | ||
for (const filter of this._vizFilters) { | ||
@@ -482,4 +481,6 @@ const name = filter.name; | ||
if (this._layer.viz.filter.isAnimated()) { | ||
newFilter = `@${this._animation.variableName} and ${newFilter}`; | ||
if (this._layer.viz.filter.isAnimated() && this._animation) { | ||
if (this._layer.viz.variables[this._animation.variableName]) { | ||
newFilter = `@${this._animation.variableName} and ${newFilter}`; | ||
} | ||
} | ||
@@ -486,0 +487,0 @@ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
389082
5587
77