retropilot-server/cabana/static/js/2.a84bf109.chunk.js

2 lines
2.2 MiB

(this["webpackJsonpcan-explorer"]=this["webpackJsonpcan-explorer"]||[]).push([[2],[function(e,t,r){"use strict";var n=function(e,t,r){return e.fields=t||[],e.fname=r,e};function accessorName(e){return null==e?null:e.fname}function accessorFields(e){return null==e?null:e.fields}var i=function(e){throw Error(e)},a=function(e){var t,r,n,a=[],o=null,s=0,u=e.length,l="";function push(){a.push(l+e.substring(t,r)),l="",t=r+1}for(e+="",t=r=0;r<u;++r)if("\\"===(n=e[r]))l+=e.substring(t,r),t=++r;else if(n===o)push(),o=null,s=-1;else{if(o)continue;t===s&&'"'===n?(t=r+1,o=n):t===s&&"'"===n?(t=r+1,o=n):"."!==n||s?"["===n?(r>t&&push(),s=t=r+1):"]"===n&&(s||i("Access path missing open bracket: "+e),s>0&&push(),s=0,t=r+1):r>t?push():t=r+1}return s&&i("Access path missing closing bracket: "+e),o&&i("Access path missing closing quote: "+e),r>t&&(r++,push()),a},o=Array.isArray,s=function(e){return e===Object(e)},u=function(e){return"string"===typeof e};function $(e){return o(e)?"["+e.map($)+"]":s(e)||u(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}var l=function(e,t){var r=a(e),i="return _["+r.map($).join("][")+"];";return n(Function("_",i),[e=1===r.length?r[0]:e],t||e)},c=[],f=l("id"),d=n((function(e){return e}),c,"identity"),h=n((function(){return 0}),c,"zero"),p=n((function(){return 1}),c,"one"),g=n((function(){return!0}),c,"true"),m=n((function(){return!1}),c,"false");function log(e,t,r){var n=[t].concat([].slice.call(r));console[e].apply(console,n)}var v=function(e,t){var r=e||0;return{level:function level(e){return arguments.length?(r=+e,this):r},error:function error(){return r>=1&&log(t||"error","ERROR",arguments),this},warn:function warn(){return r>=2&&log(t||"warn","WARN",arguments),this},info:function info(){return r>=3&&log(t||"log","INFO",arguments),this},debug:function debug(){return r>=4&&log(t||"log","DEBUG",arguments),this}}},y=function(e){return e[e.length-1]},_=function(e){return null==e||""===e?null:+e};function exp(e){return function(t){return e*Math.exp(t)}}function transform_log(e){return function(t){return Math.log(e*t)}}function symlog(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function symexp(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function pow(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function pan(e,t,r,n){var i=r(e[0]),a=r(y(e)),o=(a-i)*t;return[n(i-o),n(a-o)]}function panLinear(e,t){return pan(e,t,_,d)}function panLog(e,t){var r=Math.sign(e[0]);return pan(e,t,transform_log(r),exp(r))}function panPow(e,t,r){return pan(e,t,pow(r),pow(1/r))}function panSymlog(e,t,r){return pan(e,t,symlog(r),symexp(r))}function zoom(e,t,r,n,i){var a=n(e[0]),o=n(y(e)),s=null!=t?n(t):(a+o)/2;return[i(s+(a-s)*r),i(s+(o-s)*r)]}function zoomLinear(e,t,r){return zoom(e,t,r,_,d)}function zoomLog(e,t,r){var n=Math.sign(e[0]);return zoom(e,t,r,transform_log(n),exp(n))}function zoomPow(e,t,r,n){return zoom(e,t,r,pow(n),pow(1/n))}function zoomSymlog(e,t,r,n){return zoom(e,t,r,symlog(n),symexp(n))}function quarter(e){return 1+~~(new Date(e).getMonth()/3)}function utcquarter(e){return 1+~~(new Date(e).getUTCMonth()/3)}var b=function(e){return null!=e?o(e)?e:[e]:[]},x=function(e,t,r){var n,i=e[0],a=e[1];return a<i&&(n=a,a=i,i=n),(n=a-i)>=r-t?[t,r]:[i=Math.min(Math.max(i,t),r-n),i+n]},w=function(e){return"function"===typeof e},k=function(e,t){var r,i,o,s,u,l,c,f,d,h=[],p=(e=b(e)).map((function(e,t){return null==e?null:(h.push(t),w(e)?e:a(e).map($).join("]["))})),g=h.length-1,m=b(t),v="var u,v;return ";if(g<0)return null;for(i=0;i<=g;++i)o=p[r=h[i]],w(o)?(s="(u=this."+(l="f"+r)+"(a))",u="(v=this."+l+"(b))",(c=c||{})[l]=o):(s="(u=a["+o+"])",u="(v=b["+o+"])"),l="((v=v instanceof Date?+v:v),(u=u instanceof Date?+u:u))","descending"!==m[r]?(d=1,f=-1):(d=-1,f=1),v+="("+s+"<"+u+"||u==null)&&v!=null?"+f+":(u>v||v==null)&&u!=null?"+d+":"+l+"!==u&&v===v?"+f+":v!==v&&u===u?"+d+(r<g?":":":0");return o=Function("a","b",v+";"),c&&(o=o.bind(c)),e=e.reduce((function(e,t){return w(t)?(accessorFields(t)||[]).forEach((function(t){e[t]=1})):null!=t&&(e[t+""]=1),e}),{}),n(o,Object.keys(e))},S=function(e){return w(e)?e:function(){return e}},E=function(e,t){var r,n;function callback(){t(n),r=n=null}return function(t){n=t,r&&clearTimeout(r),r=setTimeout(callback,e)}},C=function(e){for(var t,r,n=1,i=arguments.length;n<i;++n)for(r in t=arguments[n])e[r]=t[r];return e},T=function(e,t){var r,n,i,a,o=0;if(e&&(r=e.length))if(null==t){for(n=e[o];null==n||n!==n;n=e[++o]);for(i=a=n;o<r;++o)null!=(n=e[o])&&(n<i&&(i=n),n>a&&(a=n))}else{for(n=t(e[o]);null==n||n!==n;n=t(e[++o]));for(i=a=n;o<r;++o)null!=(n=t(e[o]))&&(n<i&&(i=n),n>a&&(a=n))}return[i,a]},O=function(e,t){var r,n,i,a,o,s=-1,u=e.length;if(null==t){for(;++s<u;)if(null!=(n=e[s])&&n>=n){r=i=n;break}for(a=o=s;++s<u;)null!=(n=e[s])&&(r>n&&(r=n,a=s),i<n&&(i=n,o=s))}else{for(;++s<u;)if(null!=(n=t(e[s],s,e))&&n>=n){r=i=n;break}for(a=o=s;++s<u;)null!=(n=t(e[s],s,e))&&(r>n&&(r=n,a=s),i<n&&(i=n,o=s))}return[a,o]},A=Object.prototype.hasOwnProperty,R=function(e,t){return A.call(e,t)},D={},P=function(e){var t,r,n={};function has(e){return R(n,e)&&n[e]!==D}return t={size:0,empty:0,object:n,has:has,get:function get(e){return has(e)?n[e]:void 0},set:function set(e,r){return has(e)||(++t.size,n[e]===D&&--t.empty),n[e]=r,this},delete:function _delete(e){return has(e)&&(--t.size,++t.empty,n[e]=D),this},clear:function clear(){t.size=t.empty=0,t.object=n={}},test:function test(e){return arguments.length?(r=e,t):r},clean:function clean(){var e,i,a={},o=0;for(e in n)(i=n[e])===D||r&&r(i)||(a[e]=i,++o);t.size=o,t.empty=0,t.object=n=a}},e&&Object.keys(e).forEach((function(r){t.set(r,e[r])})),t},j=function(e,t,r,n,i,a){if(!r&&0!==r)return a;var o,s,u=e[0],l=y(e),c=+r;return l<u&&(o=u,u=l,l=o),(o=Math.abs(t-u))<(s=Math.abs(l-t))&&o<=c?n:s<=c?i:a},M=function(e,t){var r=e.prototype=Object.create(t.prototype);return r.constructor=e,r},F=function(e,t,r,n){var i,a=t[0],o=t[t.length-1];return a>o&&(i=a,a=o,o=i),n=void 0===n||n,((r=void 0===r||r)?a<=e:a<e)&&(n?e<=o:e<o)},I=function(e){return"boolean"===typeof e},L=function(e){return"[object Date]"===Object.prototype.toString.call(e)},N=function(e){return"number"===typeof e},B=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},U=function(e,t){e&&(e=t?b(e).map((function(e){return e.replace(/\\(.)/g,"$1")})):b(e));var r=e&&e.length?Function("_","return ''+"+e.map((function(e){return"_["+(t?$(e):a(e).map($).join("]["))+"]"})).join("+'|'+")+";"):function(){return""};return n(r,e,"key")},z=function(e,t){var r=e[0],n=y(e),i=+t;return i?1===i?n:r+i*(n-r):r},q=function(e,t,r,n){var i=t.length,a=r.length;if(!a)return t;if(!i)return r;for(var o=n||new t.constructor(i+a),s=0,u=0,l=0;s<i&&u<a;++l)o[l]=e(t[s],r[u])>0?r[u++]:t[s++];for(;s<i;++s,++l)o[l]=t[s];for(;u<a;++u,++l)o[l]=r[u];return o},W=function(e,t){for(var r="";--t>=0;)r+=e;return r},G=function(e,t,r,n){var i=r||" ",a=e+"",o=t-a.length;return o<=0?a:"left"===n?W(i,o)+a:"center"===n?W(i,~~(o/2))+a+W(i,Math.ceil(o/2)):a+W(i,o)},H=function(e){return e&&y(e)-e[0]||0},V=function(e){return null==e||""===e?null:!(!e||"false"===e||"0"===e)&&!!e};function defaultParser(e){return N(e)?e:L(e)?e:Date.parse(e)}var Y=function(e,t){return t=t||defaultParser,null==e||""===e?null:t(e)},X=function(e){return null==e||""===e?null:e+""},K=function(e){for(var t={},r=0,n=e.length;r<n;++r)t[e[r]]=!0;return t},J=function(e,t,r,n){var i=null!=n?n:"\u2026",a=e+"",o=a.length,s=Math.max(0,t-i.length);return o<=t?a:"left"===r?i+a.slice(o-s):"center"===r?a.slice(0,Math.ceil(s/2))+i+a.slice(o-~~(s/2)):a.slice(0,s)+i},Q=function(e,t,r){if(e){var n,i=0,a=e.length;if(t)for(;i<a;++i)(n=t(e[i]))&&r(n,i,e);else e.forEach(r)}};r.d(t,"f",(function(){return n})),r.d(t,"h",(function(){return accessorName})),r.d(t,"g",(function(){return accessorFields})),r.d(t,"w",(function(){return f})),r.d(t,"x",(function(){return d})),r.d(t,"hb",(function(){return h})),r.d(t,"M",(function(){return p})),r.d(t,"eb",(function(){return g})),r.d(t,"r",(function(){return m})),r.d(t,"K",(function(){return v})),r.d(t,"d",(function(){return 0})),r.d(t,"b",(function(){return 1})),r.d(t,"e",(function(){return 2})),r.d(t,"c",(function(){return 3})),r.d(t,"a",(function(){return 4})),r.d(t,"O",(function(){return panLinear})),r.d(t,"P",(function(){return panLog})),r.d(t,"Q",(function(){return panPow})),r.d(t,"R",(function(){return panSymlog})),r.d(t,"ib",(function(){return zoomLinear})),r.d(t,"jb",(function(){return zoomLog})),r.d(t,"kb",(function(){return zoomPow})),r.d(t,"lb",(function(){return zoomSymlog})),r.d(t,"T",(function(){return quarter})),r.d(t,"fb",(function(){return utcquarter})),r.d(t,"i",(function(){return b})),r.d(t,"j",(function(){return x})),r.d(t,"k",(function(){return k})),r.d(t,"l",(function(){return S})),r.d(t,"m",(function(){return E})),r.d(t,"n",(function(){return i})),r.d(t,"o",(function(){return C})),r.d(t,"p",(function(){return T})),r.d(t,"q",(function(){return O})),r.d(t,"s",(function(){return P})),r.d(t,"t",(function(){return l})),r.d(t,"u",(function(){return j})),r.d(t,"v",(function(){return R})),r.d(t,"y",(function(){return M})),r.d(t,"z",(function(){return F})),r.d(t,"A",(function(){return o})),r.d(t,"B",(function(){return I})),r.d(t,"C",(function(){return L})),r.d(t,"D",(function(){return w})),r.d(t,"E",(function(){return N})),r.d(t,"F",(function(){return s})),r.d(t,"G",(function(){return B})),r.d(t,"H",(function(){return u})),r.d(t,"I",(function(){return U})),r.d(t,"J",(function(){return z})),r.d(t,"L",(function(){return q})),r.d(t,"N",(function(){return G})),r.d(t,"S",(function(){return y})),r.d(t,"U",(function(){return W})),r.d(t,"V",(function(){return H})),r.d(t,"W",(function(){return a})),r.d(t,"X",(function(){return $})),r.d(t,"Y",(function(){return V})),r.d(t,"Z",(function(){return Y})),r.d(t,"ab",(function(){return _})),r.d(t,"cb",(function(){return X})),r.d(t,"bb",(function(){return K})),r.d(t,"db",(function(){return J})),r.d(t,"gb",(function(){return Q}))},function(e,t,r){"use strict";e.exports=r(258)},function(e,t,r){"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}r.d(t,"a",(function(){return _classCallCheck}))},function(e,t,r){"use strict";function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),e}r.d(t,"a",(function(){return _createClass}))},function(e,t,r){e.exports=r(257)},function(e,t,r){"use strict";var n=r(85);function _toConsumableArray(e){return function _arrayWithoutHoles(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||Object(n.a)(e)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}r.d(t,"a",(function(){return _toConsumableArray}))},function(e,t,r){"use strict";function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}r.d(t,"a",(function(){return _getPrototypeOf}))},function(e,t,r){"use strict";function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}r.d(t,"a",(function(){return _assertThisInitialized}))},function(e,t,r){"use strict";function _typeof2(e){return(_typeof2="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function _typeof2(e){return typeof e}:function _typeof2(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _typeof(e){return(_typeof="function"===typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function _typeof(e){return _typeof2(e)}:function _typeof(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_typeof2(e)})(e)}var n=r(7);function _possibleConstructorReturn(e,t){return!t||"object"!==_typeof(t)&&"function"!==typeof t?Object(n.a)(e):t}r.d(t,"a",(function(){return _possibleConstructorReturn}))},function(e,t,r){"use strict";function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(e,t){return e.__proto__=t,e})(e,t)}function _inherits(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}r.d(t,"a",(function(){return _inherits}))},function(e,t,r){"use strict";function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,"a",(function(){return _defineProperty}))},function(e,t,r){"use strict";var n=r(83);var i=r(84);function _slicedToArray(e,t){return Object(n.a)(e)||function _iterableToArrayLimit(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(u){i=!0,a=u}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r}}(e,t)||Object(i.a)()}r.d(t,"a",(function(){return _slicedToArray}))},function(e,t,r){"use strict";function asyncGeneratorStep(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(l){return void r(l)}s.done?t(u):Promise.resolve(u).then(n,i)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var a=e.apply(t,r);function _next(e){asyncGeneratorStep(a,n,i,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(a,n,i,_next,_throw,"throw",e)}_next(void 0)}))}}r.d(t,"a",(function(){return _asyncToGenerator}))},function(e,t,r){var n;!function(){"use strict";var r={}.hasOwnProperty;function classNames(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)&&n.length){var a=classNames.apply(null,n);a&&e.push(a)}else if("object"===i)for(var o in n)r.call(n,o)&&n[o]&&e.push(o)}}return e.join(" ")}e.exports?(classNames.default=classNames,e.exports=classNames):void 0===(n=function(){return classNames}.apply(t,[]))||(e.exports=n)}()},,,function(e,t,r){e.exports=r(484)()},,function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(n){"object"===typeof window&&(r=window)}e.exports=r},,function(e,t){var r=e.exports={version:"2.6.9"};"number"==typeof __e&&(__e=r)},function(e,t,r){"use strict";(function(e){var n=r(368),i=r(369),a=r(370);function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(e,t){if(kMaxLength()<t)throw new RangeError("Invalid typed array length");return Buffer.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=Buffer.prototype:(null===e&&(e=new Buffer(t)),e.length=t),e}function Buffer(e,t,r){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer))return new Buffer(e,t,r);if("number"===typeof e){if("string"===typeof t)throw new Error("If encoding is specified then the first argument must be a string");return allocUnsafe(this,e)}return from(this,e,t,r)}function from(e,t,r,n){if("number"===typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!==typeof ArrayBuffer&&t instanceof ArrayBuffer?function fromArrayBuffer(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);Buffer.TYPED_ARRAY_SUPPORT?(e=t).__proto__=Buffer.prototype:e=fromArrayLike(e,t);return e}(e,t,r,n):"string"===typeof t?function fromString(e,t,r){"string"===typeof r&&""!==r||(r="utf8");if(!Buffer.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|byteLength(t,r),i=(e=createBuffer(e,n)).write(t,r);i!==n&&(e=e.slice(0,i));return e}(e,t,r):function fromObject(e,t){if(Buffer.isBuffer(t)){var r=0|checked(t.length);return 0===(e=createBuffer(e,r)).length?e:(t.copy(e,0,0,r),e)}if(t){if("undefined"!==typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!==typeof t.length||function isnan(e){return e!==e}(t.length)?createBuffer(e,0):fromArrayLike(e,t);if("Buffer"===t.type&&a(t.data))return fromArrayLike(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function assertSize(e){if("number"!==typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function allocUnsafe(e,t){if(assertSize(t),e=createBuffer(e,t<0?0:0|checked(t)),!Buffer.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function fromArrayLike(e,t){var r=t.length<0?0:0|checked(t.length);e=createBuffer(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function checked(e){if(e>=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return 0|e}function byteLength(e,t){if(Buffer.isBuffer(e))return e.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!==typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return utf8ToBytes(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return base64ToBytes(e).length;default:if(n)return utf8ToBytes(e).length;t=(""+t).toLowerCase(),n=!0}}function slowToString(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return hexSlice(this,t,r);case"utf8":case"utf-8":return utf8Slice(this,t,r);case"ascii":return asciiSlice(this,t,r);case"latin1":case"binary":return latin1Slice(this,t,r);case"base64":return base64Slice(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function swap(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function bidirectionalIndexOf(e,t,r,n,i){if(0===e.length)return-1;if("string"===typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"===typeof t&&(t=Buffer.from(t,n)),Buffer.isBuffer(t))return 0===t.length?-1:arrayIndexOf(e,t,r,n,i);if("number"===typeof t)return t&=255,Buffer.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):arrayIndexOf(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(e,t,r,n,i){var a,o=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,u/=2,r/=2}function read(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var l=-1;for(a=r;a<s;a++)if(read(e,a)===read(t,-1===l?0:a-l)){if(-1===l&&(l=a),a-l+1===u)return l*o}else-1!==l&&(a-=a-l),l=-1}else for(r+u>s&&(r=s-u),a=r;a>=0;a--){for(var c=!0,f=0;f<u;f++)if(read(e,a+f)!==read(t,f)){c=!1;break}if(c)return a}return-1}function hexWrite(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var a=t.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o<n;++o){var s=parseInt(t.substr(2*o,2),16);if(isNaN(s))return o;e[r+o]=s}return o}function utf8Write(e,t,r,n){return blitBuffer(utf8ToBytes(t,e.length-r),e,r,n)}function asciiWrite(e,t,r,n){return blitBuffer(function asciiToBytes(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function latin1Write(e,t,r,n){return asciiWrite(e,t,r,n)}function base64Write(e,t,r,n){return blitBuffer(base64ToBytes(t),e,r,n)}function ucs2Write(e,t,r,n){return blitBuffer(function utf16leToBytes(e,t){for(var r,n,i,a=[],o=0;o<e.length&&!((t-=2)<0);++o)r=e.charCodeAt(o),n=r>>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function base64Slice(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function utf8Slice(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var a,s,u,l,c=e[i],f=null,d=c>239?4:c>223?3:c>191?2:1;if(i+d<=r)switch(d){case 1:c<128&&(f=c);break;case 2:128===(192&(a=e[i+1]))&&(l=(31&c)<<6|63&a)>127&&(f=l);break;case 3:a=e[i+1],s=e[i+2],128===(192&a)&&128===(192&s)&&(l=(15&c)<<12|(63&a)<<6|63&s)>2047&&(l<55296||l>57343)&&(f=l);break;case 4:a=e[i+1],s=e[i+2],u=e[i+3],128===(192&a)&&128===(192&s)&&128===(192&u)&&(l=(15&c)<<18|(63&a)<<12|(63&s)<<6|63&u)>65535&&l<1114112&&(f=l)}null===f?(f=65533,d=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=d}return function decodeCodePointsArray(e){var t=e.length;if(t<=o)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=o));return r}(n)}t.Buffer=Buffer,t.SlowBuffer=function SlowBuffer(e){+e!=e&&(e=0);return Buffer.alloc(+e)},t.INSPECT_MAX_BYTES=50,Buffer.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function typedArraySupport(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function foo(){return 42}},42===e.foo()&&"function"===typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(t){return!1}}(),t.kMaxLength=kMaxLength(),Buffer.poolSize=8192,Buffer._augment=function(e){return e.__proto__=Buffer.prototype,e},Buffer.from=function(e,t,r){return from(null,e,t,r)},Buffer.TYPED_ARRAY_SUPPORT&&(Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,"undefined"!==typeof Symbol&&Symbol.species&&Buffer[Symbol.species]===Buffer&&Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:!0})),Buffer.alloc=function(e,t,r){return function alloc(e,t,r,n){return assertSize(t),t<=0?createBuffer(e,t):void 0!==r?"string"===typeof n?createBuffer(e,t).fill(r,n):createBuffer(e,t).fill(r):createBuffer(e,t)}(null,e,t,r)},Buffer.allocUnsafe=function(e){return allocUnsafe(null,e)},Buffer.allocUnsafeSlow=function(e){return allocUnsafe(null,e)},Buffer.isBuffer=function isBuffer(e){return!(null==e||!e._isBuffer)},Buffer.compare=function compare(e,t){if(!Buffer.isBuffer(e)||!Buffer.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},Buffer.isEncoding=function isEncoding(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Buffer.concat=function concat(e,t){if(!a(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return Buffer.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=Buffer.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var o=e[r];if(!Buffer.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},Buffer.byteLength=byteLength,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function swap16(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)swap(this,t,t+1);return this},Buffer.prototype.swap32=function swap32(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)swap(this,t,t+3),swap(this,t+1,t+2);return this},Buffer.prototype.swap64=function swap64(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)swap(this,t,t+7),swap(this,t+1,t+6),swap(this,t+2,t+5),swap(this,t+3,t+4);return this},Buffer.prototype.toString=function toString(){var e=0|this.length;return 0===e?"":0===arguments.length?utf8Slice(this,0,e):slowToString.apply(this,arguments)},Buffer.prototype.equals=function equals(e){if(!Buffer.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===Buffer.compare(this,e)},Buffer.prototype.inspect=function inspect(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},Buffer.prototype.compare=function compare(e,t,r,n,i){if(!Buffer.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),u=this.slice(n,i),l=e.slice(t,r),c=0;c<s;++c)if(u[c]!==l[c]){a=u[c],o=l[c];break}return a<o?-1:o<a?1:0},Buffer.prototype.includes=function includes(e,t,r){return-1!==this.indexOf(e,t,r)},Buffer.prototype.indexOf=function indexOf(e,t,r){return bidirectionalIndexOf(this,e,t,r,!0)},Buffer.prototype.lastIndexOf=function lastIndexOf(e,t,r){return bidirectionalIndexOf(this,e,t,r,!1)},Buffer.prototype.write=function write(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"===typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return hexWrite(this,e,t,r);case"utf8":case"utf-8":return utf8Write(this,e,t,r);case"ascii":return asciiWrite(this,e,t,r);case"latin1":case"binary":return latin1Write(this,e,t,r);case"base64":return base64Write(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var o=4096;function asciiSlice(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function latin1Slice(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function hexSlice(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",a=t;a<r;++a)i+=toHex(e[a]);return i}function utf16leSlice(e,t,r){for(var n=e.slice(t,r),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+256*n[a+1]);return i}function checkOffset(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function checkInt(e,t,r,n,i,a){if(!Buffer.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function objectWriteUInt16(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-r,2);i<a;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function objectWriteUInt32(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-r,4);i<a;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function checkIEEE754(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function writeFloat(e,t,r,n,a){return a||checkIEEE754(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function writeDouble(e,t,r,n,a){return a||checkIEEE754(e,0,r,8),i.write(e,t,r,n,52,8),r+8}Buffer.prototype.slice=function slice(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),Buffer.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=Buffer.prototype;else{var i=t-e;r=new Buffer(i,void 0);for(var a=0;a<i;++a)r[a]=this[a+e]}return r},Buffer.prototype.readUIntLE=function readUIntLE(e,t,r){e|=0,t|=0,r||checkOffset(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return n},Buffer.prototype.readUIntBE=function readUIntBE(e,t,r){e|=0,t|=0,r||checkOffset(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},Buffer.prototype.readUInt8=function readUInt8(e,t){return t||checkOffset(e,1,this.length),this[e]},Buffer.prototype.readUInt16LE=function readUInt16LE(e,t){return t||checkOffset(e,2,this.length),this[e]|this[e+1]<<8},Buffer.prototype.readUInt16BE=function readUInt16BE(e,t){return t||checkOffset(e,2,this.length),this[e]<<8|this[e+1]},Buffer.prototype.readUInt32LE=function readUInt32LE(e,t){return t||checkOffset(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Buffer.prototype.readUInt32BE=function readUInt32BE(e,t){return t||checkOffset(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Buffer.prototype.readIntLE=function readIntLE(e,t,r){e|=0,t|=0,r||checkOffset(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},Buffer.prototype.readIntBE=function readIntBE(e,t,r){e|=0,t|=0,r||checkOffset(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},Buffer.prototype.readInt8=function readInt8(e,t){return t||checkOffset(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Buffer.prototype.readInt16LE=function readInt16LE(e,t){t||checkOffset(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt16BE=function readInt16BE(e,t){t||checkOffset(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt32LE=function readInt32LE(e,t){return t||checkOffset(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Buffer.prototype.readInt32BE=function readInt32BE(e,t){return t||checkOffset(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Buffer.prototype.readFloatLE=function readFloatLE(e,t){return t||checkOffset(e,4,this.length),i.read(this,e,!0,23,4)},Buffer.prototype.readFloatBE=function readFloatBE(e,t){return t||checkOffset(e,4,this.length),i.read(this,e,!1,23,4)},Buffer.prototype.readDoubleLE=function readDoubleLE(e,t){return t||checkOffset(e,8,this.length),i.read(this,e,!0,52,8)},Buffer.prototype.readDoubleBE=function readDoubleBE(e,t){return t||checkOffset(e,8,this.length),i.read(this,e,!1,52,8)},Buffer.prototype.writeUIntLE=function writeUIntLE(e,t,r,n){(e=+e,t|=0,r|=0,n)||checkInt(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a<r&&(i*=256);)this[t+a]=e/i&255;return t+r},Buffer.prototype.writeUIntBE=function writeUIntBE(e,t,r,n){(e=+e,t|=0,r|=0,n)||checkInt(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},Buffer.prototype.writeUInt8=function writeUInt8(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,1,255,0),Buffer.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},Buffer.prototype.writeUInt16LE=function writeUInt16LE(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):objectWriteUInt16(this,e,t,!0),t+2},Buffer.prototype.writeUInt16BE=function writeUInt16BE(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):objectWriteUInt16(this,e,t,!1),t+2},Buffer.prototype.writeUInt32LE=function writeUInt32LE(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):objectWriteUInt32(this,e,t,!0),t+4},Buffer.prototype.writeUInt32BE=function writeUInt32BE(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):objectWriteUInt32(this,e,t,!1),t+4},Buffer.prototype.writeIntLE=function writeIntLE(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);checkInt(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a<r&&(o*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},Buffer.prototype.writeIntBE=function writeIntBE(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);checkInt(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},Buffer.prototype.writeInt8=function writeInt8(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},Buffer.prototype.writeInt16LE=function writeInt16LE(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):objectWriteUInt16(this,e,t,!0),t+2},Buffer.prototype.writeInt16BE=function writeInt16BE(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):objectWriteUInt16(this,e,t,!1),t+2},Buffer.prototype.writeInt32LE=function writeInt32LE(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):objectWriteUInt32(this,e,t,!0),t+4},Buffer.prototype.writeInt32BE=function writeInt32BE(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):objectWriteUInt32(this,e,t,!1),t+4},Buffer.prototype.writeFloatLE=function writeFloatLE(e,t,r){return writeFloat(this,e,t,!0,r)},Buffer.prototype.writeFloatBE=function writeFloatBE(e,t,r){return writeFloat(this,e,t,!1,r)},Buffer.prototype.writeDoubleLE=function writeDoubleLE(e,t,r){return writeDouble(this,e,t,!0,r)},Buffer.prototype.writeDoubleBE=function writeDoubleBE(e,t,r){return writeDouble(this,e,t,!1,r)},Buffer.prototype.copy=function copy(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,a=n-r;if(this===e&&r<t&&t<n)for(i=a-1;i>=0;--i)e[i+t]=this[i+r];else if(a<1e3||!Buffer.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+a),t);return a},Buffer.prototype.fill=function fill(e,t,r,n){if("string"===typeof e){if("string"===typeof t?(n=t,t=0,r=this.length):"string"===typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!==typeof n)throw new TypeError("encoding must be a string");if("string"===typeof n&&!Buffer.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"===typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var a;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"===typeof e)for(a=t;a<r;++a)this[a]=e;else{var o=Buffer.isBuffer(e)?e:utf8ToBytes(new Buffer(e,n).toString()),s=o.length;for(a=0;a<r-t;++a)this[a+t]=o[a%s]}return this};var s=/[^+\/0-9A-Za-z-_]/g;function toHex(e){return e<16?"0"+e.toString(16):e.toString(16)}function utf8ToBytes(e,t){var r;t=t||1/0;for(var n=e.length,i=null,a=[],o=0;o<n;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function base64ToBytes(e){return n.toByteArray(function base64clean(e){if((e=function stringtrim(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(s,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function blitBuffer(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}}).call(this,r(18))},function(e,t){var r=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(e,t,r){var n=r(107)("wks"),i=r(70),a=r(22).Symbol,o="function"==typeof a;(e.exports=function(e){return n[e]||(n[e]=o&&a[e]||(o?a:i)("Symbol."+e))}).store=n},,function(e,t,r){"use strict";var n=r(195),i=r(495),a=Object.prototype.toString;function isArray(e){return"[object Array]"===a.call(e)}function isObject(e){return null!==e&&"object"===typeof e}function isFunction(e){return"[object Function]"===a.call(e)}function forEach(e,t){if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),isArray(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}e.exports={isArray:isArray,isArrayBuffer:function isArrayBuffer(e){return"[object ArrayBuffer]"===a.call(e)},isBuffer:i,isFormData:function isFormData(e){return"undefined"!==typeof FormData&&e instanceof FormData},isArrayBufferView:function isArrayBufferView(e){return"undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function isString(e){return"string"===typeof e},isNumber:function isNumber(e){return"number"===typeof e},isObject:isObject,isUndefined:function isUndefined(e){return"undefined"===typeof e},isDate:function isDate(e){return"[object Date]"===a.call(e)},isFile:function isFile(e){return"[object File]"===a.call(e)},isBlob:function isBlob(e){return"[object Blob]"===a.call(e)},isFunction:isFunction,isStream:function isStream(e){return isObject(e)&&isFunction(e.pipe)},isURLSearchParams:function isURLSearchParams(e){return"undefined"!==typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function isStandardBrowserEnv(){return("undefined"===typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!==typeof window&&"undefined"!==typeof document)},forEach:forEach,merge:function merge(){var e={};function assignValue(t,r){"object"===typeof e[r]&&"object"===typeof t?e[r]=merge(e[r],t):e[r]=t}for(var t=0,r=arguments.length;t<r;t++)forEach(arguments[t],assignValue);return e},deepMerge:function deepMerge(){var e={};function assignValue(t,r){"object"===typeof e[r]&&"object"===typeof t?e[r]=deepMerge(e[r],t):e[r]="object"===typeof t?deepMerge({},t):t}for(var t=0,r=arguments.length;t<r;t++)forEach(arguments[t],assignValue);return e},extend:function extend(e,t,r){return forEach(t,(function assignValue(t,i){e[i]=r&&"function"===typeof t?n(t,r):t})),e},trim:function trim(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(e,t,r){e.exports=r(262)},function(e,t,r){"use strict";t.__esModule=!0;var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(67));t.default=function(e){return function(){var t=e.apply(this,arguments);return new n.default((function(e,r){return function step(i,a){try{var o=t[i](a),s=o.value}catch(u){return void r(u)}if(!o.done)return n.default.resolve(s).then((function(e){step("next",e)}),(function(e){step("throw",e)}));e(s)}("next")}))}}},,function(e,t,r){var n=r(22),i=r(20),a=r(47),o=r(43),s=r(44),u=function $export(e,t,r){var u,l,c,f=e&$export.F,d=e&$export.G,h=e&$export.S,p=e&$export.P,g=e&$export.B,m=e&$export.W,v=d?i:i[t]||(i[t]={}),y=v.prototype,_=d?n:h?n[t]:(n[t]||{}).prototype;for(u in d&&(r=t),r)(l=!f&&_&&void 0!==_[u])&&s(v,u)||(c=l?_[u]:r[u],v[u]=d&&"function"!=typeof _[u]?r[u]:g&&l?a(c,n):m&&_[u]==c?function(e){var t=function F(t,r,n){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,r)}return new e(t,r,n)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(c):p&&"function"==typeof c?a(Function.call,c):c,p&&((v.virtual||(v.virtual={}))[u]=c,e&$export.R&&y&&!y[u]&&o(y,u,c)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t,r){var n=r(38);e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},function(e,t,r){"use strict";var n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&defineProperties(e.prototype,t),r&&defineProperties(e,r),e}}(),a=_interopRequireDefault(r(493)),o=_interopRequireDefault(r(58)),s=r(204);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var u=(0,o.default)("github:request"),l=function(e){function ResponseError(e,t,r){_classCallCheck(this,ResponseError);var n=function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(ResponseError.__proto__||Object.getPrototypeOf(ResponseError)).call(this,e));return n.path=t,n.request=r.config,n.response=(r||{}).response||r,n.status=r.status,n}return function _inherits(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(ResponseError,Error),ResponseError}(),c=function(){function Requestable(e,t,r){_classCallCheck(this,Requestable),this.__apiBase=t||"https://api.github.com",this.__auth={token:e.token,username:e.username,password:e.password},this.__AcceptHeader=r||"v3",e.token?this.__authorizationHeader="token "+e.token:e.username&&e.password&&(this.__authorizationHeader="Basic "+s.Base64.encode(e.username+":"+e.password))}return i(Requestable,[{key:"__getURL",value:function __getURL(e){var t=e;-1===e.indexOf("//")&&(t=this.__apiBase+e);var r="timestamp="+(new Date).getTime();return t.replace(/(timestamp=\d+)/,r)}},{key:"__getRequestHeaders",value:function __getRequestHeaders(e,t){var r={"Content-Type":"application/json;charset=UTF-8",Accept:"application/vnd.github."+(t||this.__AcceptHeader)};return e&&(r.Accept+=".raw"),r.Accept+="+json",this.__authorizationHeader&&(r.Authorization=this.__authorizationHeader),r}},{key:"_getOptionsWithDefaults",value:function _getOptionsWithDefaults(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.visibility||e.affiliation||(e.type=e.type||"all"),e.sort=e.sort||"updated",e.per_page=e.per_page||"100",e}},{key:"_dateToISO",value:function _dateToISO(e){return e&&e instanceof Date&&(e=e.toISOString()),e}},{key:"_request",value:function _request(e,t,r,i,o){var s=this.__getURL(t),l=(r||{}).AcceptHeader;l&&delete r.AcceptHeader;var c=this.__getRequestHeaders(o,l),d={};r&&"object"===("undefined"===typeof r?"undefined":n(r))&&function methodHasNoBody(e){return-1!==f.indexOf(e)}(e)&&(d=r,r=void 0);var h={url:s,method:e,headers:c,params:d,data:r,responseType:o?"text":"json"};u(h.method+" to "+h.url);var p=(0,a.default)(h).catch(callbackErrorOrThrow(i,t));return i&&p.then((function(e){e.data&&Object.keys(e.data).length>0?i(null,e.data,e):"GET"!==h.method&&Object.keys(e.data).length<1?i(null,e.status<300,e):i(null,e.data,e)})),p}},{key:"_request204or404",value:function _request204or404(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"GET";return this._request(n,e,t).then((function success(e){return r&&r(null,!0,e),!0}),(function failure(e){if(404===e.response.status)return r&&r(null,!1,e),!1;throw r&&r(e),e}))}},{key:"_requestAllPages",value:function _requestAllPages(e,t,r,n){var i=this;return n=n||[],this._request("GET",e,t).then((function(a){var o,s=void 0;if(a.data instanceof Array)s=a.data;else{if(!(a.data.items instanceof Array)){var c="cannot figure out how to append "+a.data+" to the result set";throw new l(c,e,a)}s=a.data.items}(o=n).push.apply(o,function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}(s));var f=function getNextPage(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(/\s*,\s*/).reduce((function(e,t){return-1!==t.search(/rel="next"/)?(t.match(/<(.*)>/)||[])[1]:e}),void 0)}(a.headers.link);return f&&(t||(t={}),t.page=parseInt(f.match(/(page=[0-9]*)/g).shift().split("=").pop()),!t||"number"===typeof t.page)?(u("getting next page: "+f),i._requestAllPages(f,t,r,n)):(r&&r(null,n,a),a.data=n,a)})).catch(callbackErrorOrThrow(r,e))}}]),Requestable}();e.exports=c;var f=["GET","HEAD","DELETE"];function callbackErrorOrThrow(e,t){return function handler(r){var n=void 0;if(r.hasOwnProperty("config")){var i=r.response,a=i.status,o=i.statusText,s=r.config,c=a+" error making request "+s.method+" "+s.url+': "'+o+'"';n=new l(c,t,r),u(c+" "+JSON.stringify(r.data))}else n=r;if(!e)throw u("throwing error"),n;u("going to error callback"),e(n)}}},function(e,t,r){(function(e){e.exports=function(){"use strict";var t,r;function hooks(){return t.apply(null,arguments)}function isArray(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function isObject(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function isUndefined(e){return void 0===e}function isNumber(e){return"number"===typeof e||"[object Number]"===Object.prototype.toString.call(e)}function isDate(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function map(e,t){var r,n=[];for(r=0;r<e.length;++r)n.push(t(e[r],r));return n}function hasOwnProp(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function extend(e,t){for(var r in t)hasOwnProp(t,r)&&(e[r]=t[r]);return hasOwnProp(t,"toString")&&(e.toString=t.toString),hasOwnProp(t,"valueOf")&&(e.valueOf=t.valueOf),e}function createUTC(e,t,r,n){return createLocalOrUTC(e,t,r,n,!0).utc()}function getParsingFlags(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function isValid(e){if(null==e._isValid){var t=getParsingFlags(e),n=r.call(t.parsedDateParts,(function(e){return null!=e})),i=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(i=i&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return i;e._isValid=i}return e._isValid}function createInvalid(e){var t=createUTC(NaN);return null!=e?extend(getParsingFlags(t),e):getParsingFlags(t).userInvalidated=!0,t}r=Array.prototype.some?Array.prototype.some:function some(e){for(var t=Object(this),r=t.length>>>0,n=0;n<r;n++)if(n in t&&e.call(this,t[n],n,t))return!0;return!1};var n=hooks.momentProperties=[];function copyConfig(e,t){var r,i,a;if(isUndefined(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),isUndefined(t._i)||(e._i=t._i),isUndefined(t._f)||(e._f=t._f),isUndefined(t._l)||(e._l=t._l),isUndefined(t._strict)||(e._strict=t._strict),isUndefined(t._tzm)||(e._tzm=t._tzm),isUndefined(t._isUTC)||(e._isUTC=t._isUTC),isUndefined(t._offset)||(e._offset=t._offset),isUndefined(t._pf)||(e._pf=getParsingFlags(t)),isUndefined(t._locale)||(e._locale=t._locale),n.length>0)for(r=0;r<n.length;r++)isUndefined(a=t[i=n[r]])||(e[i]=a);return e}var i=!1;function Moment(e){copyConfig(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===i&&(i=!0,hooks.updateOffset(this),i=!1)}function isMoment(e){return e instanceof Moment||null!=e&&null!=e._isAMomentObject}function absFloor(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function toInt(e){var t=+e,r=0;return 0!==t&&isFinite(t)&&(r=absFloor(t)),r}function compareArrays(e,t,r){var n,i=Math.min(e.length,t.length),a=Math.abs(e.length-t.length),o=0;for(n=0;n<i;n++)(r&&e[n]!==t[n]||!r&&toInt(e[n])!==toInt(t[n]))&&o++;return o+a}function warn(e){!1===hooks.suppressDeprecationWarnings&&"undefined"!==typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function deprecate(e,t){var r=!0;return extend((function(){if(null!=hooks.deprecationHandler&&hooks.deprecationHandler(null,e),r){for(var n,i=[],a=0;a<arguments.length;a++){if(n="","object"===typeof arguments[a]){for(var o in n+="\n["+a+"] ",arguments[0])n+=o+": "+arguments[0][o]+", ";n=n.slice(0,-2)}else n=arguments[a];i.push(n)}warn(e+"\nArguments: "+Array.prototype.slice.call(i).join("")+"\n"+(new Error).stack),r=!1}return t.apply(this,arguments)}),t)}var a,o={};function deprecateSimple(e,t){null!=hooks.deprecationHandler&&hooks.deprecationHandler(e,t),o[e]||(warn(t),o[e]=!0)}function isFunction(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function mergeConfigs(e,t){var r,n=extend({},e);for(r in t)hasOwnProp(t,r)&&(isObject(e[r])&&isObject(t[r])?(n[r]={},extend(n[r],e[r]),extend(n[r],t[r])):null!=t[r]?n[r]=t[r]:delete n[r]);for(r in e)hasOwnProp(e,r)&&!hasOwnProp(t,r)&&isObject(e[r])&&(n[r]=extend({},n[r]));return n}function Locale(e){null!=e&&this.set(e)}hooks.suppressDeprecationWarnings=!1,hooks.deprecationHandler=null,a=Object.keys?Object.keys:function keys(e){var t,r=[];for(t in e)hasOwnProp(e,t)&&r.push(t);return r};var s={};function addUnitAlias(e,t){var r=e.toLowerCase();s[r]=s[r+"s"]=s[t]=e}function normalizeUnits(e){return"string"===typeof e?s[e]||s[e.toLowerCase()]:void 0}function normalizeObjectUnits(e){var t,r,n={};for(r in e)hasOwnProp(e,r)&&(t=normalizeUnits(r))&&(n[t]=e[r]);return n}var u={};function addUnitPriority(e,t){u[e]=t}function zeroFill(e,t,r){var n=""+Math.abs(e),i=t-n.length;return(e>=0?r?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+n}var l=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,c=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,f={},d={};function addFormatToken(e,t,r,n){var i=n;"string"===typeof n&&(i=function func(){return this[n]()}),e&&(d[e]=i),t&&(d[t[0]]=function(){return zeroFill(i.apply(this,arguments),t[1],t[2])}),r&&(d[r]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function formatMoment(e,t){return e.isValid()?(t=expandFormat(t,e.localeData()),f[t]=f[t]||function makeFormatFunction(e){var t,r,n,i=e.match(l);for(t=0,r=i.length;t<r;t++)d[i[t]]?i[t]=d[i[t]]:i[t]=(n=i[t]).match(/\[[\s\S]/)?n.replace(/^\[|\]$/g,""):n.replace(/\\/g,"");return function(t){var n,a="";for(n=0;n<r;n++)a+=isFunction(i[n])?i[n].call(t,e):i[n];return a}}(t),f[t](e)):e.localeData().invalidDate()}function expandFormat(e,t){var r=5;function replaceLongDateFormatTokens(e){return t.longDateFormat(e)||e}for(c.lastIndex=0;r>=0&&c.test(e);)e=e.replace(c,replaceLongDateFormatTokens),c.lastIndex=0,r-=1;return e}var h=/\d/,p=/\d\d/,g=/\d{3}/,m=/\d{4}/,v=/[+-]?\d{6}/,y=/\d\d?/,_=/\d\d\d\d?/,b=/\d\d\d\d\d\d?/,x=/\d{1,3}/,w=/\d{1,4}/,k=/[+-]?\d{1,6}/,S=/\d+/,E=/[+-]?\d+/,C=/Z|[+-]\d\d:?\d\d/gi,T=/Z|[+-]\d\d(?::?\d\d)?/gi,O=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,A={};function addRegexToken(e,t,r){A[e]=isFunction(t)?t:function(e,n){return e&&r?r:t}}function getParseRegexForToken(e,t){return hasOwnProp(A,e)?A[e](t._strict,t._locale):new RegExp(function unescapeFormat(e){return regexEscape(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(e,t,r,n,i){return t||r||n||i})))}(e))}function regexEscape(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var R={};function addParseToken(e,t){var r,n=t;for("string"===typeof e&&(e=[e]),isNumber(t)&&(n=function func(e,r){r[t]=toInt(e)}),r=0;r<e.length;r++)R[e[r]]=n}function addWeekParseToken(e,t){addParseToken(e,(function(e,r,n,i){n._w=n._w||{},t(e,n._w,n,i)}))}function addTimeToArrayFromToken(e,t,r){null!=t&&hasOwnProp(R,e)&&R[e](t,r._a,r,e)}var D=0,P=1,j=2,M=3,F=4,I=5,L=6,N=7,B=8;function daysInYear(e){return isLeapYear(e)?366:365}function isLeapYear(e){return e%4===0&&e%100!==0||e%400===0}addFormatToken("Y",0,0,(function(){var e=this.year();return e<=9999?""+e:"+"+e})),addFormatToken(0,["YY",2],0,(function(){return this.year()%100})),addFormatToken(0,["YYYY",4],0,"year"),addFormatToken(0,["YYYYY",5],0,"year"),addFormatToken(0,["YYYYYY",6,!0],0,"year"),addUnitAlias("year","y"),addUnitPriority("year",1),addRegexToken("Y",E),addRegexToken("YY",y,p),addRegexToken("YYYY",w,m),addRegexToken("YYYYY",k,v),addRegexToken("YYYYYY",k,v),addParseToken(["YYYYY","YYYYYY"],D),addParseToken("YYYY",(function(e,t){t[D]=2===e.length?hooks.parseTwoDigitYear(e):toInt(e)})),addParseToken("YY",(function(e,t){t[D]=hooks.parseTwoDigitYear(e)})),addParseToken("Y",(function(e,t){t[D]=parseInt(e,10)})),hooks.parseTwoDigitYear=function(e){return toInt(e)+(toInt(e)>68?1900:2e3)};var U,z=makeGetSet("FullYear",!0);function makeGetSet(e,t){return function(r){return null!=r?(set$1(this,e,r),hooks.updateOffset(this,t),this):get(this,e)}}function get(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function set$1(e,t,r){e.isValid()&&!isNaN(r)&&("FullYear"===t&&isLeapYear(e.year())&&1===e.month()&&29===e.date()?e._d["set"+(e._isUTC?"UTC":"")+t](r,e.month(),daysInMonth(r,e.month())):e._d["set"+(e._isUTC?"UTC":"")+t](r))}function daysInMonth(e,t){if(isNaN(e)||isNaN(t))return NaN;var r=function mod(e,t){return(e%t+t)%t}(t,12);return e+=(t-r)/12,1===r?isLeapYear(e)?29:28:31-r%7%2}U=Array.prototype.indexOf?Array.prototype.indexOf:function indexOf(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},addFormatToken("M",["MM",2],"Mo",(function(){return this.month()+1})),addFormatToken("MMM",0,0,(function(e){return this.localeData().monthsShort(this,e)})),addFormatToken("MMMM",0,0,(function(e){return this.localeData().months(this,e)})),addUnitAlias("month","M"),addUnitPriority("month",8),addRegexToken("M",y),addRegexToken("MM",y,p),addRegexToken("MMM",(function(e,t){return t.monthsShortRegex(e)})),addRegexToken("MMMM",(function(e,t){return t.monthsRegex(e)})),addParseToken(["M","MM"],(function(e,t){t[P]=toInt(e)-1})),addParseToken(["MMM","MMMM"],(function(e,t,r,n){var i=r._locale.monthsParse(e,n,r._strict);null!=i?t[P]=i:getParsingFlags(r).invalidMonth=e}));var q=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,W="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),G="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");function handleStrictParse(e,t,r){var n,i,a,o=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)a=createUTC([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(a,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(a,"").toLocaleLowerCase();return r?"MMM"===t?-1!==(i=U.call(this._shortMonthsParse,o))?i:null:-1!==(i=U.call(this._longMonthsParse,o))?i:null:"MMM"===t?-1!==(i=U.call(this._shortMonthsParse,o))?i:-1!==(i=U.call(this._longMonthsParse,o))?i:null:-1!==(i=U.call(this._longMonthsParse,o))?i:-1!==(i=U.call(this._shortMonthsParse,o))?i:null}function setMonth(e,t){var r;if(!e.isValid())return e;if("string"===typeof t)if(/^\d+$/.test(t))t=toInt(t);else if(!isNumber(t=e.localeData().monthsParse(t)))return e;return r=Math.min(e.date(),daysInMonth(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,r),e}function getSetMonth(e){return null!=e?(setMonth(this,e),hooks.updateOffset(this,!0),this):get(this,"Month")}var H=O,V=O;function computeMonthsParse(){function cmpLenRev(e,t){return t.length-e.length}var e,t,r=[],n=[],i=[];for(e=0;e<12;e++)t=createUTC([2e3,e]),r.push(this.monthsShort(t,"")),n.push(this.months(t,"")),i.push(this.months(t,"")),i.push(this.monthsShort(t,""));for(r.sort(cmpLenRev),n.sort(cmpLenRev),i.sort(cmpLenRev),e=0;e<12;e++)r[e]=regexEscape(r[e]),n[e]=regexEscape(n[e]);for(e=0;e<24;e++)i[e]=regexEscape(i[e]);this._monthsRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+r.join("|")+")","i")}function createDate(e,t,r,n,i,a,o){var s;return e<100&&e>=0?(s=new Date(e+400,t,r,n,i,a,o),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,r,n,i,a,o),s}function createUTCDate(e){var t;if(e<100&&e>=0){var r=Array.prototype.slice.call(arguments);r[0]=e+400,t=new Date(Date.UTC.apply(null,r)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)}else t=new Date(Date.UTC.apply(null,arguments));return t}function firstWeekOffset(e,t,r){var n=7+t-r;return-(7+createUTCDate(e,0,n).getUTCDay()-t)%7+n-1}function dayOfYearFromWeeks(e,t,r,n,i){var a,o,s=1+7*(t-1)+(7+r-n)%7+firstWeekOffset(e,n,i);return s<=0?o=daysInYear(a=e-1)+s:s>daysInYear(e)?(a=e+1,o=s-daysInYear(e)):(a=e,o=s),{year:a,dayOfYear:o}}function weekOfYear(e,t,r){var n,i,a=firstWeekOffset(e.year(),t,r),o=Math.floor((e.dayOfYear()-a-1)/7)+1;return o<1?n=o+weeksInYear(i=e.year()-1,t,r):o>weeksInYear(e.year(),t,r)?(n=o-weeksInYear(e.year(),t,r),i=e.year()+1):(i=e.year(),n=o),{week:n,year:i}}function weeksInYear(e,t,r){var n=firstWeekOffset(e,t,r),i=firstWeekOffset(e+1,t,r);return(daysInYear(e)-n+i)/7}function shiftWeekdays(e,t){return e.slice(t,7).concat(e.slice(0,t))}addFormatToken("w",["ww",2],"wo","week"),addFormatToken("W",["WW",2],"Wo","isoWeek"),addUnitAlias("week","w"),addUnitAlias("isoWeek","W"),addUnitPriority("week",5),addUnitPriority("isoWeek",5),addRegexToken("w",y),addRegexToken("ww",y,p),addRegexToken("W",y),addRegexToken("WW",y,p),addWeekParseToken(["w","ww","W","WW"],(function(e,t,r,n){t[n.substr(0,1)]=toInt(e)})),addFormatToken("d",0,"do","day"),addFormatToken("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),addFormatToken("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),addFormatToken("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),addFormatToken("e",0,0,"weekday"),addFormatToken("E",0,0,"isoWeekday"),addUnitAlias("day","d"),addUnitAlias("weekday","e"),addUnitAlias("isoWeekday","E"),addUnitPriority("day",11),addUnitPriority("weekday",11),addUnitPriority("isoWeekday",11),addRegexToken("d",y),addRegexToken("e",y),addRegexToken("E",y),addRegexToken("dd",(function(e,t){return t.weekdaysMinRegex(e)})),addRegexToken("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),addRegexToken("dddd",(function(e,t){return t.weekdaysRegex(e)})),addWeekParseToken(["dd","ddd","dddd"],(function(e,t,r,n){var i=r._locale.weekdaysParse(e,n,r._strict);null!=i?t.d=i:getParsingFlags(r).invalidWeekday=e})),addWeekParseToken(["d","e","E"],(function(e,t,r,n){t[n]=toInt(e)}));var Y="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),$="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),X="Su_Mo_Tu_We_Th_Fr_Sa".split("_");function handleStrictParse$1(e,t,r){var n,i,a,o=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)a=createUTC([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(a,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(a,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(a,"").toLocaleLowerCase();return r?"dddd"===t?-1!==(i=U.call(this._weekdaysParse,o))?i:null:"ddd"===t?-1!==(i=U.call(this._shortWeekdaysParse,o))?i:null:-1!==(i=U.call(this._minWeekdaysParse,o))?i:null:"dddd"===t?-1!==(i=U.call(this._weekdaysParse,o))?i:-1!==(i=U.call(this._shortWeekdaysParse,o))?i:-1!==(i=U.call(this._minWeekdaysParse,o))?i:null:"ddd"===t?-1!==(i=U.call(this._shortWeekdaysParse,o))?i:-1!==(i=U.call(this._weekdaysParse,o))?i:-1!==(i=U.call(this._minWeekdaysParse,o))?i:null:-1!==(i=U.call(this._minWeekdaysParse,o))?i:-1!==(i=U.call(this._weekdaysParse,o))?i:-1!==(i=U.call(this._shortWeekdaysParse,o))?i:null}var K=O,J=O,Q=O;function computeWeekdaysParse(){function cmpLenRev(e,t){return t.length-e.length}var e,t,r,n,i,a=[],o=[],s=[],u=[];for(e=0;e<7;e++)t=createUTC([2e3,1]).day(e),r=this.weekdaysMin(t,""),n=this.weekdaysShort(t,""),i=this.weekdays(t,""),a.push(r),o.push(n),s.push(i),u.push(r),u.push(n),u.push(i);for(a.sort(cmpLenRev),o.sort(cmpLenRev),s.sort(cmpLenRev),u.sort(cmpLenRev),e=0;e<7;e++)o[e]=regexEscape(o[e]),s[e]=regexEscape(s[e]),u[e]=regexEscape(u[e]);this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function hFormat(){return this.hours()%12||12}function meridiem(e,t){addFormatToken(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function matchMeridiem(e,t){return t._meridiemParse}addFormatToken("H",["HH",2],0,"hour"),addFormatToken("h",["hh",2],0,hFormat),addFormatToken("k",["kk",2],0,(function kFormat(){return this.hours()||24})),addFormatToken("hmm",0,0,(function(){return""+hFormat.apply(this)+zeroFill(this.minutes(),2)})),addFormatToken("hmmss",0,0,(function(){return""+hFormat.apply(this)+zeroFill(this.minutes(),2)+zeroFill(this.seconds(),2)})),addFormatToken("Hmm",0,0,(function(){return""+this.hours()+zeroFill(this.minutes(),2)})),addFormatToken("Hmmss",0,0,(function(){return""+this.hours()+zeroFill(this.minutes(),2)+zeroFill(this.seconds(),2)})),meridiem("a",!0),meridiem("A",!1),addUnitAlias("hour","h"),addUnitPriority("hour",13),addRegexToken("a",matchMeridiem),addRegexToken("A",matchMeridiem),addRegexToken("H",y),addRegexToken("h",y),addRegexToken("k",y),addRegexToken("HH",y,p),addRegexToken("hh",y,p),addRegexToken("kk",y,p),addRegexToken("hmm",_),addRegexToken("hmmss",b),addRegexToken("Hmm",_),addRegexToken("Hmmss",b),addParseToken(["H","HH"],M),addParseToken(["k","kk"],(function(e,t,r){var n=toInt(e);t[M]=24===n?0:n})),addParseToken(["a","A"],(function(e,t,r){r._isPm=r._locale.isPM(e),r._meridiem=e})),addParseToken(["h","hh"],(function(e,t,r){t[M]=toInt(e),getParsingFlags(r).bigHour=!0})),addParseToken("hmm",(function(e,t,r){var n=e.length-2;t[M]=toInt(e.substr(0,n)),t[F]=toInt(e.substr(n)),getParsingFlags(r).bigHour=!0})),addParseToken("hmmss",(function(e,t,r){var n=e.length-4,i=e.length-2;t[M]=toInt(e.substr(0,n)),t[F]=toInt(e.substr(n,2)),t[I]=toInt(e.substr(i)),getParsingFlags(r).bigHour=!0})),addParseToken("Hmm",(function(e,t,r){var n=e.length-2;t[M]=toInt(e.substr(0,n)),t[F]=toInt(e.substr(n))})),addParseToken("Hmmss",(function(e,t,r){var n=e.length-4,i=e.length-2;t[M]=toInt(e.substr(0,n)),t[F]=toInt(e.substr(n,2)),t[I]=toInt(e.substr(i))}));var Z,ee=makeGetSet("Hours",!0),te={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:W,monthsShort:G,week:{dow:0,doy:6},weekdays:Y,weekdaysMin:X,weekdaysShort:$,meridiemParse:/[ap]\.?m?\.?/i},re={},ne={};function normalizeLocale(e){return e?e.toLowerCase().replace("_","-"):e}function loadLocale(t){var r=null;if(!re[t]&&"undefined"!==typeof e&&e&&e.exports)try{r=Z._abbr,!function webpackMissingModule(){var e=new Error("Cannot find module 'undefined'");throw e.code="MODULE_NOT_FOUND",e}(),getSetGlobalLocale(r)}catch(n){}return re[t]}function getSetGlobalLocale(e,t){var r;return e&&((r=isUndefined(t)?getLocale(e):defineLocale(e,t))?Z=r:"undefined"!==typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Z._abbr}function defineLocale(e,t){if(null!==t){var r,n=te;if(t.abbr=e,null!=re[e])deprecateSimple("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=re[e]._config;else if(null!=t.parentLocale)if(null!=re[t.parentLocale])n=re[t.parentLocale]._config;else{if(null==(r=loadLocale(t.parentLocale)))return ne[t.parentLocale]||(ne[t.parentLocale]=[]),ne[t.parentLocale].push({name:e,config:t}),null;n=r._config}return re[e]=new Locale(mergeConfigs(n,t)),ne[e]&&ne[e].forEach((function(e){defineLocale(e.name,e.config)})),getSetGlobalLocale(e),re[e]}return delete re[e],null}function getLocale(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Z;if(!isArray(e)){if(t=loadLocale(e))return t;e=[e]}return function chooseLocale(e){for(var t,r,n,i,a=0;a<e.length;){for(t=(i=normalizeLocale(e[a]).split("-")).length,r=(r=normalizeLocale(e[a+1]))?r.split("-"):null;t>0;){if(n=loadLocale(i.slice(0,t).join("-")))return n;if(r&&r.length>=t&&compareArrays(i,r,!0)>=t-1)break;t--}a++}return Z}(e)}function checkOverflow(e){var t,r=e._a;return r&&-2===getParsingFlags(e).overflow&&(t=r[P]<0||r[P]>11?P:r[j]<1||r[j]>daysInMonth(r[D],r[P])?j:r[M]<0||r[M]>24||24===r[M]&&(0!==r[F]||0!==r[I]||0!==r[L])?M:r[F]<0||r[F]>59?F:r[I]<0||r[I]>59?I:r[L]<0||r[L]>999?L:-1,getParsingFlags(e)._overflowDayOfYear&&(t<D||t>j)&&(t=j),getParsingFlags(e)._overflowWeeks&&-1===t&&(t=N),getParsingFlags(e)._overflowWeekday&&-1===t&&(t=B),getParsingFlags(e).overflow=t),e}function defaults(e,t,r){return null!=e?e:null!=t?t:r}function configFromArray(e){var t,r,n,i,a,o=[];if(!e._d){for(n=function currentDateArray(e){var t=new Date(hooks.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}(e),e._w&&null==e._a[j]&&null==e._a[P]&&function dayOfYearFromWeekInfo(e){var t,r,n,i,a,o,s,u;if(null!=(t=e._w).GG||null!=t.W||null!=t.E)a=1,o=4,r=defaults(t.GG,e._a[D],weekOfYear(createLocal(),1,4).year),n=defaults(t.W,1),((i=defaults(t.E,1))<1||i>7)&&(u=!0);else{a=e._locale._week.dow,o=e._locale._week.doy;var l=weekOfYear(createLocal(),a,o);r=defaults(t.gg,e._a[D],l.year),n=defaults(t.w,l.week),null!=t.d?((i=t.d)<0||i>6)&&(u=!0):null!=t.e?(i=t.e+a,(t.e<0||t.e>6)&&(u=!0)):i=a}n<1||n>weeksInYear(r,a,o)?getParsingFlags(e)._overflowWeeks=!0:null!=u?getParsingFlags(e)._overflowWeekday=!0:(s=dayOfYearFromWeeks(r,n,i,a,o),e._a[D]=s.year,e._dayOfYear=s.dayOfYear)}(e),null!=e._dayOfYear&&(a=defaults(e._a[D],n[D]),(e._dayOfYear>daysInYear(a)||0===e._dayOfYear)&&(getParsingFlags(e)._overflowDayOfYear=!0),r=createUTCDate(a,0,e._dayOfYear),e._a[P]=r.getUTCMonth(),e._a[j]=r.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=o[t]=n[t];for(;t<7;t++)e._a[t]=o[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[M]&&0===e._a[F]&&0===e._a[I]&&0===e._a[L]&&(e._nextDay=!0,e._a[M]=0),e._d=(e._useUTC?createUTCDate:createDate).apply(null,o),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[M]=24),e._w&&"undefined"!==typeof e._w.d&&e._w.d!==i&&(getParsingFlags(e).weekdayMismatch=!0)}}var ie=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ae=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,oe=/Z|[+-]\d\d(?::?\d\d)?/,se=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],ue=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],le=/^\/?Date\((\-?\d+)/i;function configFromISO(e){var t,r,n,i,a,o,s=e._i,u=ie.exec(s)||ae.exec(s);if(u){for(getParsingFlags(e).iso=!0,t=0,r=se.length;t<r;t++)if(se[t][1].exec(u[1])){i=se[t][0],n=!1!==se[t][2];break}if(null==i)return void(e._isValid=!1);if(u[3]){for(t=0,r=ue.length;t<r;t++)if(ue[t][1].exec(u[3])){a=(u[2]||" ")+ue[t][0];break}if(null==a)return void(e._isValid=!1)}if(!n&&null!=a)return void(e._isValid=!1);if(u[4]){if(!oe.exec(u[4]))return void(e._isValid=!1);o="Z"}e._f=i+(a||"")+(o||""),configFromStringAndFormat(e)}else e._isValid=!1}var ce=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;function untruncateYear(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}var fe={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function configFromRFC2822(e){var t=ce.exec(function preprocessRFC2822(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}(e._i));if(t){var r=function extractFromRFC2822Strings(e,t,r,n,i,a){var o=[untruncateYear(e),G.indexOf(t),parseInt(r,10),parseInt(n,10),parseInt(i,10)];return a&&o.push(parseInt(a,10)),o}(t[4],t[3],t[2],t[5],t[6],t[7]);if(!function checkWeekday(e,t,r){return!e||$.indexOf(e)===new Date(t[0],t[1],t[2]).getDay()||(getParsingFlags(r).weekdayMismatch=!0,r._isValid=!1,!1)}(t[1],r,e))return;e._a=r,e._tzm=function calculateOffset(e,t,r){if(e)return fe[e];if(t)return 0;var n=parseInt(r,10),i=n%100;return(n-i)/100*60+i}(t[8],t[9],t[10]),e._d=createUTCDate.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),getParsingFlags(e).rfc2822=!0}else e._isValid=!1}function configFromStringAndFormat(e){if(e._f!==hooks.ISO_8601)if(e._f!==hooks.RFC_2822){e._a=[],getParsingFlags(e).empty=!0;var t,r,n,i,a,o=""+e._i,s=o.length,u=0;for(n=expandFormat(e._f,e._locale).match(l)||[],t=0;t<n.length;t++)i=n[t],(r=(o.match(getParseRegexForToken(i,e))||[])[0])&&((a=o.substr(0,o.indexOf(r))).length>0&&getParsingFlags(e).unusedInput.push(a),o=o.slice(o.indexOf(r)+r.length),u+=r.length),d[i]?(r?getParsingFlags(e).empty=!1:getParsingFlags(e).unusedTokens.push(i),addTimeToArrayFromToken(i,r,e)):e._strict&&!r&&getParsingFlags(e).unusedTokens.push(i);getParsingFlags(e).charsLeftOver=s-u,o.length>0&&getParsingFlags(e).unusedInput.push(o),e._a[M]<=12&&!0===getParsingFlags(e).bigHour&&e._a[M]>0&&(getParsingFlags(e).bigHour=void 0),getParsingFlags(e).parsedDateParts=e._a.slice(0),getParsingFlags(e).meridiem=e._meridiem,e._a[M]=function meridiemFixWrap(e,t,r){var n;return null==r?t:null!=e.meridiemHour?e.meridiemHour(t,r):null!=e.isPM?((n=e.isPM(r))&&t<12&&(t+=12),n||12!==t||(t=0),t):t}(e._locale,e._a[M],e._meridiem),configFromArray(e),checkOverflow(e)}else configFromRFC2822(e);else configFromISO(e)}function prepareConfig(e){var t=e._i,r=e._f;return e._locale=e._locale||getLocale(e._l),null===t||void 0===r&&""===t?createInvalid({nullInput:!0}):("string"===typeof t&&(e._i=t=e._locale.preparse(t)),isMoment(t)?new Moment(checkOverflow(t)):(isDate(t)?e._d=t:isArray(r)?function configFromStringAndArray(e){var t,r,n,i,a;if(0===e._f.length)return getParsingFlags(e).invalidFormat=!0,void(e._d=new Date(NaN));for(i=0;i<e._f.length;i++)a=0,t=copyConfig({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[i],configFromStringAndFormat(t),isValid(t)&&(a+=getParsingFlags(t).charsLeftOver,a+=10*getParsingFlags(t).unusedTokens.length,getParsingFlags(t).score=a,(null==n||a<n)&&(n=a,r=t));extend(e,r||t)}(e):r?configFromStringAndFormat(e):function configFromInput(e){var t=e._i;isUndefined(t)?e._d=new Date(hooks.now()):isDate(t)?e._d=new Date(t.valueOf()):"string"===typeof t?function configFromString(e){var t=le.exec(e._i);null===t?(configFromISO(e),!1===e._isValid&&(delete e._isValid,configFromRFC2822(e),!1===e._isValid&&(delete e._isValid,hooks.createFromInputFallback(e)))):e._d=new Date(+t[1])}(e):isArray(t)?(e._a=map(t.slice(0),(function(e){return parseInt(e,10)})),configFromArray(e)):isObject(t)?function configFromObject(e){if(!e._d){var t=normalizeObjectUnits(e._i);e._a=map([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],(function(e){return e&&parseInt(e,10)})),configFromArray(e)}}(e):isNumber(t)?e._d=new Date(t):hooks.createFromInputFallback(e)}(e),isValid(e)||(e._d=null),e))}function createLocalOrUTC(e,t,r,n,i){var a={};return!0!==r&&!1!==r||(n=r,r=void 0),(isObject(e)&&function isObjectEmpty(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0}(e)||isArray(e)&&0===e.length)&&(e=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=i,a._l=r,a._i=e,a._f=t,a._strict=n,function createFromConfig(e){var t=new Moment(checkOverflow(prepareConfig(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}(a)}function createLocal(e,t,r,n){return createLocalOrUTC(e,t,r,n,!1)}hooks.createFromInputFallback=deprecate("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",(function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))})),hooks.ISO_8601=function(){},hooks.RFC_2822=function(){};var de=deprecate("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=createLocal.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:createInvalid()})),he=deprecate("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=createLocal.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:createInvalid()}));function pickBy(e,t){var r,n;if(1===t.length&&isArray(t[0])&&(t=t[0]),!t.length)return createLocal();for(r=t[0],n=1;n<t.length;++n)t[n].isValid()&&!t[n][e](r)||(r=t[n]);return r}var pe=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Duration(e){var t=normalizeObjectUnits(e),r=t.year||0,n=t.quarter||0,i=t.month||0,a=t.week||t.isoWeek||0,o=t.day||0,s=t.hour||0,u=t.minute||0,l=t.second||0,c=t.millisecond||0;this._isValid=function isDurationValid(e){for(var t in e)if(-1===U.call(pe,t)||null!=e[t]&&isNaN(e[t]))return!1;for(var r=!1,n=0;n<pe.length;++n)if(e[pe[n]]){if(r)return!1;parseFloat(e[pe[n]])!==toInt(e[pe[n]])&&(r=!0)}return!0}(t),this._milliseconds=+c+1e3*l+6e4*u+1e3*s*60*60,this._days=+o+7*a,this._months=+i+3*n+12*r,this._data={},this._locale=getLocale(),this._bubble()}function isDuration(e){return e instanceof Duration}function absRound(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function offset(e,t){addFormatToken(e,0,0,(function(){var e=this.utcOffset(),r="+";return e<0&&(e=-e,r="-"),r+zeroFill(~~(e/60),2)+t+zeroFill(~~e%60,2)}))}offset("Z",":"),offset("ZZ",""),addRegexToken("Z",T),addRegexToken("ZZ",T),addParseToken(["Z","ZZ"],(function(e,t,r){r._useUTC=!0,r._tzm=offsetFromString(T,e)}));var ge=/([\+\-]|\d\d)/gi;function offsetFromString(e,t){var r=(t||"").match(e);if(null===r)return null;var n=((r[r.length-1]||[])+"").match(ge)||["-",0,0],i=60*n[1]+toInt(n[2]);return 0===i?0:"+"===n[0]?i:-i}function cloneWithOffset(e,t){var r,n;return t._isUTC?(r=t.clone(),n=(isMoment(e)||isDate(e)?e.valueOf():createLocal(e).valueOf())-r.valueOf(),r._d.setTime(r._d.valueOf()+n),hooks.updateOffset(r,!1),r):createLocal(e).local()}function getDateOffset(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function isUtc(){return!!this.isValid()&&this._isUTC&&0===this._offset}hooks.updateOffset=function(){};var me=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,ve=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function createDuration(e,t){var r,n,i,a=e,o=null;return isDuration(e)?a={ms:e._milliseconds,d:e._days,M:e._months}:isNumber(e)?(a={},t?a[t]=e:a.milliseconds=e):(o=me.exec(e))?(r="-"===o[1]?-1:1,a={y:0,d:toInt(o[j])*r,h:toInt(o[M])*r,m:toInt(o[F])*r,s:toInt(o[I])*r,ms:toInt(absRound(1e3*o[L]))*r}):(o=ve.exec(e))?(r="-"===o[1]?-1:1,a={y:parseIso(o[2],r),M:parseIso(o[3],r),w:parseIso(o[4],r),d:parseIso(o[5],r),h:parseIso(o[6],r),m:parseIso(o[7],r),s:parseIso(o[8],r)}):null==a?a={}:"object"===typeof a&&("from"in a||"to"in a)&&(i=function momentsDifference(e,t){var r;return e.isValid()&&t.isValid()?(t=cloneWithOffset(t,e),e.isBefore(t)?r=positiveMomentsDifference(e,t):((r=positiveMomentsDifference(t,e)).milliseconds=-r.milliseconds,r.months=-r.months),r):{milliseconds:0,months:0}}(createLocal(a.from),createLocal(a.to)),(a={}).ms=i.milliseconds,a.M=i.months),n=new Duration(a),isDuration(e)&&hasOwnProp(e,"_locale")&&(n._locale=e._locale),n}function parseIso(e,t){var r=e&&parseFloat(e.replace(",","."));return(isNaN(r)?0:r)*t}function positiveMomentsDifference(e,t){var r={};return r.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(r.months,"M").isAfter(t)&&--r.months,r.milliseconds=+t-+e.clone().add(r.months,"M"),r}function createAdder(e,t){return function(r,n){var i;return null===n||isNaN(+n)||(deprecateSimple(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=r,r=n,n=i),addSubtract(this,createDuration(r="string"===typeof r?+r:r,n),e),this}}function addSubtract(e,t,r,n){var i=t._milliseconds,a=absRound(t._days),o=absRound(t._months);e.isValid()&&(n=null==n||n,o&&setMonth(e,get(e,"Month")+o*r),a&&set$1(e,"Date",get(e,"Date")+a*r),i&&e._d.setTime(e._d.valueOf()+i*r),n&&hooks.updateOffset(e,a||o))}createDuration.fn=Duration.prototype,createDuration.invalid=function createInvalid$1(){return createDuration(NaN)};var ye=createAdder(1,"add"),_e=createAdder(-1,"subtract");function monthDiff(e,t){var r=12*(t.year()-e.year())+(t.month()-e.month()),n=e.clone().add(r,"months");return-(r+(t-n<0?(t-n)/(n-e.clone().add(r-1,"months")):(t-n)/(e.clone().add(r+1,"months")-n)))||0}function locale(e){var t;return void 0===e?this._locale._abbr:(null!=(t=getLocale(e))&&(this._locale=t),this)}hooks.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",hooks.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var be=deprecate("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(e){return void 0===e?this.localeData():this.locale(e)}));function localeData(){return this._locale}var xe=1e3,we=60*xe,ke=60*we,Se=3506328*ke;function mod$1(e,t){return(e%t+t)%t}function localStartOfDate(e,t,r){return e<100&&e>=0?new Date(e+400,t,r)-Se:new Date(e,t,r).valueOf()}function utcStartOfDate(e,t,r){return e<100&&e>=0?Date.UTC(e+400,t,r)-Se:Date.UTC(e,t,r)}function addWeekYearFormatToken(e,t){addFormatToken(0,[e,e.length],0,t)}function getSetWeekYearHelper(e,t,r,n,i){var a;return null==e?weekOfYear(this,n,i).year:(t>(a=weeksInYear(e,n,i))&&(t=a),setWeekAll.call(this,e,t,r,n,i))}function setWeekAll(e,t,r,n,i){var a=dayOfYearFromWeeks(e,t,r,n,i),o=createUTCDate(a.year,0,a.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}addFormatToken(0,["gg",2],0,(function(){return this.weekYear()%100})),addFormatToken(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),addWeekYearFormatToken("gggg","weekYear"),addWeekYearFormatToken("ggggg","weekYear"),addWeekYearFormatToken("GGGG","isoWeekYear"),addWeekYearFormatToken("GGGGG","isoWeekYear"),addUnitAlias("weekYear","gg"),addUnitAlias("isoWeekYear","GG"),addUnitPriority("weekYear",1),addUnitPriority("isoWeekYear",1),addRegexToken("G",E),addRegexToken("g",E),addRegexToken("GG",y,p),addRegexToken("gg",y,p),addRegexToken("GGGG",w,m),addRegexToken("gggg",w,m),addRegexToken("GGGGG",k,v),addRegexToken("ggggg",k,v),addWeekParseToken(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,r,n){t[n.substr(0,2)]=toInt(e)})),addWeekParseToken(["gg","GG"],(function(e,t,r,n){t[n]=hooks.parseTwoDigitYear(e)})),addFormatToken("Q",0,"Qo","quarter"),addUnitAlias("quarter","Q"),addUnitPriority("quarter",7),addRegexToken("Q",h),addParseToken("Q",(function(e,t){t[P]=3*(toInt(e)-1)})),addFormatToken("D",["DD",2],"Do","date"),addUnitAlias("date","D"),addUnitPriority("date",9),addRegexToken("D",y),addRegexToken("DD",y,p),addRegexToken("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),addParseToken(["D","DD"],j),addParseToken("Do",(function(e,t){t[j]=toInt(e.match(y)[0])}));var Ee=makeGetSet("Date",!0);addFormatToken("DDD",["DDDD",3],"DDDo","dayOfYear"),addUnitAlias("dayOfYear","DDD"),addUnitPriority("dayOfYear",4),addRegexToken("DDD",x),addRegexToken("DDDD",g),addParseToken(["DDD","DDDD"],(function(e,t,r){r._dayOfYear=toInt(e)})),addFormatToken("m",["mm",2],0,"minute"),addUnitAlias("minute","m"),addUnitPriority("minute",14),addRegexToken("m",y),addRegexToken("mm",y,p),addParseToken(["m","mm"],F);var Ce=makeGetSet("Minutes",!1);addFormatToken("s",["ss",2],0,"second"),addUnitAlias("second","s"),addUnitPriority("second",15),addRegexToken("s",y),addRegexToken("ss",y,p),addParseToken(["s","ss"],I);var Te,Oe=makeGetSet("Seconds",!1);for(addFormatToken("S",0,0,(function(){return~~(this.millisecond()/100)})),addFormatToken(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),addFormatToken(0,["SSS",3],0,"millisecond"),addFormatToken(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),addFormatToken(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),addFormatToken(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),addFormatToken(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),addFormatToken(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),addFormatToken(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),addUnitAlias("millisecond","ms"),addUnitPriority("millisecond",16),addRegexToken("S",x,h),addRegexToken("SS",x,p),addRegexToken("SSS",x,g),Te="SSSS";Te.length<=9;Te+="S")addRegexToken(Te,S);function parseMs(e,t){t[L]=toInt(1e3*("0."+e))}for(Te="S";Te.length<=9;Te+="S")addParseToken(Te,parseMs);var Ae=makeGetSet("Milliseconds",!1);addFormatToken("z",0,0,"zoneAbbr"),addFormatToken("zz",0,0,"zoneName");var Re=Moment.prototype;function preParsePostFormat(e){return e}Re.add=ye,Re.calendar=function calendar$1(e,t){var r=e||createLocal(),n=cloneWithOffset(r,this).startOf("day"),i=hooks.calendarFormat(this,n)||"sameElse",a=t&&(isFunction(t[i])?t[i].call(this,r):t[i]);return this.format(a||this.localeData().calendar(i,this,createLocal(r)))},Re.clone=function clone(){return new Moment(this)},Re.diff=function diff(e,t,r){var n,i,a;if(!this.isValid())return NaN;if(!(n=cloneWithOffset(e,this)).isValid())return NaN;switch(i=6e4*(n.utcOffset()-this.utcOffset()),t=normalizeUnits(t)){case"year":a=monthDiff(this,n)/12;break;case"month":a=monthDiff(this,n);break;case"quarter":a=monthDiff(this,n)/3;break;case"second":a=(this-n)/1e3;break;case"minute":a=(this-n)/6e4;break;case"hour":a=(this-n)/36e5;break;case"day":a=(this-n-i)/864e5;break;case"week":a=(this-n-i)/6048e5;break;default:a=this-n}return r?a:absFloor(a)},Re.endOf=function endOf(e){var t;if(void 0===(e=normalizeUnits(e))||"millisecond"===e||!this.isValid())return this;var r=this._isUTC?utcStartOfDate:localStartOfDate;switch(e){case"year":t=r(this.year()+1,0,1)-1;break;case"quarter":t=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=r(this.year(),this.month()+1,1)-1;break;case"week":t=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=r(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=ke-mod$1(t+(this._isUTC?0:this.utcOffset()*we),ke)-1;break;case"minute":t=this._d.valueOf(),t+=we-mod$1(t,we)-1;break;case"second":t=this._d.valueOf(),t+=xe-mod$1(t,xe)-1}return this._d.setTime(t),hooks.updateOffset(this,!0),this},Re.format=function format(e){e||(e=this.isUtc()?hooks.defaultFormatUtc:hooks.defaultFormat);var t=formatMoment(this,e);return this.localeData().postformat(t)},Re.from=function from(e,t){return this.isValid()&&(isMoment(e)&&e.isValid()||createLocal(e).isValid())?createDuration({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},Re.fromNow=function fromNow(e){return this.from(createLocal(),e)},Re.to=function to(e,t){return this.isValid()&&(isMoment(e)&&e.isValid()||createLocal(e).isValid())?createDuration({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},Re.toNow=function toNow(e){return this.to(createLocal(),e)},Re.get=function stringGet(e){return isFunction(this[e=normalizeUnits(e)])?this[e]():this},Re.invalidAt=function invalidAt(){return getParsingFlags(this).overflow},Re.isAfter=function isAfter(e,t){var r=isMoment(e)?e:createLocal(e);return!(!this.isValid()||!r.isValid())&&("millisecond"===(t=normalizeUnits(t)||"millisecond")?this.valueOf()>r.valueOf():r.valueOf()<this.clone().startOf(t).valueOf())},Re.isBefore=function isBefore(e,t){var r=isMoment(e)?e:createLocal(e);return!(!this.isValid()||!r.isValid())&&("millisecond"===(t=normalizeUnits(t)||"millisecond")?this.valueOf()<r.valueOf():this.clone().endOf(t).valueOf()<r.valueOf())},Re.isBetween=function isBetween(e,t,r,n){var i=isMoment(e)?e:createLocal(e),a=isMoment(t)?t:createLocal(t);return!!(this.isValid()&&i.isValid()&&a.isValid())&&("("===(n=n||"()")[0]?this.isAfter(i,r):!this.isBefore(i,r))&&(")"===n[1]?this.isBefore(a,r):!this.isAfter(a,r))},Re.isSame=function isSame(e,t){var r,n=isMoment(e)?e:createLocal(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=normalizeUnits(t)||"millisecond")?this.valueOf()===n.valueOf():(r=n.valueOf(),this.clone().startOf(t).valueOf()<=r&&r<=this.clone().endOf(t).valueOf()))},Re.isSameOrAfter=function isSameOrAfter(e,t){return this.isSame(e,t)||this.isAfter(e,t)},Re.isSameOrBefore=function isSameOrBefore(e,t){return this.isSame(e,t)||this.isBefore(e,t)},Re.isValid=function isValid$2(){return isValid(this)},Re.lang=be,Re.locale=locale,Re.localeData=localeData,Re.max=he,Re.min=de,Re.parsingFlags=function parsingFlags(){return extend({},getParsingFlags(this))},Re.set=function stringSet(e,t){if("object"===typeof e)for(var r=function getPrioritizedUnits(e){var t=[];for(var r in e)t.push({unit:r,priority:u[r]});return t.sort((function(e,t){return e.priority-t.priority})),t}(e=normalizeObjectUnits(e)),n=0;n<r.length;n++)this[r[n].unit](e[r[n].unit]);else if(isFunction(this[e=normalizeUnits(e)]))return this[e](t);return this},Re.startOf=function startOf(e){var t;if(void 0===(e=normalizeUnits(e))||"millisecond"===e||!this.isValid())return this;var r=this._isUTC?utcStartOfDate:localStartOfDate;switch(e){case"year":t=r(this.year(),0,1);break;case"quarter":t=r(this.year(),this.month()-this.month()%3,1);break;case"month":t=r(this.year(),this.month(),1);break;case"week":t=r(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=r(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=mod$1(t+(this._isUTC?0:this.utcOffset()*we),ke);break;case"minute":t=this._d.valueOf(),t-=mod$1(t,we);break;case"second":t=this._d.valueOf(),t-=mod$1(t,xe)}return this._d.setTime(t),hooks.updateOffset(this,!0),this},Re.subtract=_e,Re.toArray=function toArray(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},Re.toObject=function toObject(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},Re.toDate=function toDate(){return new Date(this.valueOf())},Re.toISOString=function toISOString(e){if(!this.isValid())return null;var t=!0!==e,r=t?this.clone().utc():this;return r.year()<0||r.year()>9999?formatMoment(r,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):isFunction(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",formatMoment(r,"Z")):formatMoment(r,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},Re.inspect=function inspect(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");var r="["+e+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i=t+'[")]';return this.format(r+n+"-MM-DD[T]HH:mm:ss.SSS"+i)},Re.toJSON=function toJSON(){return this.isValid()?this.toISOString():null},Re.toString=function toString(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},Re.unix=function unix(){return Math.floor(this.valueOf()/1e3)},Re.valueOf=function valueOf(){return this._d.valueOf()-6e4*(this._offset||0)},Re.creationData=function creationData(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},Re.year=z,Re.isLeapYear=function getIsLeapYear(){return isLeapYear(this.year())},Re.weekYear=function getSetWeekYear(e){return getSetWeekYearHelper.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},Re.isoWeekYear=function getSetISOWeekYear(e){return getSetWeekYearHelper.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},Re.quarter=Re.quarters=function getSetQuarter(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},Re.month=getSetMonth,Re.daysInMonth=function getDaysInMonth(){return daysInMonth(this.year(),this.month())},Re.week=Re.weeks=function getSetWeek(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},Re.isoWeek=Re.isoWeeks=function getSetISOWeek(e){var t=weekOfYear(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},Re.weeksInYear=function getWeeksInYear(){var e=this.localeData()._week;return weeksInYear(this.year(),e.dow,e.doy)},Re.isoWeeksInYear=function getISOWeeksInYear(){return weeksInYear(this.year(),1,4)},Re.date=Ee,Re.day=Re.days=function getSetDayOfWeek(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=function parseWeekday(e,t){return"string"!==typeof e?e:isNaN(e)?"number"===typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}(e,this.localeData()),this.add(e-t,"d")):t},Re.weekday=function getSetLocaleDayOfWeek(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},Re.isoWeekday=function getSetISODayOfWeek(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=function parseIsoWeekday(e,t){return"string"===typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7},Re.dayOfYear=function getSetDayOfYear(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},Re.hour=Re.hours=ee,Re.minute=Re.minutes=Ce,Re.second=Re.seconds=Oe,Re.millisecond=Re.milliseconds=Ae,Re.utcOffset=function getSetOffset(e,t,r){var n,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"===typeof e){if(null===(e=offsetFromString(T,e)))return this}else Math.abs(e)<16&&!r&&(e*=60);return!this._isUTC&&t&&(n=getDateOffset(this)),this._offset=e,this._isUTC=!0,null!=n&&this.add(n,"m"),i!==e&&(!t||this._changeInProgress?addSubtract(this,createDuration(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,hooks.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?i:getDateOffset(this)},Re.utc=function setOffsetToUTC(e){return this.utcOffset(0,e)},Re.local=function setOffsetToLocal(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(getDateOffset(this),"m")),this},Re.parseZone=function setOffsetToParsedOffset(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"===typeof this._i){var e=offsetFromString(C,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},Re.hasAlignedHourOffset=function hasAlignedHourOffset(e){return!!this.isValid()&&(e=e?createLocal(e).utcOffset():0,(this.utcOffset()-e)%60===0)},Re.isDST=function isDaylightSavingTime(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},Re.isLocal=function isLocal(){return!!this.isValid()&&!this._isUTC},Re.isUtcOffset=function isUtcOffset(){return!!this.isValid()&&this._isUTC},Re.isUtc=isUtc,Re.isUTC=isUtc,Re.zoneAbbr=function getZoneAbbr(){return this._isUTC?"UTC":""},Re.zoneName=function getZoneName(){return this._isUTC?"Coordinated Universal Time":""},Re.dates=deprecate("dates accessor is deprecated. Use date instead.",Ee),Re.months=deprecate("months accessor is deprecated. Use month instead",getSetMonth),Re.years=deprecate("years accessor is deprecated. Use year instead",z),Re.zone=deprecate("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function getSetZone(e,t){return null!=e?("string"!==typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()})),Re.isDSTShifted=deprecate("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function isDaylightSavingTimeShifted(){if(!isUndefined(this._isDSTShifted))return this._isDSTShifted;var e={};if(copyConfig(e,this),(e=prepareConfig(e))._a){var t=e._isUTC?createUTC(e._a):createLocal(e._a);this._isDSTShifted=this.isValid()&&compareArrays(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}));var De=Locale.prototype;function get$1(e,t,r,n){var i=getLocale(),a=createUTC().set(n,t);return i[r](a,e)}function listMonthsImpl(e,t,r){if(isNumber(e)&&(t=e,e=void 0),e=e||"",null!=t)return get$1(e,t,r,"month");var n,i=[];for(n=0;n<12;n++)i[n]=get$1(e,n,r,"month");return i}function listWeekdaysImpl(e,t,r,n){"boolean"===typeof e?(isNumber(t)&&(r=t,t=void 0),t=t||""):(r=t=e,e=!1,isNumber(t)&&(r=t,t=void 0),t=t||"");var i,a=getLocale(),o=e?a._week.dow:0;if(null!=r)return get$1(t,(r+o)%7,n,"day");var s=[];for(i=0;i<7;i++)s[i]=get$1(t,(i+o)%7,n,"day");return s}De.calendar=function calendar(e,t,r){var n=this._calendar[e]||this._calendar.sameElse;return isFunction(n)?n.call(t,r):n},De.longDateFormat=function longDateFormat(e){var t=this._longDateFormat[e],r=this._longDateFormat[e.toUpperCase()];return t||!r?t:(this._longDateFormat[e]=r.replace(/MMMM|MM|DD|dddd/g,(function(e){return e.slice(1)})),this._longDateFormat[e])},De.invalidDate=function invalidDate(){return this._invalidDate},De.ordinal=function ordinal(e){return this._ordinal.replace("%d",e)},De.preparse=preParsePostFormat,De.postformat=preParsePostFormat,De.relativeTime=function relativeTime(e,t,r,n){var i=this._relativeTime[r];return isFunction(i)?i(e,t,r,n):i.replace(/%d/i,e)},De.pastFuture=function pastFuture(e,t){var r=this._relativeTime[e>0?"future":"past"];return isFunction(r)?r(t):r.replace(/%s/i,t)},De.set=function set(e){var t,r;for(r in e)isFunction(t=e[r])?this[r]=t:this["_"+r]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},De.months=function localeMonths(e,t){return e?isArray(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||q).test(t)?"format":"standalone"][e.month()]:isArray(this._months)?this._months:this._months.standalone},De.monthsShort=function localeMonthsShort(e,t){return e?isArray(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[q.test(t)?"format":"standalone"][e.month()]:isArray(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},De.monthsParse=function localeMonthsParse(e,t,r){var n,i,a;if(this._monthsParseExact)return handleStrictParse.call(this,e,t,r);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(i=createUTC([2e3,n]),r&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),r||this._monthsParse[n]||(a="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[n]=new RegExp(a.replace(".",""),"i")),r&&"MMMM"===t&&this._longMonthsParse[n].test(e))return n;if(r&&"MMM"===t&&this._shortMonthsParse[n].test(e))return n;if(!r&&this._monthsParse[n].test(e))return n}},De.monthsRegex=function monthsRegex(e){return this._monthsParseExact?(hasOwnProp(this,"_monthsRegex")||computeMonthsParse.call(this),e?this._monthsStrictRegex:this._monthsRegex):(hasOwnProp(this,"_monthsRegex")||(this._monthsRegex=V),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},De.monthsShortRegex=function monthsShortRegex(e){return this._monthsParseExact?(hasOwnProp(this,"_monthsRegex")||computeMonthsParse.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(hasOwnProp(this,"_monthsShortRegex")||(this._monthsShortRegex=H),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},De.week=function localeWeek(e){return weekOfYear(e,this._week.dow,this._week.doy).week},De.firstDayOfYear=function localeFirstDayOfYear(){return this._week.doy},De.firstDayOfWeek=function localeFirstDayOfWeek(){return this._week.dow},De.weekdays=function localeWeekdays(e,t){var r=isArray(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?shiftWeekdays(r,this._week.dow):e?r[e.day()]:r},De.weekdaysMin=function localeWeekdaysMin(e){return!0===e?shiftWeekdays(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},De.weekdaysShort=function localeWeekdaysShort(e){return!0===e?shiftWeekdays(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},De.weekdaysParse=function localeWeekdaysParse(e,t,r){var n,i,a;if(this._weekdaysParseExact)return handleStrictParse$1.call(this,e,t,r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(i=createUTC([2e3,1]).day(n),r&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(a="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[n]=new RegExp(a.replace(".",""),"i")),r&&"dddd"===t&&this._fullWeekdaysParse[n].test(e))return n;if(r&&"ddd"===t&&this._shortWeekdaysParse[n].test(e))return n;if(r&&"dd"===t&&this._minWeekdaysParse[n].test(e))return n;if(!r&&this._weekdaysParse[n].test(e))return n}},De.weekdaysRegex=function weekdaysRegex(e){return this._weekdaysParseExact?(hasOwnProp(this,"_weekdaysRegex")||computeWeekdaysParse.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(hasOwnProp(this,"_weekdaysRegex")||(this._weekdaysRegex=K),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},De.weekdaysShortRegex=function weekdaysShortRegex(e){return this._weekdaysParseExact?(hasOwnProp(this,"_weekdaysRegex")||computeWeekdaysParse.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(hasOwnProp(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=J),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},De.weekdaysMinRegex=function weekdaysMinRegex(e){return this._weekdaysParseExact?(hasOwnProp(this,"_weekdaysRegex")||computeWeekdaysParse.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(hasOwnProp(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Q),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},De.isPM=function localeIsPM(e){return"p"===(e+"").toLowerCase().charAt(0)},De.meridiem=function localeMeridiem(e,t,r){return e>11?r?"pm":"PM":r?"am":"AM"},getSetGlobalLocale("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function ordinal(e){var t=e%10;return e+(1===toInt(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),hooks.lang=deprecate("moment.lang is deprecated. Use moment.locale instead.",getSetGlobalLocale),hooks.langData=deprecate("moment.langData is deprecated. Use moment.localeData instead.",getLocale);var Pe=Math.abs;function addSubtract$1(e,t,r,n){var i=createDuration(t,r);return e._milliseconds+=n*i._milliseconds,e._days+=n*i._days,e._months+=n*i._months,e._bubble()}function absCeil(e){return e<0?Math.floor(e):Math.ceil(e)}function daysToMonths(e){return 4800*e/146097}function monthsToDays(e){return 146097*e/4800}function makeAs(e){return function(){return this.as(e)}}var je=makeAs("ms"),Me=makeAs("s"),Fe=makeAs("m"),Ie=makeAs("h"),Le=makeAs("d"),Ne=makeAs("w"),Be=makeAs("M"),Ue=makeAs("Q"),ze=makeAs("y");function makeGetter(e){return function(){return this.isValid()?this._data[e]:NaN}}var qe=makeGetter("milliseconds"),We=makeGetter("seconds"),Ge=makeGetter("minutes"),He=makeGetter("hours"),Ve=makeGetter("days"),Ye=makeGetter("months"),$e=makeGetter("years"),Xe=Math.round,Ke={ss:44,s:45,m:45,h:22,d:26,M:11};function substituteTimeAgo(e,t,r,n,i){return i.relativeTime(t||1,!!r,e,n)}var Je=Math.abs;function sign(e){return(e>0)-(e<0)||+e}function toISOString$1(){if(!this.isValid())return this.localeData().invalidDate();var e,t,r=Je(this._milliseconds)/1e3,n=Je(this._days),i=Je(this._months);e=absFloor(r/60),t=absFloor(e/60),r%=60,e%=60;var a=absFloor(i/12),o=i%=12,s=n,u=t,l=e,c=r?r.toFixed(3).replace(/\.?0+$/,""):"",f=this.asSeconds();if(!f)return"P0D";var d=f<0?"-":"",h=sign(this._months)!==sign(f)?"-":"",p=sign(this._days)!==sign(f)?"-":"",g=sign(this._milliseconds)!==sign(f)?"-":"";return d+"P"+(a?h+a+"Y":"")+(o?h+o+"M":"")+(s?p+s+"D":"")+(u||l||c?"T":"")+(u?g+u+"H":"")+(l?g+l+"M":"")+(c?g+c+"S":"")}var Qe=Duration.prototype;return Qe.isValid=function isValid$1(){return this._isValid},Qe.abs=function abs(){var e=this._data;return this._milliseconds=Pe(this._milliseconds),this._days=Pe(this._days),this._months=Pe(this._months),e.milliseconds=Pe(e.milliseconds),e.seconds=Pe(e.seconds),e.minutes=Pe(e.minutes),e.hours=Pe(e.hours),e.months=Pe(e.months),e.years=Pe(e.years),this},Qe.add=function add$1(e,t){return addSubtract$1(this,e,t,1)},Qe.subtract=function subtract$1(e,t){return addSubtract$1(this,e,t,-1)},Qe.as=function as(e){if(!this.isValid())return NaN;var t,r,n=this._milliseconds;if("month"===(e=normalizeUnits(e))||"quarter"===e||"year"===e)switch(t=this._days+n/864e5,r=this._months+daysToMonths(t),e){case"month":return r;case"quarter":return r/3;case"year":return r/12}else switch(t=this._days+Math.round(monthsToDays(this._months)),e){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return 24*t+n/36e5;case"minute":return 1440*t+n/6e4;case"second":return 86400*t+n/1e3;case"millisecond":return Math.floor(864e5*t)+n;default:throw new Error("Unknown unit "+e)}},Qe.asMilliseconds=je,Qe.asSeconds=Me,Qe.asMinutes=Fe,Qe.asHours=Ie,Qe.asDays=Le,Qe.asWeeks=Ne,Qe.asMonths=Be,Qe.asQuarters=Ue,Qe.asYears=ze,Qe.valueOf=function valueOf$1(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*toInt(this._months/12):NaN},Qe._bubble=function bubble(){var e,t,r,n,i,a=this._milliseconds,o=this._days,s=this._months,u=this._data;return a>=0&&o>=0&&s>=0||a<=0&&o<=0&&s<=0||(a+=864e5*absCeil(monthsToDays(s)+o),o=0,s=0),u.milliseconds=a%1e3,e=absFloor(a/1e3),u.seconds=e%60,t=absFloor(e/60),u.minutes=t%60,r=absFloor(t/60),u.hours=r%24,o+=absFloor(r/24),i=absFloor(daysToMonths(o)),s+=i,o-=absCeil(monthsToDays(i)),n=absFloor(s/12),s%=12,u.days=o,u.months=s,u.years=n,this},Qe.clone=function clone$1(){return createDuration(this)},Qe.get=function get$2(e){return e=normalizeUnits(e),this.isValid()?this[e+"s"]():NaN},Qe.milliseconds=qe,Qe.seconds=We,Qe.minutes=Ge,Qe.hours=He,Qe.days=Ve,Qe.weeks=function weeks(){return absFloor(this.days()/7)},Qe.months=Ye,Qe.years=$e,Qe.humanize=function humanize(e){if(!this.isValid())return this.localeData().invalidDate();var t=this.localeData(),r=function relativeTime$1(e,t,r){var n=createDuration(e).abs(),i=Xe(n.as("s")),a=Xe(n.as("m")),o=Xe(n.as("h")),s=Xe(n.as("d")),u=Xe(n.as("M")),l=Xe(n.as("y")),c=i<=Ke.ss&&["s",i]||i<Ke.s&&["ss",i]||a<=1&&["m"]||a<Ke.m&&["mm",a]||o<=1&&["h"]||o<Ke.h&&["hh",o]||s<=1&&["d"]||s<Ke.d&&["dd",s]||u<=1&&["M"]||u<Ke.M&&["MM",u]||l<=1&&["y"]||["yy",l];return c[2]=t,c[3]=+e>0,c[4]=r,substituteTimeAgo.apply(null,c)}(this,!e,t);return e&&(r=t.pastFuture(+this,r)),t.postformat(r)},Qe.toISOString=toISOString$1,Qe.toString=toISOString$1,Qe.toJSON=toISOString$1,Qe.locale=locale,Qe.localeData=localeData,Qe.toIsoString=deprecate("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",toISOString$1),Qe.lang=be,addFormatToken("X",0,0,"unix"),addFormatToken("x",0,0,"valueOf"),addRegexToken("x",E),addRegexToken("X",/[+-]?\d+(\.\d{1,3})?/),addParseToken("X",(function(e,t,r){r._d=new Date(1e3*parseFloat(e,10))})),addParseToken("x",(function(e,t,r){r._d=new Date(toInt(e))})),hooks.version="2.24.0",function setHookCallback(e){t=e}(createLocal),hooks.fn=Re,hooks.min=function min(){return pickBy("isBefore",[].slice.call(arguments,0))},hooks.max=function max(){return pickBy("isAfter",[].slice.call(arguments,0))},hooks.now=function now(){return Date.now?Date.now():+new Date},hooks.utc=createUTC,hooks.unix=function createUnix(e){return createLocal(1e3*e)},hooks.months=function listMonths(e,t){return listMonthsImpl(e,t,"months")},hooks.isDate=isDate,hooks.locale=getSetGlobalLocale,hooks.invalid=createInvalid,hooks.duration=createDuration,hooks.isMoment=isMoment,hooks.weekdays=function listWeekdays(e,t,r){return listWeekdaysImpl(e,t,r,"weekdays")},hooks.parseZone=function createInZone(){return createLocal.apply(null,arguments).parseZone()},hooks.localeData=getLocale,hooks.isDuration=isDuration,hooks.monthsShort=function listMonthsShort(e,t){return listMonthsImpl(e,t,"monthsShort")},hooks.weekdaysMin=function listWeekdaysMin(e,t,r){return listWeekdaysImpl(e,t,r,"weekdaysMin")},hooks.defineLocale=defineLocale,hooks.updateLocale=function updateLocale(e,t){if(null!=t){var r,n,i=te;null!=(n=loadLocale(e))&&(i=n._config),t=mergeConfigs(i,t),(r=new Locale(t)).parentLocale=re[e],re[e]=r,getSetGlobalLocale(e)}else null!=re[e]&&(null!=re[e].parentLocale?re[e]=re[e].parentLocale:null!=re[e]&&delete re[e]);return re[e]},hooks.locales=function listLocales(){return a(re)},hooks.weekdaysShort=function listWeekdaysShort(e,t,r){return listWeekdaysImpl(e,t,r,"weekdaysShort")},hooks.normalizeUnits=normalizeUnits,hooks.relativeTimeRounding=function getSetRelativeTimeRounding(e){return void 0===e?Xe:"function"===typeof e&&(Xe=e,!0)},hooks.relativeTimeThreshold=function getSetRelativeTimeThreshold(e,t){return void 0!==Ke[e]&&(void 0===t?Ke[e]:(Ke[e]=t,"s"===e&&(Ke.ss=t-1),!0))},hooks.calendarFormat=function getCalendarFormat(e,t){var r=e.diff(t,"days",!0);return r<-6?"sameElse":r<-1?"lastWeek":r<0?"lastDay":r<1?"sameDay":r<2?"nextDay":r<7?"nextWeek":"sameElse"},hooks.prototype=Re,hooks.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},hooks}()}).call(this,r(77)(e))},,function(e,t,r){e.exports=r(459)},function(e,t,r){var n=r(30),i=r(142),a=r(102),o=Object.defineProperty;t.f=r(39)?Object.defineProperty:function defineProperty(e,t,r){if(n(e),t=a(t,!0),n(r),i)try{return o(e,t,r)}catch(s){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(e[t]=r.value),e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.patch=t.postForm=t.post=t.get=void 0;var n=_interopRequireDefault(r(26)),i=_interopRequireDefault(r(27)),a=_interopRequireDefault(r(67));t.get=function(){var e=(0,i.default)(n.default.mark((function _callee(e,t){return n.default.wrap((function _callee$(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,ensureInit();case 2:return r.abrupt("return",new a.default((function(r,n){f.get(e,{query:t,json:!0},d(r,n))})));case 3:case"end":return r.stop()}}),_callee,this)})));return function get(t,r){return e.apply(this,arguments)}}(),t.post=function(){var e=(0,i.default)(n.default.mark((function _callee2(e,t){return n.default.wrap((function _callee2$(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,ensureInit();case 2:return r.abrupt("return",new a.default((function(r,n){f.post(e,{body:t,json:!0},d(r,n))})));case 3:case"end":return r.stop()}}),_callee2,this)})));return function post(t,r){return e.apply(this,arguments)}}(),t.postForm=function(){var e=(0,i.default)(n.default.mark((function _callee3(e,t){return n.default.wrap((function _callee3$(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,ensureInit();case 2:return r.abrupt("return",new a.default((function(r,n){f.post(e,{body:s.default.stringify(t),headers:{"Content-Type":"application/x-www-form-urlencoded"}},d(r,n))})));case 3:case"end":return r.stop()}}),_callee3,this)})));return function postForm(t,r){return e.apply(this,arguments)}}(),t.patch=function(){var e=(0,i.default)(n.default.mark((function _callee4(e,t){return n.default.wrap((function _callee4$(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,ensureInit();case 2:return r.abrupt("return",new a.default((function(r,n){f.patch(e,{body:t,json:!0},d(r,n))})));case 3:case"end":return r.stop()}}),_callee4,this)})));return function patch(t,r){return e.apply(this,arguments)}}();t.configure=configure;var o=_interopRequireDefault(r(114)),s=_interopRequireDefault(r(113)),u=_interopRequireDefault(r(76)),l=r(118);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var c,f=(0,o.default)(),d=u.default;function ensureInit(){return c||(c=configure()),c}function configure(e,t){var r={baseUrl:l.COMMA_URL_ROOT,jwt:!1,parse:null};return e&&(r.token="JWT "+e),d=t||u.default,f.configure(r),c=a.default.resolve()}},function(e,t,r){"use strict";var n=_interopRequireWildcard(r(289)),i=_interopRequireWildcard(r(335)),a=_interopRequireWildcard(r(340)),o=_interopRequireWildcard(r(341)),s=_interopRequireWildcard(r(342)),u=_interopRequireDefault(r(345)),l=_interopRequireDefault(r(76)),c=_interopRequireWildcard(r(346)),f=_interopRequireWildcard(r(352)),d=_interopRequireWildcard(r(353)),h=_interopRequireWildcard(r(36)),p=_interopRequireWildcard(r(354)),g=_interopRequireDefault(r(355));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}e.exports={account:n,annotations:i,athena:a,auth:o,devices:s,derived:u.default,drives:c,errorHandler:l.default,leaderboard:f,raw:d,request:h,vehicles:p,video:g.default}},function(e,t){e.exports=function(e){return"object"===typeof e?null!==e:"function"===typeof e}},function(e,t,r){e.exports=!r(69)((function(){return 7!=Object.defineProperty({},"a",{get:function get(){return 7}}).a}))},function(e,t,r){"use strict";var n=r(177);e.exports=function mean(e){if(0===e.length)throw new Error("mean requires at least one data point");return n(e)/e.length}},,,function(e,t,r){var n=r(35),i=r(56);e.exports=r(39)?function(e,t,r){return n.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},function(e,t){var r={}.hasOwnProperty;e.exports=function(e,t){return r.call(e,t)}},function(e,t){var r,n,i=e.exports={};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(e){if(r===setTimeout)return setTimeout(e,0);if((r===defaultSetTimout||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"===typeof setTimeout?setTimeout:defaultSetTimout}catch(e){r=defaultSetTimout}try{n="function"===typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){n=defaultClearTimeout}}();var a,o=[],s=!1,u=-1;function cleanUpNextTick(){s&&a&&(s=!1,a.length?o=a.concat(o):u=-1,o.length&&drainQueue())}function drainQueue(){if(!s){var e=runTimeout(cleanUpNextTick);s=!0;for(var t=o.length;t;){for(a=o,o=[];++u<t;)a&&a[u].run();u=-1,t=o.length}a=null,s=!1,function runClearTimeout(e){if(n===clearTimeout)return clearTimeout(e);if((n===defaultClearTimeout||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{return n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function Item(e,t){this.fun=e,this.array=t}function noop(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];o.push(new Item(e,t)),1!==o.length||s||runTimeout(drainQueue)},Item.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=noop,i.addListener=noop,i.once=noop,i.off=noop,i.removeListener=noop,i.removeAllListeners=noop,i.emit=noop,i.prependListener=noop,i.prependOnceListener=noop,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},,function(e,t,r){var n=r(68);e.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports={}},function(e,t,r){var n=r(268),i=r(100);e.exports=function(e){return n(i(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isPrefixedValue(e){return"string"===typeof e&&n.test(e)};var n=/-webkit-|-moz-|-ms-/;e.exports=t.default},function(e,t,r){function Emitter(e){if(e)return function mixin(e){for(var t in Emitter.prototype)e[t]=Emitter.prototype[t];return e}(e)}e.exports=Emitter,Emitter.prototype.on=Emitter.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},Emitter.prototype.once=function(e,t){function on(){this.off(e,on),t.apply(this,arguments)}return on.fn=t,this.on(e,on),this},Emitter.prototype.off=Emitter.prototype.removeListener=Emitter.prototype.removeAllListeners=Emitter.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var i=0;i<n.length;i++)if((r=n[i])===t||r.fn===t){n.splice(i,1);break}return this},Emitter.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),r=this._callbacks["$"+e];if(r)for(var n=0,i=(r=r.slice(0)).length;n<i;++n)r[n].apply(this,t);return this},Emitter.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},Emitter.prototype.hasListeners=function(e){return!!this.listeners(e).length}},function(e,t,r){var n,i=r(534),a=r(212),o=r(536),s=r(537),u=r(538);"undefined"!==typeof ArrayBuffer&&(n=r(539));var l="undefined"!==typeof navigator&&/Android/i.test(navigator.userAgent),c="undefined"!==typeof navigator&&/PhantomJS/i.test(navigator.userAgent),f=l||c;t.protocol=3;var d=t.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},h=i(d),p={type:"error",data:"parser error"},g=r(540);function map(e,t,r){for(var n=new Array(e.length),i=s(e.length,r),a=function eachWithIndex(e,r,i){t(r,(function(t,r){n[e]=r,i(t,n)}))},o=0;o<e.length;o++)a(o,e[o],i)}t.encodePacket=function(e,r,n,i){"function"===typeof r&&(i=r,r=!1),"function"===typeof n&&(i=n,n=null);var a=void 0===e.data?void 0:e.data.buffer||e.data;if("undefined"!==typeof ArrayBuffer&&a instanceof ArrayBuffer)return function encodeArrayBuffer(e,r,n){if(!r)return t.encodeBase64Packet(e,n);var i=e.data,a=new Uint8Array(i),o=new Uint8Array(1+i.byteLength);o[0]=d[e.type];for(var s=0;s<a.length;s++)o[s+1]=a[s];return n(o.buffer)}(e,r,i);if("undefined"!==typeof g&&a instanceof g)return function encodeBlob(e,r,n){if(!r)return t.encodeBase64Packet(e,n);if(f)return function encodeBlobAsArrayBuffer(e,r,n){if(!r)return t.encodeBase64Packet(e,n);var i=new FileReader;return i.onload=function(){t.encodePacket({type:e.type,data:i.result},r,!0,n)},i.readAsArrayBuffer(e.data)}(e,r,n);var i=new Uint8Array(1);i[0]=d[e.type];var a=new g([i.buffer,e.data]);return n(a)}(e,r,i);if(a&&a.base64)return function encodeBase64Object(e,r){var n="b"+t.packets[e.type]+e.data.data;return r(n)}(e,i);var o=d[e.type];return void 0!==e.data&&(o+=n?u.encode(String(e.data),{strict:!1}):String(e.data)),i(""+o)},t.encodeBase64Packet=function(e,r){var n,i="b"+t.packets[e.type];if("undefined"!==typeof g&&e.data instanceof g){var a=new FileReader;return a.onload=function(){var e=a.result.split(",")[1];r(i+e)},a.readAsDataURL(e.data)}try{n=String.fromCharCode.apply(null,new Uint8Array(e.data))}catch(l){for(var o=new Uint8Array(e.data),s=new Array(o.length),u=0;u<o.length;u++)s[u]=o[u];n=String.fromCharCode.apply(null,s)}return i+=btoa(n),r(i)},t.decodePacket=function(e,r,n){if(void 0===e)return p;if("string"===typeof e){if("b"===e.charAt(0))return t.decodeBase64Packet(e.substr(1),r);if(n&&!1===(e=function tryDecode(e){try{e=u.decode(e,{strict:!1})}catch(t){return!1}return e}(e)))return p;var i=e.charAt(0);return Number(i)==i&&h[i]?e.length>1?{type:h[i],data:e.substring(1)}:{type:h[i]}:p}i=new Uint8Array(e)[0];var a=o(e,1);return g&&"blob"===r&&(a=new g([a])),{type:h[i],data:a}},t.decodeBase64Packet=function(e,t){var r=h[e.charAt(0)];if(!n)return{type:r,data:{base64:!0,data:e.substr(1)}};var i=n.decode(e.substr(1));return"blob"===t&&g&&(i=new g([i])),{type:r,data:i}},t.encodePayload=function(e,r,n){"function"===typeof r&&(n=r,r=null);var i=a(e);if(r&&i)return g&&!f?t.encodePayloadAsBlob(e,n):t.encodePayloadAsArrayBuffer(e,n);if(!e.length)return n("0:");map(e,(function encodeOne(e,n){t.encodePacket(e,!!i&&r,!1,(function(e){n(null,function setLengthHeader(e){return e.length+":"+e}(e))}))}),(function(e,t){return n(t.join(""))}))},t.decodePayload=function(e,r,n){if("string"!==typeof e)return t.decodePayloadAsBinary(e,r,n);var i;if("function"===typeof r&&(n=r,r=null),""===e)return n(p,0,1);for(var a,o,s="",u=0,l=e.length;u<l;u++){var c=e.charAt(u);if(":"===c){if(""===s||s!=(a=Number(s)))return n(p,0,1);if(s!=(o=e.substr(u+1,a)).length)return n(p,0,1);if(o.length){if(i=t.decodePacket(o,r,!1),p.type===i.type&&p.data===i.data)return n(p,0,1);if(!1===n(i,u+a,l))return}u+=a,s=""}else s+=c}return""!==s?n(p,0,1):void 0},t.encodePayloadAsArrayBuffer=function(e,r){if(!e.length)return r(new ArrayBuffer(0));map(e,(function encodeOne(e,r){t.encodePacket(e,!0,!0,(function(e){return r(null,e)}))}),(function(e,t){var n=t.reduce((function(e,t){var r;return e+(r="string"===typeof t?t.length:t.byteLength).toString().length+r+2}),0),i=new Uint8Array(n),a=0;return t.forEach((function(e){var t="string"===typeof e,r=e;if(t){for(var n=new Uint8Array(e.length),o=0;o<e.length;o++)n[o]=e.charCodeAt(o);r=n.buffer}i[a++]=t?0:1;var s=r.byteLength.toString();for(o=0;o<s.length;o++)i[a++]=parseInt(s[o]);i[a++]=255;for(n=new Uint8Array(r),o=0;o<n.length;o++)i[a++]=n[o]})),r(i.buffer)}))},t.encodePayloadAsBlob=function(e,r){map(e,(function encodeOne(e,r){t.encodePacket(e,!0,!0,(function(e){var t=new Uint8Array(1);if(t[0]=1,"string"===typeof e){for(var n=new Uint8Array(e.length),i=0;i<e.length;i++)n[i]=e.charCodeAt(i);e=n.buffer,t[0]=0}var a=(e instanceof ArrayBuffer?e.byteLength:e.size).toString(),o=new Uint8Array(a.length+1);for(i=0;i<a.length;i++)o[i]=parseInt(a[i]);if(o[a.length]=255,g){var s=new g([t.buffer,o.buffer,e]);r(null,s)}}))}),(function(e,t){return r(new g(t))}))},t.decodePayloadAsBinary=function(e,r,n){"function"===typeof r&&(n=r,r=null);for(var i=e,a=[];i.byteLength>0;){for(var s=new Uint8Array(i),u=0===s[0],l="",c=1;255!==s[c];c++){if(l.length>310)return n(p,0,1);l+=s[c]}i=o(i,2+l.length),l=parseInt(l);var f=o(i,0,l);if(u)try{f=String.fromCharCode.apply(null,new Uint8Array(f))}catch(g){var d=new Uint8Array(f);f="";for(c=0;c<d.length;c++)f+=String.fromCharCode(d[c])}a.push(f),i=o(i,l)}var h=a.length;a.forEach((function(e,i){n(t.decodePacket(e,r,!0),i,h)}))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.config=t.storage=void 0;var n=_interopRequireDefault(r(26)),i=_interopRequireDefault(r(27)),a=function(){var e=(0,i.default)(n.default.mark((function _callee(){var e;return n.default.wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,u.getCommaAccessToken();case 2:return e=t.sent,t.abrupt("return",e);case 4:case"end":return t.stop()}}),_callee,this)})));return function init(){return e.apply(this,arguments)}}(),o=function(){var e=(0,i.default)(n.default.mark((function _callee2(){return n.default.wrap((function _callee2$(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.logOut();case 2:s.default.location.href=s.default.location.origin;case 3:case"end":return e.stop()}}),_callee2,this)})));return function logOut(){return e.apply(this,arguments)}}(),s=_interopRequireDefault(r(153)),u=_interopRequireWildcard(r(286)),l=_interopRequireWildcard(r(288));function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}t.storage=u,t.config=l,t.default={init:a,logOut:o,isAuthenticated:function isAuthenticated(){return u.isAuthed}}},function(e,t,r){"use strict";var n=r(265)(!0);r(141)(String,"String",(function(e){this._t=String(e),this._i=0}),(function(){var e,t=this._t,r=this._i;return r>=t.length?{value:void 0,done:!0}:(e=n(t,r),this._i+=e.length,{value:e,done:!1})}))},function(e,t){e.exports=!0},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){var r={}.toString;e.exports=function(e){return r.call(e).slice(8,-1)}},function(e,t,r){(function(n){function load(){var e;try{e=t.storage.debug}catch(r){}return!e&&"undefined"!==typeof n&&"env"in n&&(e=Object({NODE_ENV:"production",PUBLIC_URL:"/cabana",REACT_APP_VIDEO_CDN:"https://cabana-video.azureedge.net"}).DEBUG),e}(t=e.exports=r(510)).log=function log(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function formatArgs(e){var r=this.useColors;if(e[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+e[0]+(r?"%c ":" ")+"+"+t.humanize(this.diff),!r)return;var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var i=0,a=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(i++,"%c"===e&&(a=i))})),e.splice(a,0,n)},t.save=function save(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(r){}},t.load=load,t.useColors=function useColors(){if("undefined"!==typeof window&&window.process&&"renderer"===window.process.type)return!0;return"undefined"!==typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!==typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:function localstorage(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},t.enable(load())}).call(this,r(45))},,,function(e,t,r){"use strict";function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}r.d(t,"a",(function(){return _taggedTemplateLiteral}))},,function(e,t,r){"use strict";var n=r(1);function hashString(e){return function hash(e,t){var r=1540483477,n=t^e.length,i=e.length,a=0;for(;i>=4;){var o=UInt32(e,a);o=Umul32(o,r),o=Umul32(o^=o>>>24,r),n=Umul32(n,r),n^=o,a+=4,i-=4}switch(i){case 3:n^=UInt16(e,a),n=Umul32(n^=e.charCodeAt(a+2)<<16,r);break;case 2:n=Umul32(n^=UInt16(e,a),r);break;case 1:n=Umul32(n^=e.charCodeAt(a),r)}return n=Umul32(n^=n>>>13,r),(n^=n>>>15)>>>0}(e,e.length).toString(36)}function UInt32(e,t){return e.charCodeAt(t++)+(e.charCodeAt(t++)<<8)+(e.charCodeAt(t++)<<16)+(e.charCodeAt(t)<<24)}function UInt16(e,t){return e.charCodeAt(t++)+(e.charCodeAt(t++)<<8)}function Umul32(e,t){return(65535&(e|=0))*(t|=0)+(((e>>>16)*t&65535)<<16)|0}function memoize(e){var t={};return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}}var i="__emotion_styles",a="__emotion_target",o={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,fontWeight:1,lineClamp:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},s=r(232),u=r.n(s);function makeStyleTag(){var e=document.createElement("style");return e.type="text/css",e.setAttribute("data-emotion",""),e.appendChild(document.createTextNode("")),document.head.appendChild(e),e}var l=new(function(){function StyleSheet(){this.isBrowser="undefined"!==typeof window,this.isSpeedy=!0,this.tags=[],this.ctr=0}var e=StyleSheet.prototype;return e.inject=function inject(){if(this.injected)throw new Error("already injected!");this.isBrowser?this.tags[0]=makeStyleTag():this.sheet=[],this.injected=!0},e.speedy=function speedy(e){if(0!==this.ctr)throw new Error("cannot change speedy now");this.isSpeedy=!!e},e.insert=function insert(e,t){if(this.isBrowser){if(this.isSpeedy){var r=function sheetForTag(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(this.tags[this.tags.length-1]);try{r.insertRule(e,r.cssRules.length)}catch(i){0}}else{var n=makeStyleTag();this.tags.push(n),n.appendChild(document.createTextNode(e+(t||"")))}this.ctr++,this.ctr%65e3===0&&this.tags.push(makeStyleTag())}else this.sheet.push(e)},e.flush=function flush(){this.isBrowser?(this.tags.forEach((function(e){return e.parentNode.removeChild(e)})),this.tags=[],this.ctr=0):this.sheet=[],this.injected=!1},StyleSheet}());l.inject();var c=new function fa(e){function ia(e,t,r){var n=t.trim().split(l);t=n;var i=n.length,a=e.length;switch(a){case 0:case 1:var o=0;for(e=0===a?"":e[0]+" ";o<i;++o)t[o]=ma(e,t[o],r,a).trim();break;default:var s=o=0;for(t=[];o<i;++o)for(var u=0;u<a;++u)t[s++]=ma(e[u]+" ",n[o],r,a).trim()}return t}function ma(e,t,r,n){var i=t.charCodeAt(0);switch(33>i&&(i=(t=t.trim()).charCodeAt(0)),i){case 38:switch(R+n){case 0:case 1:if(0===e.trim().length)break;default:return t.replace(c,"$1"+e.trim())}break;case 58:switch(t.charCodeAt(1)){case 103:if(0<P&&0<R)return t.replace(f,"$1").replace(c,"$1"+Y);break;default:return e.trim()+t}default:if(0<r*R&&0<t.indexOf("\f"))return t.replace(c,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+t}function ja(e,t,r,u){var l=0,c=e+";";if(944===(t=2*t+3*r+4*u)){switch(l=c.length,e=c.indexOf(":",9)+1,r=c.substring(0,e).trim(),u=c.substring(e,l-1).trim(),c.charCodeAt(9)*W){case 0:break;case 45:if(110!==c.charCodeAt(10))break;default:for(e=t=0,l=(c=u.split((u="",o))).length;t<l;e=0,++t){for(var f=c[t],d=f.split(s);f=d[e];){var h=f.charCodeAt(0);if(1===W&&(64<h&&90>h||96<h&&123>h||95===h||45===h&&45!==f.charCodeAt(1)))switch(isNaN(parseFloat(f))+(-1!==f.indexOf("("))){case 1:switch(f){case"infinite":case"alternate":case"backwards":case"running":case"normal":case"forwards":case"both":case"none":case"linear":case"ease":case"ease-in":case"ease-out":case"ease-in-out":case"paused":case"reverse":case"alternate-reverse":case"inherit":case"initial":case"unset":case"step-start":case"step-end":break;default:f+=G}}d[e++]=f}u+=(0===t?"":",")+d.join(" ")}}return u=r+u+";",1===D||2===D&&U(u,1)?"-webkit-"+u+u:u}if(0===D||2===D&&!U(c,1))return c;switch(t){case 1015:return 45===c.charCodeAt(9)?"-webkit-"+c+c:c;case 951:return 116===c.charCodeAt(3)?"-webkit-"+c+c:c;case 963:return 110===c.charCodeAt(5)?"-webkit-"+c+c:c;case 1009:if(100!==c.charCodeAt(4))break;case 969:case 942:return"-webkit-"+c+c;case 978:return"-webkit-"+c+"-moz-"+c+c;case 1019:case 983:return"-webkit-"+c+"-moz-"+c+"-ms-"+c+c;case 883:return 45===c.charCodeAt(8)?"-webkit-"+c+c:c;case 932:if(45===c.charCodeAt(4))switch(c.charCodeAt(5)){case 103:return"-webkit-box-"+c.replace("-grow","")+"-webkit-"+c+"-ms-"+c.replace("grow","positive")+c;case 115:return"-webkit-"+c+"-ms-"+c.replace("shrink","negative")+c;case 98:return"-webkit-"+c+"-ms-"+c.replace("basis","preferred-size")+c}return"-webkit-"+c+"-ms-"+c+c;case 964:return"-webkit-"+c+"-ms-flex-"+c+c;case 1023:if(99!==c.charCodeAt(8))break;return"-webkit-box-pack"+(e=c.substring(c.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+c+"-ms-flex-pack"+e+c;case 1005:return i.test(c)?c.replace(n,":-webkit-")+c.replace(n,":-moz-")+c:c;case 1e3:switch(l=(e=c.substring(13).trim()).indexOf("-")+1,e.charCodeAt(0)+e.charCodeAt(l)){case 226:e=c.replace(x,"tb");break;case 232:e=c.replace(x,"tb-rl");break;case 220:e=c.replace(x,"lr");break;default:return c}return"-webkit-"+c+"-ms-"+e+c;case 1017:if(-1===c.indexOf("sticky",9))break;case 975:switch(l=(c=e).length-10,t=(e=(33===c.charCodeAt(l)?c.substring(0,l):c).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|e.charCodeAt(7))){case 203:if(111>e.charCodeAt(8))break;case 115:c=c.replace(e,"-webkit-"+e)+";"+c;break;case 207:case 102:c=c.replace(e,"-webkit-"+(102<t?"inline-":"")+"box")+";"+c.replace(e,"-webkit-"+e)+";"+c.replace(e,"-ms-"+e+"box")+";"+c}return c+";";case 938:if(45===c.charCodeAt(5))switch(c.charCodeAt(6)){case 105:return e=c.replace("-items",""),"-webkit-"+c+"-webkit-box-"+e+"-ms-flex-"+e+c;case 115:return"-webkit-"+c+"-ms-flex-item-"+c.replace(S,"")+c;default:return"-webkit-"+c+"-ms-flex-line-pack"+c.replace("align-content","")+c}break;case 953:if(0<(l=c.indexOf("-content",9))&&109===c.charCodeAt(l-3)&&45!==c.charCodeAt(l-4))return"width:-webkit-"+(e=c.substring(l-3))+"width:-moz-"+e+"width:"+e;break;case 962:if(c="-webkit-"+c+(102===c.charCodeAt(5)?"-ms-"+c:"")+c,211===r+u&&105===c.charCodeAt(13)&&0<c.indexOf("transform",10))return c.substring(0,c.indexOf(";",27)+1).replace(a,"$1-webkit-$2")+c}return c}function U(e,t){var r=e.indexOf(1===t?":":"{"),n=e.substring(0,3!==t?r:10);return r=e.substring(r+1,e.length-1),z(2!==t?n:n.replace(E,"$1"),r,t)}function sa(e,t){var r=ja(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return r!==t+";"?r.replace(k," or ($1)").substring(4):"("+t+")"}function O(e,t,r,n,i,a,o,s,u){for(var l,c=0,f=t;c<B;++c)switch(l=N[c].call(F,e,f,r,n,i,a,o,s,u)){case void 0:case!1:case!0:case null:break;default:f=l}switch(f){case void 0:case!1:case!0:case null:case t:break;default:return f}}function ea(e){for(var t in e){var r=e[t];switch(t){case"keyframe":W=0|r;break;case"global":P=0|r;break;case"cascade":R=0|r;break;case"compress":j=0|r;break;case"semicolon":M=0|r;break;case"preserve":I=0|r;break;case"prefix":z=null,r?"function"!==typeof r?D=1:(D=2,z=r):D=0}}return ea}function F(e,n){if(void 0!==this&&this.constructor===F)return fa(e);var i=e,a=i.charCodeAt(0);if(33>a&&(a=(i=i.trim()).charCodeAt(0)),0<W&&(G=i.replace(d,91===a?"":"-")),a=1,1===R?Y=i:H=i,i=[Y],0<B){var o=O(-1,n,i,i,T,C,0,0,0);void 0!==o&&"string"===typeof o&&(n=o)}var s=function V(e,n,i,a,o){for(var s,l,c,f,d=0,m=0,v=0,y=0,_=0,x=0,k=0,S=0,E=0,j=0,F=0,N=0,z=l=0,$=0,X=0,K=i.length,J=K-1,Q="",Z="",ee="",te="";N<K;){if(c=i.charCodeAt(N),N===J&&0!==m+y+v+d&&(0!==m&&(c=47===m?10:47),y=v=d=0,K++,J++),0===m+y+v+d){if(N===J&&(0<l&&(Q=Q.replace(r,"")),0<Q.trim().length)){switch(c){case 32:case 9:case 59:case 13:case 10:break;default:Q+=i.charAt(N)}c=59}if(1===z)switch(c){case 123:case 125:case 59:case 34:case 39:case 40:case 41:case 44:z=0;case 9:case 13:case 10:case 32:break;default:for(z=0,X=N,s=c,N--,c=59;X<K;)switch(i.charCodeAt(++X)){case 10:case 13:case 59:N++,c=s;case 58:case 123:X=K}}switch(c){case 123:for(s=(Q=Q.trim()).charCodeAt(0),S=1,X=++N;N<K;){switch(c=i.charCodeAt(N)){case 123:S++;break;case 125:S--}if(0===S)break;N++}switch(j=i.substring(X,N),0===s&&(s=(Q=Q.replace(t,"").trim()).charCodeAt(0)),s){case 64:switch(0<l&&(Q=Q.replace(r,"")),l=Q.charCodeAt(1)){case 100:case 109:case 115:case 45:s=n;break;default:s=L}if(X=(j=V(n,s,j,l,o+1)).length,0<I&&0===X&&(X=Q.length),0<B&&(f=O(3,j,s=ia(L,Q,$),n,T,C,X,l,o),Q=s.join(""),void 0!==f&&0===(X=(j=f.trim()).length)&&(l=0,j="")),0<X)switch(l){case 115:Q=Q.replace(w,sa);case 100:case 109:case 45:j=Q+"{"+j+"}";break;case 107:j=(Q=Q.replace(h,"$1 $2"+(0<W?G:"")))+"{"+j+"}",j=1===D||2===D&&U("@"+j,3)?"@-webkit-"+j+"@"+j:"@"+j;break;default:j=Q+j,112===a&&(Z+=j,j="")}else j="";break;default:j=V(n,ia(n,Q,$),j,a,o+1)}ee+=j,j=$=l=F=z=E=0,Q="",c=i.charCodeAt(++N);break;case 125:case 59:if(1<(X=(Q=(0<l?Q.replace(r,""):Q).trim()).length))switch(0===F&&(s=Q.charCodeAt(0),45===s||96<s&&123>s)&&(X=(Q=Q.replace(" ",":")).length),0<B&&void 0!==(f=O(1,Q,n,e,T,C,Z.length,a,o))&&0===(X=(Q=f.trim()).length)&&(Q="\0\0"),s=Q.charCodeAt(0),l=Q.charCodeAt(1),s+l){case 0:break;case 169:case 163:te+=Q+i.charAt(N);break;default:58!==Q.charCodeAt(X-1)&&(Z+=ja(Q,s,l,Q.charCodeAt(2)))}$=l=F=z=E=0,Q="",c=i.charCodeAt(++N)}}switch(c){case 13:case 10:if(0===m+y+v+d+M)switch(k){case 41:case 39:case 34:case 64:case 126:case 62:case 42:case 43:case 47:case 45:case 58:case 44:case 59:case 123:case 125:break;default:0<F&&(z=1)}47===m?m=0:0===R+E&&(l=1,Q+="\0"),0<B*q&&O(0,Q,n,e,T,C,Z.length,a,o),C=1,T++;break;case 59:case 125:if(0===m+y+v+d){C++;break}default:switch(C++,s=i.charAt(N),c){case 9:case 32:if(0===y+d+m)switch(_){case 44:case 58:case 9:case 32:s="";break;default:32!==c&&(s=" ")}break;case 0:s="\\0";break;case 12:s="\\f";break;case 11:s="\\v";break;case 38:0===y+m+d&&0<R&&(l=$=1,s="\f"+s);break;case 108:if(0===y+m+d+A&&0<F)switch(N-F){case 2:112===_&&58===i.charCodeAt(N-3)&&(A=_);case 8:111===x&&(A=x)}break;case 58:0===y+m+d&&(F=N);break;case 44:0===m+v+y+d&&(l=1,s+="\r");break;case 34:case 39:0===m&&(y=y===c?0:0===y?c:y);break;case 91:0===y+m+v&&d++;break;case 93:0===y+m+v&&d--;break;case 41:0===y+m+d&&v--;break;case 40:if(0===y+m+d){if(0===E)switch(2*_+3*x){case 533:break;default:S=0,E=1}v++}break;case 64:0===m+v+y+d+F+j&&(j=1);break;case 42:case 47:if(!(0<y+d+v))switch(m){case 0:switch(2*c+3*i.charCodeAt(N+1)){case 235:m=47;break;case 220:X=N,m=42}break;case 42:47===c&&42===_&&(33===i.charCodeAt(X+2)&&(Z+=i.substring(X,N+1)),s="",m=0)}}if(0===m){if(0===R+y+d+j&&107!==a&&59!==c)switch(c){case 44:case 126:case 62:case 43:case 41:case 40:if(0===E){switch(_){case 9:case 32:case 10:case 13:s+="\0";break;default:s="\0"+s+(44===c?"":"\0")}l=1}else switch(c){case 40:E=++S;break;case 41:0===(E=--S)&&(l=1,s+="\0")}break;case 9:case 32:switch(_){case 0:case 123:case 125:case 59:case 44:case 12:case 9:case 32:case 10:case 13:break;default:0===E&&(l=1,s+="\0")}}Q+=s,32!==c&&9!==c&&(k=c)}}x=_,_=c,N++}if(X=Z.length,0<I&&0===X&&0===ee.length&&0===n[0].length===!1&&(109!==a||1===n.length&&(0<R?H:Y)===n[0])&&(X=n.join(",").length+2),0<X){if(0===R&&107!==a){for(i=0,d=n.length,m=Array(d);i<d;++i){for(x="",k=0,K=(_=n[i].split(u)).length;k<K;++k)if(!(0===(S=(y=_[k]).length)&&1<K)){if(N=x.charCodeAt(x.length-1),$=y.charCodeAt(0),v="",0!==k)switch(N){case 42:case 126:case 62:case 43:case 32:case 40:break;default:v=" "}switch($){case 38:y=v+H;case 126:case 62:case 43:case 32:case 41:case 40:break;case 91:y=v+y+H;break;case 58:switch(2*y.charCodeAt(1)+3*y.charCodeAt(2)){case 530:if(0<P){y=v+y.substring(8,S-1);break}default:(1>k||1>_[k-1].length)&&(y=v+H+y)}break;case 44:v="";default:y=1<S&&0<y.indexOf(":")?v+y.replace(b,"$1"+H+"$2"):v+y+H}x+=y}m[i]=x.replace(r,"").trim()}n=m}if(s=n,0<B&&(void 0!==(f=O(2,Z,s,e,T,C,X,a,o))&&0===(Z=f).length))return te+Z+ee;if(Z=s.join(",")+"{"+Z+"}",0!==D*A){switch(2!==D||U(Z,2)||(A=0),A){case 111:Z=Z.replace(g,":-moz-$1")+Z;break;case 112:Z=Z.replace(p,"::-webkit-input-$1")+Z.replace(p,"::-moz-$1")+Z.replace(p,":-ms-input-$1")+Z}A=0}}return te+Z+ee}(L,i,n,0,0);return 0<B&&(void 0!==(o=O(-2,s,i,i,T,C,s.length,0,0))&&"string"!==typeof(s=o)&&(a=0)),H=Y=G="",A=0,C=T=1,0===j*a?s:s.replace(r,"").replace(m,"").replace(v,"$1").replace(y,"$1").replace(_," ")}var t=/^\0+/g,r=/[\0\r\f]/g,n=/: */g,i=/zoo|gra/,a=/([,: ])(transform)/g,o=/,+\s*(?![^(]*[)])/g,s=/ +\s*(?![^(]*[)])/g,u=/ *[\0] */g,l=/,\r+?/g,c=/([\t\r\n ])*\f?&/g,f=/:global\(((?:[^\(\)\[\]]*|\[.*\]|\([^\(\)]*\))*)\)/g,d=/\W+/g,h=/@(k\w+)\s*(\S*)\s*/,p=/::(place)/g,g=/:(read-only)/g,m=/\s+(?=[{\];=:>])/g,v=/([[}=:>])\s+/g,y=/(\{[^{]+?);(?=\})/g,_=/\s{2,}/g,b=/([^\(])(:+) */g,x=/[svh]\w+-[tblr]{2}/,w=/\(\s*(.*)\s*\)/g,k=/([^]*?);/g,S=/-self|flex-/g,E=/[^]*?(:[rp][el]a[\w-]+)[^]*/,C=1,T=1,A=0,R=1,D=1,P=1,j=0,M=0,I=0,L=[],N=[],B=0,z=null,q=0,W=1,G="",H="",Y="";return F.use=function da(e){switch(e){case void 0:case null:B=N.length=0;break;default:switch(e.constructor){case Array:for(var t=0,r=e.length;t<r;++t)da(e[t]);break;case Function:N[B++]=e;break;case Boolean:q=0|!!e}}return da},F.set=ea,void 0!==e&&ea(e),F}({keyframe:!1});c.use;var f=u()((function insertRule(e){l.insert(e,p)})),d={},h={},p="";function handleInterpolation(e,t){if(null==e)return"";switch(typeof e){case"boolean":return"";case"function":return void 0!==e[i]?"."+e[a]:handleInterpolation.call(this,void 0===this?e():e(this.mergedProps,this.context),t);case"object":return createStringFromObject.call(this,e);default:var r=d[e];return!1===t&&void 0!==r?r:e}}c.use(f);var g,m,v=/[A-Z]|^ms/g,y=memoize((function(e){return e.replace(v,"-$&").toLowerCase()})),_=function processStyleValue(e,t){return void 0===t||null===t||"boolean"===typeof t?"":1===o[e]||45===e.charCodeAt(1)||isNaN(t)||0===t?t:t+"px"},b=new WeakMap;function createStringFromObject(e){if(b.has(e))return b.get(e);var t="";return Array.isArray(e)?e.forEach((function(e){t+=handleInterpolation.call(this,e,!1)}),this):Object.keys(e).forEach((function(r){"object"!==typeof e[r]?void 0!==d[e[r]]?t+=r+"{"+d[e[r]]+"}":t+=y(r)+":"+_(r,e[r])+";":t+=r+"{"+handleInterpolation.call(this,e[r],!1)+"}"}),this),b.set(e,t),t}var x=/label:\s*([^\s;\n]+)\s*[;\n]/g;function createStyles(e){var t=!0,r="",n="";null==e||void 0===e.raw?(t=!1,r=handleInterpolation.call(this,e,!1)):r=e[0];for(var i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];return a.forEach((function(n,i){r+=handleInterpolation.call(this,n,function isLastCharDot(e){return 46===e.charCodeAt(e.length-1)}(r)),!0===t&&void 0!==e[i+1]&&(r+=e[i+1])}),this),r=r.replace(x,(function(e,t){return n+="-"+t,""})),g=hashString(r+n),m=g+n,r}function css(){var e=createStyles.apply(this,arguments),t="css-"+m;return void 0===d[t]&&(d[t]=e),void 0===h[g]&&(c("."+t,e),h[g]=!0),t}function keyframes(){var e=createStyles.apply(this,arguments),t="animation-"+m;return void 0===h[g]&&(c("","@keyframes "+t+"{"+e+"}"),h[g]=!0),t}function getRegisteredStyles(e,t){var r="";return t.split(" ").forEach((function(t){void 0!==d[t]?e.push(t):r+=t+" "})),r}var w,k=r(16),S=r.n(k);function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}r.d(t,"b",(function(){return keyframes}));var E="__EMOTION_THEMING__",C=((w={})[E]=S.a.object,w);function setTheme(e){this.setState({theme:e})}function componentWillMount(){void 0!==this.context[E]&&(this.unsubscribe=this.context[E].subscribe(setTheme.bind(this)))}function componentWillUnmount(){void 0!==this.unsubscribe&&this.context[E].unsubscribe(this.unsubscribe)}var T=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|accept|acceptCharset|accessKey|action|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|default|defer|dir|disabled|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|itemProp|itemScope|itemType|itemID|itemRef|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan)|(on[A-Z].*)|((data|aria)-.*))$/,O=memoize((function(e){return T.test(e)})),A=function testOmitPropsOnComponent(e){return"theme"!==e&&"innerRef"!==e},R=function testAlwaysTrue(){return!0},D=function omitAssign(e,t){for(var r=2,n=arguments.length;r<n;r++){var i=arguments[r],a=void 0;for(a in i)e(a)&&(t[a]=i[a])}return t};t.a=function createStyled(e,t){var r,o,s;void 0!==t&&(r=t.label,o=t.target,s=t.e);var u=e.__emotion_real===e,l=void 0===s&&u&&e.__emotion_base||e,c="string"===typeof l&&l.charAt(0)===l.charAt(0).toLowerCase()?O:A;return function(f){var d=u&&e[i]||[];if(void 0!==r&&(d=d.concat("label:"+r+";")),void 0===s){for(var h=arguments.length,p=new Array(h>1?h-1:0),g=1;g<h;g++)p[g-1]=arguments[g];d=null==f||void 0===f.raw?d.concat(f,p):p.reduce((function(e,t,r){return e.concat(t,f[r+1])}),d.concat(f[0]))}var m=function(e){function Styled(){return e.apply(this,arguments)||this}return _inheritsLoose(Styled,e),Styled.prototype.render=function render(){var e=this.props,t=this.state;this.mergedProps=D(R,{},e,{theme:null!==t&&t.theme||e.theme||{}});var r="",i=[];return e.className&&(r+=void 0===s?getRegisteredStyles(i,e.className):e.className+" "),r+=void 0===s?css.apply(this,d.concat(i)):s,void 0!==o&&(r+=" "+o),Object(n.createElement)(l,D(c,{},e,{className:r,ref:e.innerRef}))},Styled}(n.Component);return m.prototype.componentWillMount=componentWillMount,m.prototype.componentWillUnmount=componentWillUnmount,m.displayName=void 0!==r?r:"Styled("+("string"===typeof l?l:l.displayName||l.name||"Component")+")",m.contextTypes=C,m[i]=d,m.__emotion_base=l,m.__emotion_real=m,m[a]=o,m.withComponent=function(e,r){return createStyled(e,void 0!==r?D(R,{},t,r):t)(d)},m}}},,function(e,t,r){"undefined"!==typeof window&&function webpackUniversalModuleDefinition(t,r){e.exports=r()}(0,(function(){return function(e){var t={};function __webpack_require__(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,__webpack_require__),n.l=!0,n.exports}return __webpack_require__.m=e,__webpack_require__.c=t,__webpack_require__.d=function(e,t,r){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},__webpack_require__.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(__webpack_require__.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)__webpack_require__.d(r,n,function(t){return e[t]}.bind(null,n));return r},__webpack_require__.n=function(e){var t=e&&e.__esModule?function getDefault(){return e.default}:function getModuleExports(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="/dist/",__webpack_require__(__webpack_require__.s="./src/hls.js")}({"./node_modules/eventemitter3/index.js":function node_modulesEventemitter3IndexJs(e,t,r){"use strict";var n=Object.prototype.hasOwnProperty,i="~";function Events(){}function EE(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function addListener(e,t,r,n,a){if("function"!==typeof r)throw new TypeError("The listener must be a function");var o=new EE(r,n||e,a),s=i?i+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],o]:e._events[s].push(o):(e._events[s]=o,e._eventsCount++),e}function clearEvent(e,t){0===--e._eventsCount?e._events=new Events:delete e._events[t]}function EventEmitter(){this._events=new Events,this._eventsCount=0}Object.create&&(Events.prototype=Object.create(null),(new Events).__proto__||(i=!1)),EventEmitter.prototype.eventNames=function eventNames(){var e,t,r=[];if(0===this._eventsCount)return r;for(t in e=this._events)n.call(e,t)&&r.push(i?t.slice(1):t);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},EventEmitter.prototype.listeners=function listeners(e){var t=i?i+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,a=r.length,o=new Array(a);n<a;n++)o[n]=r[n].fn;return o},EventEmitter.prototype.listenerCount=function listenerCount(e){var t=i?i+e:e,r=this._events[t];return r?r.fn?1:r.length:0},EventEmitter.prototype.emit=function emit(e,t,r,n,a,o){var s=i?i+e:e;if(!this._events[s])return!1;var u,l,c=this._events[s],f=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),f){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,r),!0;case 4:return c.fn.call(c.context,t,r,n),!0;case 5:return c.fn.call(c.context,t,r,n,a),!0;case 6:return c.fn.call(c.context,t,r,n,a,o),!0}for(l=1,u=new Array(f-1);l<f;l++)u[l-1]=arguments[l];c.fn.apply(c.context,u)}else{var d,h=c.length;for(l=0;l<h;l++)switch(c[l].once&&this.removeListener(e,c[l].fn,void 0,!0),f){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,t);break;case 3:c[l].fn.call(c[l].context,t,r);break;case 4:c[l].fn.call(c[l].context,t,r,n);break;default:if(!u)for(d=1,u=new Array(f-1);d<f;d++)u[d-1]=arguments[d];c[l].fn.apply(c[l].context,u)}}return!0},EventEmitter.prototype.on=function on(e,t,r){return addListener(this,e,t,r,!1)},EventEmitter.prototype.once=function once(e,t,r){return addListener(this,e,t,r,!0)},EventEmitter.prototype.removeListener=function removeListener(e,t,r,n){var a=i?i+e:e;if(!this._events[a])return this;if(!t)return clearEvent(this,a),this;var o=this._events[a];if(o.fn)o.fn!==t||n&&!o.once||r&&o.context!==r||clearEvent(this,a);else{for(var s=0,u=[],l=o.length;s<l;s++)(o[s].fn!==t||n&&!o[s].once||r&&o[s].context!==r)&&u.push(o[s]);u.length?this._events[a]=1===u.length?u[0]:u:clearEvent(this,a)}return this},EventEmitter.prototype.removeAllListeners=function removeAllListeners(e){var t;return e?(t=i?i+e:e,this._events[t]&&clearEvent(this,t)):(this._events=new Events,this._eventsCount=0),this},EventEmitter.prototype.off=EventEmitter.prototype.removeListener,EventEmitter.prototype.addListener=EventEmitter.prototype.on,EventEmitter.prefixed=i,EventEmitter.EventEmitter=EventEmitter,e.exports=EventEmitter},"./node_modules/node-libs-browser/node_modules/events/events.js":function node_modulesNodeLibsBrowserNode_modulesEventsEventsJs(e,t){function EventEmitter(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function isFunction(e){return"function"===typeof e}function isObject(e){return"object"===typeof e&&null!==e}function isUndefined(e){return void 0===e}e.exports=EventEmitter,EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0,EventEmitter.defaultMaxListeners=10,EventEmitter.prototype.setMaxListeners=function(e){if(!function isNumber(e){return"number"===typeof e}(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},EventEmitter.prototype.emit=function(e){var t,r,n,i,a,o;if(this._events||(this._events={}),"error"===e&&(!this._events.error||isObject(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var s=new Error('Uncaught, unspecified "error" event. ('+t+")");throw s.context=t,s}if(isUndefined(r=this._events[e]))return!1;if(isFunction(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:i=Array.prototype.slice.call(arguments,1),r.apply(this,i)}else if(isObject(r))for(i=Array.prototype.slice.call(arguments,1),n=(o=r.slice()).length,a=0;a<n;a++)o[a].apply(this,i);return!0},EventEmitter.prototype.addListener=function(e,t){var r;if(!isFunction(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,isFunction(t.listener)?t.listener:t),this._events[e]?isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,isObject(this._events[e])&&!this._events[e].warned&&(r=isUndefined(this._maxListeners)?EventEmitter.defaultMaxListeners:this._maxListeners)&&r>0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"===typeof console.trace&&console.trace()),this},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.once=function(e,t){if(!isFunction(t))throw TypeError("listener must be a function");var r=!1;function g(){this.removeListener(e,g),r||(r=!0,t.apply(this,arguments))}return g.listener=t,this.on(e,g),this},EventEmitter.prototype.removeListener=function(e,t){var r,n,i,a;if(!isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(r=this._events[e]).length,n=-1,r===t||isFunction(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(isObject(r)){for(a=i;a-- >0;)if(r[a]===t||r[a].listener&&r[a].listener===t){n=a;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},EventEmitter.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(isFunction(r=this._events[e]))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},EventEmitter.prototype.listeners=function(e){return this._events&&this._events[e]?isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},EventEmitter.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(isFunction(t))return 1;if(t)return t.length}return 0},EventEmitter.listenerCount=function(e,t){return e.listenerCount(t)}},"./node_modules/url-toolkit/src/url-toolkit.js":function node_modulesUrlToolkitSrcUrlToolkitJs(e,t,r){!function(t){var r=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/\?#]*\/)*.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,n=/^([^\/?#]*)(.*)$/,i=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,o={buildAbsoluteURL:function buildAbsoluteURL(e,t,r){if(r=r||{},e=e.trim(),!(t=t.trim())){if(!r.alwaysNormalize)return e;var i=o.parseURL(e);if(!i)throw new Error("Error trying to parse base URL.");return i.path=o.normalizePath(i.path),o.buildURLFromParts(i)}var a=o.parseURL(t);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return r.alwaysNormalize?(a.path=o.normalizePath(a.path),o.buildURLFromParts(a)):t;var s=o.parseURL(e);if(!s)throw new Error("Error trying to parse base URL.");if(!s.netLoc&&s.path&&"/"!==s.path[0]){var u=n.exec(s.path);s.netLoc=u[1],s.path=u[2]}s.netLoc&&!s.path&&(s.path="/");var l={scheme:s.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(l.netLoc=s.netLoc,"/"!==a.path[0]))if(a.path){var c=s.path,f=c.substring(0,c.lastIndexOf("/")+1)+a.path;l.path=o.normalizePath(f)}else l.path=s.path,a.params||(l.params=s.params,a.query||(l.query=s.query));return null===l.path&&(l.path=r.alwaysNormalize?o.normalizePath(a.path):a.path),o.buildURLFromParts(l)},parseURL:function parseURL(e){var t=r.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function normalizePath(e){for(e=e.split("").reverse().join("").replace(i,"");e.length!==(e=e.replace(a,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function buildURLFromParts(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};e.exports=o}()},"./node_modules/webworkify-webpack/index.js":function node_modulesWebworkifyWebpackIndexJs(e,t,r){function webpackBootstrapFunc(e){var t={};function __webpack_require__(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,__webpack_require__),n.l=!0,n.exports}__webpack_require__.m=e,__webpack_require__.c=t,__webpack_require__.i=function(e){return e},__webpack_require__.d=function(e,t,r){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},__webpack_require__.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.n=function(e){var t=e&&e.__esModule?function getDefault(){return e.default}:function getModuleExports(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="/",__webpack_require__.oe=function(e){throw console.error(e),e};var r=__webpack_require__(__webpack_require__.s=ENTRY_MODULE);return r.default||r}var n="[\\.|\\-|\\+|\\w|/|@]+",i="\\((/\\*.*?\\*/)?s?.*?("+n+").*?\\)";function quoteRegExp(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function getModuleDependencies(e,t,a){var o={};o[a]=[];var s=t.toString(),u=s.match(/^function\s?\(\w+,\s*\w+,\s*(\w+)\)/);if(!u)return o;for(var l,c=u[1],f=new RegExp("(\\\\n|\\W)"+quoteRegExp(c)+i,"g");l=f.exec(s);)"dll-reference"!==l[3]&&o[a].push(l[3]);for(f=new RegExp("\\("+quoteRegExp(c)+'\\("(dll-reference\\s('+n+'))"\\)\\)'+i,"g");l=f.exec(s);)e[l[2]]||(o[a].push(l[1]),e[l[2]]=r(l[1]).m),o[l[2]]=o[l[2]]||[],o[l[2]].push(l[4]);for(var d,h=Object.keys(o),p=0;p<h.length;p++)for(var g=0;g<o[h[p]].length;g++)d=o[h[p]][g],isNaN(1*d)||(o[h[p]][g]=1*o[h[p]][g]);return o}function hasValuesInQueues(e){return Object.keys(e).reduce((function(t,r){return t||e[r].length>0}),!1)}e.exports=function(e,t){t=t||{};var n={main:r.m},i=t.all?{main:Object.keys(n.main)}:function getRequiredModules(e,t){for(var r={main:[t]},n={main:[]},i={main:{}};hasValuesInQueues(r);)for(var a=Object.keys(r),o=0;o<a.length;o++){var s=a[o],u=r[s].pop();if(i[s]=i[s]||{},!i[s][u]&&e[s][u]){i[s][u]=!0,n[s]=n[s]||[],n[s].push(u);for(var l=getModuleDependencies(e,e[s][u],s),c=Object.keys(l),f=0;f<c.length;f++)r[c[f]]=r[c[f]]||[],r[c[f]]=r[c[f]].concat(l[c[f]])}}return n}(n,e),a="";Object.keys(i).filter((function(e){return"main"!==e})).forEach((function(e){for(var t=0;i[e][t];)t++;i[e].push(t),n[e][t]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",a=a+"var "+e+" = ("+webpackBootstrapFunc.toString().replace("ENTRY_MODULE",JSON.stringify(t))+")({"+i[e].map((function(t){return JSON.stringify(t)+": "+n[e][t].toString()})).join(",")+"});\n"})),a=a+"new (("+webpackBootstrapFunc.toString().replace("ENTRY_MODULE",JSON.stringify(e))+")({"+i.main.map((function(e){return JSON.stringify(e)+": "+n.main[e].toString()})).join(",")+"}))(self);";var o=new window.Blob([a],{type:"text/javascript"});if(t.bare)return o;var s=(window.URL||window.webkitURL||window.mozURL||window.msURL).createObjectURL(o),u=new window.Worker(s);return u.objectURL=s,u}},"./src/config.js":function srcConfigJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("./src/controller/abr-controller.js"),i=r("./src/controller/buffer-controller.js"),a=r("./src/controller/cap-level-controller.js"),o=r("./src/controller/fps-controller.js"),s=r("./src/utils/xhr-loader.js"),u=r("./src/controller/audio-track-controller.js"),l=r("./src/controller/audio-stream-controller.js"),c=r("./src/utils/cues.js"),f=r("./src/controller/timeline-controller.js"),d=r("./src/controller/subtitle-track-controller.js"),h=r("./src/controller/subtitle-stream-controller.js"),p=r("./src/controller/eme-controller.js"),g=r("./src/utils/mediakeys-helper.js");t.hlsDefaultConfig={autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,maxBufferSize:6e7,maxBufferHole:.5,lowBufferWatchdogPeriod:.5,highBufferWatchdogPeriod:3,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,liveDurationInfinity:!1,liveBackBufferLength:1/0,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:s.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,abrController:n.default,bufferController:i.default,capLevelController:a.default,fpsController:o.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,requestMediaKeySystemAccessFunc:g.requestMediaKeySystemAccess,disablePtsDtsCorrectionInMp4Remux:!1},t.hlsDefaultConfig.subtitleStreamController=h.SubtitleStreamController,t.hlsDefaultConfig.subtitleTrackController=d.default,t.hlsDefaultConfig.timelineController=f.default,t.hlsDefaultConfig.cueHandler=c,t.hlsDefaultConfig.enableCEA708Captions=!0,t.hlsDefaultConfig.enableWebVTT=!0,t.hlsDefaultConfig.captionsTextTrack1Label="English",t.hlsDefaultConfig.captionsTextTrack1LanguageCode="en",t.hlsDefaultConfig.captionsTextTrack2Label="Spanish",t.hlsDefaultConfig.captionsTextTrack2LanguageCode="es",t.hlsDefaultConfig.audioStreamController=l.default,t.hlsDefaultConfig.audioTrackController=u.default,t.hlsDefaultConfig.emeController=p.default},"./src/controller/abr-controller.js":function srcControllerAbrControllerJs(e,t,r){"use strict";(function(e){var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function __(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(__.prototype=r.prototype,new __)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=r("./src/events.js"),a=r("./src/event-handler.js"),o=r("./src/utils/buffer-helper.js"),s=r("./src/errors.js"),u=r("./src/utils/logger.js"),l=r("./src/utils/ewma-bandwidth-estimator.js"),c=window.performance,f=function(t){function AbrController(e){var r=t.call(this,e,i.default.FRAG_LOADING,i.default.FRAG_LOADED,i.default.FRAG_BUFFERED,i.default.ERROR)||this;return r.lastLoadedFragLevel=0,r._nextAutoLevel=-1,r.hls=e,r.timer=null,r._bwEstimator=null,r.onCheck=r._abandonRulesCheck.bind(r),r}return n(AbrController,t),AbrController.prototype.destroy=function(){this.clearTimer(),a.default.prototype.destroy.call(this)},AbrController.prototype.onFragLoading=function(e){var t=e.frag;if("main"===t.type&&(this.timer||(this.fragCurrent=t,this.timer=setInterval(this.onCheck,100)),!this._bwEstimator)){var r=this.hls,n=r.config,i=t.level,a=void 0,o=void 0;r.levels[i].details.live?(a=n.abrEwmaFastLive,o=n.abrEwmaSlowLive):(a=n.abrEwmaFastVoD,o=n.abrEwmaSlowVoD),this._bwEstimator=new l.default(r,o,a,n.abrEwmaDefaultEstimate)}},AbrController.prototype._abandonRulesCheck=function(){var e=this.hls,t=e.media,r=this.fragCurrent;if(r){var n=r.loader,a=e.minAutoLevel;if(!n||n.stats&&n.stats.aborted)return u.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),void(this._nextAutoLevel=-1);var s=n.stats;if(t&&s&&(!t.paused&&0!==t.playbackRate||!t.readyState)&&r.autoLevel&&r.level){var l=c.now()-s.trequest,f=Math.abs(t.playbackRate);if(l>500*r.duration/f){var d=e.levels,h=Math.max(1,s.bw?s.bw/8:1e3*s.loaded/l),p=d[r.level],g=p.realBitrate?Math.max(p.realBitrate,p.bitrate):p.bitrate,m=s.total?s.total:Math.max(s.loaded,Math.round(r.duration*g/8)),v=t.currentTime,y=(m-s.loaded)/h,_=(o.BufferHelper.bufferInfo(t,v,e.config.maxBufferHole).end-v)/f;if(_<2*r.duration/f&&y>_){var b=void 0,x=void 0;for(x=r.level-1;x>a;x--){var w=d[x].realBitrate?Math.max(d[x].realBitrate,d[x].bitrate):d[x].bitrate;if((b=r.duration*w/(6.4*h))<_)break}b<y&&(u.logger.warn("loading too slow, abort fragment loading and switch to level "+x+":fragLoadedDelay["+x+"]<fragLoadedDelay["+(r.level-1)+"];bufferStarvationDelay:"+b.toFixed(1)+"<"+y.toFixed(1)+":"+_.toFixed(1)),e.nextLoadLevel=x,this._bwEstimator.sample(l,s.loaded),n.abort(),this.clearTimer(),e.trigger(i.default.FRAG_LOAD_EMERGENCY_ABORTED,{frag:r,stats:s}))}}}}},AbrController.prototype.onFragLoaded=function(t){var r=t.frag;if("main"===r.type&&e.isFinite(r.sn)){if(this.clearTimer(),this.lastLoadedFragLevel=r.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var n=this.hls.levels[r.level],i=(n.loaded?n.loaded.bytes:0)+t.stats.loaded,a=(n.loaded?n.loaded.duration:0)+t.frag.duration;n.loaded={bytes:i,duration:a},n.realBitrate=Math.round(8*i/a)}if(t.frag.bitrateTest){var o=t.stats;o.tparsed=o.tbuffered=o.tload,this.onFragBuffered(t)}}},AbrController.prototype.onFragBuffered=function(t){var r=t.stats,n=t.frag;if(!0!==r.aborted&&"main"===n.type&&e.isFinite(n.sn)&&(!n.bitrateTest||r.tload===r.tbuffered)){var i=r.tparsed-r.trequest;u.logger.log("latency/loading/parsing/append/kbps:"+Math.round(r.tfirst-r.trequest)+"/"+Math.round(r.tload-r.tfirst)+"/"+Math.round(r.tparsed-r.tload)+"/"+Math.round(r.tbuffered-r.tparsed)+"/"+Math.round(8*r.loaded/(r.tbuffered-r.trequest))),this._bwEstimator.sample(i,r.loaded),r.bwEstimate=this._bwEstimator.getEstimate(),n.bitrateTest?this.bitrateTestDelay=i/1e3:this.bitrateTestDelay=0}},AbrController.prototype.onError=function(e){switch(e.details){case s.ErrorDetails.FRAG_LOAD_ERROR:case s.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer()}},AbrController.prototype.clearTimer=function(){clearInterval(this.timer),this.timer=null},Object.defineProperty(AbrController.prototype,"nextAutoLevel",{get:function get(){var e=this._nextAutoLevel,t=this._bwEstimator;if(-1!==e&&(!t||!t.canEstimate()))return e;var r=this._nextABRAutoLevel;return-1!==e&&(r=Math.min(e,r)),r},set:function set(e){this._nextAutoLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(AbrController.prototype,"_nextABRAutoLevel",{get:function get(){var e=this.hls,t=e.maxAutoLevel,r=e.levels,n=e.config,i=e.minAutoLevel,a=e.media,s=this.lastLoadedFragLevel,l=this.fragCurrent?this.fragCurrent.duration:0,c=a?a.currentTime:0,f=a&&0!==a.playbackRate?Math.abs(a.playbackRate):1,d=this._bwEstimator?this._bwEstimator.getEstimate():n.abrEwmaDefaultEstimate,h=(o.BufferHelper.bufferInfo(a,c,n.maxBufferHole).end-c)/f,p=this._findBestLevel(s,l,d,i,t,h,n.abrBandWidthFactor,n.abrBandWidthUpFactor,r);if(p>=0)return p;u.logger.trace("rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering");var g=l?Math.min(l,n.maxStarvationDelay):n.maxStarvationDelay,m=n.abrBandWidthFactor,v=n.abrBandWidthUpFactor;if(0===h){var y=this.bitrateTestDelay;if(y)g=(l?Math.min(l,n.maxLoadingDelay):n.maxLoadingDelay)-y,u.logger.trace("bitrate test took "+Math.round(1e3*y)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*g)+" ms"),m=v=1}return p=this._findBestLevel(s,l,d,i,t,h+g,m,v,r),Math.max(p,0)},enumerable:!0,configurable:!0}),AbrController.prototype._findBestLevel=function(e,t,r,n,i,a,o,s,l){for(var c=i;c>=n;c--){var f=l[c];if(f){var d=f.details,h=d?d.totalduration/d.fragments.length:t,p=!!d&&d.live,g=void 0;g=c<=e?o*r:s*r;var m=l[c].realBitrate?Math.max(l[c].realBitrate,l[c].bitrate):l[c].bitrate,v=m*h/g;if(u.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+c+"/"+Math.round(g)+"/"+m+"/"+h+"/"+a+"/"+v),g>m&&(!v||p&&!this.bitrateTestDelay||v<a))return c}}return-1},AbrController}(a.default);t.default=f}).call(this,r("./src/polyfills/number.js").Number)},"./src/controller/audio-stream-controller.js":function srcControllerAudioStreamControllerJs(e,t,r){"use strict";(function(e){var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function __(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(__.prototype=r.prototype,new __)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=r("./src/utils/binary-search.js"),a=r("./src/utils/buffer-helper.js"),o=r("./src/demux/demuxer.js"),s=r("./src/events.js"),u=r("./src/controller/level-helper.js"),l=r("./src/utils/time-ranges.js"),c=r("./src/errors.js"),f=r("./src/utils/logger.js"),d=r("./src/utils/discontinuities.js"),h=r("./src/controller/fragment-tracker.js"),p=r("./src/loader/fragment.js"),g=r("./src/controller/base-stream-controller.js"),m=window.performance,v=function(t){function AudioStreamController(e,r){var n=t.call(this,e,s.default.MEDIA_ATTACHED,s.default.MEDIA_DETACHING,s.default.AUDIO_TRACKS_UPDATED,s.default.AUDIO_TRACK_SWITCHING,s.default.AUDIO_TRACK_LOADED,s.default.KEY_LOADED,s.default.FRAG_LOADED,s.default.FRAG_PARSING_INIT_SEGMENT,s.default.FRAG_PARSING_DATA,s.default.FRAG_PARSED,s.default.ERROR,s.default.BUFFER_RESET,s.default.BUFFER_CREATED,s.default.BUFFER_APPENDED,s.default.BUFFER_FLUSHED,s.default.INIT_PTS_FOUND)||this;return n.fragmentTracker=r,n.config=e.config,n.audioCodecSwap=!1,n._state=g.State.STOPPED,n.initPTS=[],n.waitingFragment=null,n.videoTrackCC=null,n}return n(AudioStreamController,t),AudioStreamController.prototype.onInitPtsFound=function(e){var t=e.id,r=e.frag.cc,n=e.initPTS;"main"===t&&(this.initPTS[r]=n,this.videoTrackCC=r,f.logger.log("InitPTS for cc: "+r+" found from video track: "+n),this.state===g.State.WAITING_INIT_PTS&&this.tick())},AudioStreamController.prototype.startLoad=function(e){if(this.tracks){var t=this.lastCurrentTime;this.stopLoad(),this.setInterval(100),this.fragLoadError=0,t>0&&-1===e?(f.logger.log("audio:override startPosition with lastCurrentTime @"+t.toFixed(3)),this.state=g.State.IDLE):(this.lastCurrentTime=this.startPosition?this.startPosition:e,this.state=g.State.STARTING),this.nextLoadPosition=this.startPosition=this.lastCurrentTime,this.tick()}else this.startPosition=e,this.state=g.State.STOPPED},Object.defineProperty(AudioStreamController.prototype,"state",{get:function get(){return this._state},set:function set(e){if(this.state!==e){var t=this.state;this._state=e,f.logger.log("audio stream:"+t+"->"+e)}},enumerable:!0,configurable:!0}),AudioStreamController.prototype.doTick=function(){var t,r,n,o=this.hls,u=o.config;switch(this.state){case g.State.ERROR:case g.State.PAUSED:case g.State.BUFFER_FLUSHING:break;case g.State.STARTING:this.state=g.State.WAITING_TRACK,this.loadedmetadata=!1;break;case g.State.IDLE:var l=this.tracks;if(!l)break;if(!this.media&&(this.startFragRequested||!u.startFragPrefetch))break;if(this.loadedmetadata)t=this.media.currentTime;else if(void 0===(t=this.nextLoadPosition))break;var c=this.mediaBuffer?this.mediaBuffer:this.media,p=this.videoBuffer?this.videoBuffer:this.media,v=a.BufferHelper.bufferInfo(c,t,u.maxBufferHole),y=a.BufferHelper.bufferInfo(p,t,u.maxBufferHole),_=v.len,b=v.end,x=this.fragPrevious,w=Math.min(u.maxBufferLength,u.maxMaxBufferLength),k=Math.max(w,y.len),S=this.audioSwitch,E=this.trackId;if((_<k||S)&&E<l.length){if("undefined"===typeof(n=l[E].details)){this.state=g.State.WAITING_TRACK;break}if(!S&&this._streamEnded(v,n))return this.hls.trigger(s.default.BUFFER_EOS,{type:"audio"}),void(this.state=g.State.ENDED);var C=n.fragments,T=C.length,O=C[0].start,A=C[T-1].start+C[T-1].duration,R=void 0;if(S)if(n.live&&!n.PTSKnown)f.logger.log("switching audiotrack, live stream, unknown PTS,load first fragment"),b=0;else if(b=t,n.PTSKnown&&t<O){if(!(v.end>O||v.nextStart))return;f.logger.log("alt audio track ahead of main track, seek to start of alt audio track"),this.media.currentTime=O+.05}if(n.initSegment&&!n.initSegment.data)R=n.initSegment;else if(b<=O){if(R=C[0],null!==this.videoTrackCC&&R.cc!==this.videoTrackCC&&(R=d.findFragWithCC(C,this.videoTrackCC)),n.live&&R.loadIdx&&R.loadIdx===this.fragLoadIdx){var D=v.nextStart?v.nextStart:O;return f.logger.log("no alt audio available @currentTime:"+this.media.currentTime+", seeking @"+(D+.05)),void(this.media.currentTime=D+.05)}}else{var P=void 0,j=u.maxFragLookUpTolerance,M=x?C[x.sn-C[0].sn+1]:void 0,F=function fragmentWithinToleranceTest(e){var t=Math.min(j,e.duration);return e.start+e.duration-t<=b?1:e.start-t>b&&e.start?-1:0};b<A?(b>A-j&&(j=0),P=M&&!F(M)?M:i.default.search(C,F)):P=C[T-1],P&&(R=P,O=P.start,x&&R.level===x.level&&R.sn===x.sn&&(R.sn<n.endSN?(R=C[R.sn+1-n.startSN],f.logger.log("SN just loaded, load next one: "+R.sn)):R=null))}R&&(R.encrypted?(f.logger.log("Loading key for "+R.sn+" of ["+n.startSN+" ,"+n.endSN+"],track "+E),this.state=g.State.KEY_LOADING,o.trigger(s.default.KEY_LOADING,{frag:R})):(f.logger.log("Loading "+R.sn+", cc: "+R.cc+" of ["+n.startSN+" ,"+n.endSN+"],track "+E+", currentTime:"+t+",bufferEnd:"+b.toFixed(3)),this.fragCurrent=R,(S||this.fragmentTracker.getState(R)===h.FragmentState.NOT_LOADED)&&(this.startFragRequested=!0,e.isFinite(R.sn)&&(this.nextLoadPosition=R.start+R.duration),o.trigger(s.default.FRAG_LOADING,{frag:R}),this.state=g.State.FRAG_LOADING)))}break;case g.State.WAITING_TRACK:(r=this.tracks[this.trackId])&&r.details&&(this.state=g.State.IDLE);break;case g.State.FRAG_LOADING_WAITING_RETRY:var I=m.now(),L=this.retryDate,N=(c=this.media)&&c.seeking;(!L||I>=L||N)&&(f.logger.log("audioStreamController: retryDate reached, switch back to IDLE state"),this.state=g.State.IDLE);break;case g.State.WAITING_INIT_PTS:var B=this.videoTrackCC;if(void 0===this.initPTS[B])break;var U=this.waitingFragment;if(U){var z=U.frag.cc;B!==z?(r=this.tracks[this.trackId]).details&&r.details.live&&(f.logger.warn("Waiting fragment CC ("+z+") does not match video track CC ("+B+")"),this.waitingFragment=null,this.state=g.State.IDLE):(this.state=g.State.FRAG_LOADING,this.onFragLoaded(this.waitingFragment),this.waitingFragment=null)}else this.state=g.State.IDLE;break;case g.State.STOPPED:case g.State.FRAG_LOADING:case g.State.PARSING:case g.State.PARSED:case g.State.ENDED:}},AudioStreamController.prototype.onMediaAttached=function(e){var t=this.media=this.mediaBuffer=e.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),t.addEventListener("seeking",this.onvseeking),t.addEventListener("ended",this.onvended);var r=this.config;this.tracks&&r.autoStartLoad&&this.startLoad(r.startPosition)},AudioStreamController.prototype.onMediaDetaching=function(){var e=this.media;e&&e.ended&&(f.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),e&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1,this.stopLoad()},AudioStreamController.prototype.onAudioTracksUpdated=function(e){f.logger.log("audio tracks updated"),this.tracks=e.audioTracks},AudioStreamController.prototype.onAudioTrackSwitching=function(e){var t=!!e.url;this.trackId=e.id,this.fragCurrent=null,this.state=g.State.PAUSED,this.waitingFragment=null,t?this.setInterval(100):this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),t&&(this.audioSwitch=!0,this.state=g.State.IDLE),this.tick()},AudioStreamController.prototype.onAudioTrackLoaded=function(t){var r=t.details,n=t.id,i=this.tracks[n],a=r.totalduration,o=0;if(f.logger.log("track "+n+" loaded ["+r.startSN+","+r.endSN+"],duration:"+a),r.live){var s=i.details;s&&r.fragments.length>0?(u.mergeDetails(s,r),o=r.fragments[0].start,r.PTSKnown?f.logger.log("live audio playlist sliding:"+o.toFixed(3)):f.logger.log("live audio playlist - outdated PTS, unknown sliding")):(r.PTSKnown=!1,f.logger.log("live audio playlist - first load, unknown sliding"))}else r.PTSKnown=!1;if(i.details=r,!this.startFragRequested){if(-1===this.startPosition){var l=r.startTimeOffset;e.isFinite(l)?(f.logger.log("start time offset found in playlist, adjust startPosition to "+l),this.startPosition=l):this.startPosition=0}this.nextLoadPosition=this.startPosition}this.state===g.State.WAITING_TRACK&&(this.state=g.State.IDLE),this.tick()},AudioStreamController.prototype.onKeyLoaded=function(){this.state===g.State.KEY_LOADING&&(this.state=g.State.IDLE,this.tick())},AudioStreamController.prototype.onFragLoaded=function(e){var t=this.fragCurrent,r=e.frag;if(this.state===g.State.FRAG_LOADING&&t&&"audio"===r.type&&r.level===t.level&&r.sn===t.sn){var n=this.tracks[this.trackId],i=n.details,a=i.totalduration,u=t.level,l=t.sn,c=t.cc,d=this.config.defaultAudioCodec||n.audioCodec||"mp4a.40.2",h=this.stats=e.stats;if("initSegment"===l)this.state=g.State.IDLE,h.tparsed=h.tbuffered=m.now(),i.initSegment.data=e.payload,this.hls.trigger(s.default.FRAG_BUFFERED,{stats:h,frag:t,id:"audio"}),this.tick();else{this.state=g.State.PARSING,this.appended=!1,this.demuxer||(this.demuxer=new o.default(this.hls,"audio"));var p=this.initPTS[c],v=i.initSegment?i.initSegment.data:[];if(i.initSegment||void 0!==p){this.pendingBuffering=!0,f.logger.log("Demuxing "+l+" of ["+i.startSN+" ,"+i.endSN+"],track "+u);this.demuxer.push(e.payload,v,d,null,t,a,!1,p)}else f.logger.log("unknown video PTS for continuity counter "+c+", waiting for video PTS before demuxing audio frag "+l+" of ["+i.startSN+" ,"+i.endSN+"],track "+u),this.waitingFragment=e,this.state=g.State.WAITING_INIT_PTS}}this.fragLoadError=0},AudioStreamController.prototype.onFragParsingInitSegment=function(e){var t=this.fragCurrent,r=e.frag;if(t&&"audio"===e.id&&r.sn===t.sn&&r.level===t.level&&this.state===g.State.PARSING){var n=e.tracks,i=void 0;if(n.video&&delete n.video,i=n.audio){i.levelCodec=i.codec,i.id=e.id,this.hls.trigger(s.default.BUFFER_CODECS,n),f.logger.log("audio track:audio,container:"+i.container+",codecs[level/parsed]=["+i.levelCodec+"/"+i.codec+"]");var a=i.initSegment;if(a){var o={type:"audio",data:a,parent:"audio",content:"initSegment"};this.audioSwitch?this.pendingData=[o]:(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(s.default.BUFFER_APPENDING,o))}this.tick()}}},AudioStreamController.prototype.onFragParsingData=function(t){var r=this,n=this.fragCurrent,i=t.frag;if(n&&"audio"===t.id&&"audio"===t.type&&i.sn===n.sn&&i.level===n.level&&this.state===g.State.PARSING){var a=this.trackId,o=this.tracks[a],l=this.hls;e.isFinite(t.endPTS)||(t.endPTS=t.startPTS+n.duration,t.endDTS=t.startDTS+n.duration),n.addElementaryStream(p.default.ElementaryStreamTypes.AUDIO),f.logger.log("parsed "+t.type+",PTS:["+t.startPTS.toFixed(3)+","+t.endPTS.toFixed(3)+"],DTS:["+t.startDTS.toFixed(3)+"/"+t.endDTS.toFixed(3)+"],nb:"+t.nb),u.updateFragPTSDTS(o.details,n,t.startPTS,t.endPTS);var d=this.audioSwitch,h=this.media,m=!1;if(d&&h)if(h.readyState){var v=h.currentTime;f.logger.log("switching audio track : currentTime:"+v),v>=t.startPTS&&(f.logger.log("switching audio track : flushing all audio"),this.state=g.State.BUFFER_FLUSHING,l.trigger(s.default.BUFFER_FLUSHING,{startOffset:0,endOffset:e.POSITIVE_INFINITY,type:"audio"}),m=!0,this.audioSwitch=!1,l.trigger(s.default.AUDIO_TRACK_SWITCHED,{id:a}))}else this.audioSwitch=!1,l.trigger(s.default.AUDIO_TRACK_SWITCHED,{id:a});var y=this.pendingData;if(!y)return f.logger.warn("Apparently attempt to enqueue media payload without codec initialization data upfront"),void l.trigger(s.default.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,details:null,fatal:!0});this.audioSwitch||([t.data1,t.data2].forEach((function(e){e&&e.length&&y.push({type:t.type,data:e,parent:"audio",content:"data"})})),!m&&y.length&&(y.forEach((function(e){r.state===g.State.PARSING&&(r.pendingBuffering=!0,r.hls.trigger(s.default.BUFFER_APPENDING,e))})),this.pendingData=[],this.appended=!0)),this.tick()}},AudioStreamController.prototype.onFragParsed=function(e){var t=this.fragCurrent,r=e.frag;t&&"audio"===e.id&&r.sn===t.sn&&r.level===t.level&&this.state===g.State.PARSING&&(this.stats.tparsed=m.now(),this.state=g.State.PARSED,this._checkAppendedParsed())},AudioStreamController.prototype.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},AudioStreamController.prototype.onBufferCreated=function(e){var t=e.tracks.audio;t&&(this.mediaBuffer=t.buffer,this.loadedmetadata=!0),e.tracks.video&&(this.videoBuffer=e.tracks.video.buffer)},AudioStreamController.prototype.onBufferAppended=function(e){if("audio"===e.parent){var t=this.state;t!==g.State.PARSING&&t!==g.State.PARSED||(this.pendingBuffering=e.pending>0,this._checkAppendedParsed())}},AudioStreamController.prototype._checkAppendedParsed=function(){if(this.state===g.State.PARSED&&(!this.appended||!this.pendingBuffering)){var e=this.fragCurrent,t=this.stats,r=this.hls;if(e){this.fragPrevious=e,t.tbuffered=m.now(),r.trigger(s.default.FRAG_BUFFERED,{stats:t,frag:e,id:"audio"});var n=this.mediaBuffer?this.mediaBuffer:this.media;f.logger.log("audio buffered : "+l.default.toString(n.buffered)),this.audioSwitch&&this.appended&&(this.audioSwitch=!1,r.trigger(s.default.AUDIO_TRACK_SWITCHED,{id:this.trackId})),this.state=g.State.IDLE}this.tick()}},AudioStreamController.prototype.onError=function(t){var r=t.frag;if(!r||"audio"===r.type)switch(t.details){case c.ErrorDetails.FRAG_LOAD_ERROR:case c.ErrorDetails.FRAG_LOAD_TIMEOUT:var n=t.frag;if(n&&"audio"!==n.type)break;if(!t.fatal){var i=this.fragLoadError;if(i?i++:i=1,i<=(u=this.config).fragLoadingMaxRetry){this.fragLoadError=i;var o=Math.min(Math.pow(2,i-1)*u.fragLoadingRetryDelay,u.fragLoadingMaxRetryTimeout);f.logger.warn("AudioStreamController: frag loading failed, retry in "+o+" ms"),this.retryDate=m.now()+o,this.state=g.State.FRAG_LOADING_WAITING_RETRY}else f.logger.error("AudioStreamController: "+t.details+" reaches max retry, redispatch as fatal ..."),t.fatal=!0,this.state=g.State.ERROR}break;case c.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case c.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:case c.ErrorDetails.KEY_LOAD_ERROR:case c.ErrorDetails.KEY_LOAD_TIMEOUT:this.state!==g.State.ERROR&&(this.state=t.fatal?g.State.ERROR:g.State.IDLE,f.logger.warn("AudioStreamController: "+t.details+" while loading frag, now switching to "+this.state+" state ..."));break;case c.ErrorDetails.BUFFER_FULL_ERROR:if("audio"===t.parent&&(this.state===g.State.PARSING||this.state===g.State.PARSED)){var u,l=this.mediaBuffer,d=this.media.currentTime;if(l&&a.BufferHelper.isBuffered(l,d)&&a.BufferHelper.isBuffered(l,d+.5))(u=this.config).maxMaxBufferLength>=u.maxBufferLength&&(u.maxMaxBufferLength/=2,f.logger.warn("AudioStreamController: reduce max buffer length to "+u.maxMaxBufferLength+"s")),this.state=g.State.IDLE;else f.logger.warn("AudioStreamController: buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,this.state=g.State.BUFFER_FLUSHING,this.hls.trigger(s.default.BUFFER_FLUSHING,{startOffset:0,endOffset:e.POSITIVE_INFINITY,type:"audio"})}}},AudioStreamController.prototype.onBufferFlushed=function(){var e=this,t=this.pendingData;t&&t.length?(f.logger.log("AudioStreamController: appending pending audio data after buffer flushed"),t.forEach((function(t){e.hls.trigger(s.default.BUFFER_APPENDING,t)})),this.appended=!0,this.pendingData=[],this.state=g.State.PARSED):(this.state=g.State.IDLE,this.fragPrevious=null,this.tick())},AudioStreamController}(g.default);t.default=v}).call(this,r("./src/polyfills/number.js").Number)},"./src/controller/audio-track-controller.js":function srcControllerAudioTrackControllerJs(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function __(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(__.prototype=r.prototype,new __)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=r("./src/events.js"),a=r("./src/task-loop.js"),o=r("./src/utils/logger.js"),s=r("./src/errors.js"),u=function(e){function AudioTrackController(t){var r=e.call(this,t,i.default.MANIFEST_LOADING,i.default.MANIFEST_PARSED,i.default.AUDIO_TRACK_LOADED,i.default.AUDIO_TRACK_SWITCHED,i.default.LEVEL_LOADED,i.default.ERROR)||this;return r._trackId=-1,r._selectDefaultTrack=!0,r.tracks=[],r.trackIdBlacklist=Object.create(null),r.audioGroupId=null,r}return n(AudioTrackController,e),AudioTrackController.prototype.onManifestLoading=function(){this.tracks=[],this._trackId=-1,this._selectDefaultTrack=!0},AudioTrackController.prototype.onManifestParsed=function(e){var t=this.tracks=e.audioTracks||[];this.hls.trigger(i.default.AUDIO_TRACKS_UPDATED,{audioTracks:t})},AudioTrackController.prototype.onAudioTrackLoaded=function(e){if(e.id>=this.tracks.length)o.logger.warn("Invalid audio track id:",e.id);else{if(o.logger.log("audioTrack "+e.id+" loaded"),this.tracks[e.id].details=e.details,e.details.live&&!this.hasInterval()){var t=1e3*e.details.targetduration;this.setInterval(t)}!e.details.live&&this.hasInterval()&&this.clearInterval()}},AudioTrackController.prototype.onAudioTrackSwitched=function(e){var t=this.tracks[e.id].groupId;t&&this.audioGroupId!==t&&(this.audioGroupId=t)},AudioTrackController.prototype.onLevelLoaded=function(e){var t=this.hls.levels[e.level];if(t.audioGroupIds){var r=t.audioGroupIds[t.urlId];this.audioGroupId!==r&&(this.audioGroupId=r,this._selectInitialAudioTrack())}},AudioTrackController.prototype.onError=function(e){e.type===s.ErrorTypes.NETWORK_ERROR&&(e.fatal&&this.clearInterval(),e.details===s.ErrorDetails.AUDIO_TRACK_LOAD_ERROR&&(o.logger.warn("Network failure on audio-track id:",e.context.id),this._handleLoadError()))},Object.defineProperty(AudioTrackController.prototype,"audioTracks",{get:function get(){return this.tracks},enumerable:!0,configurable:!0}),Object.defineProperty(AudioTrackController.prototype,"audioTrack",{get:function get(){return this._trackId},set:function set(e){this._setAudioTrack(e),this._selectDefaultTrack=!1},enumerable:!0,configurable:!0}),AudioTrackController.prototype._setAudioTrack=function(e){if(this._trackId===e&&this.tracks[this._trackId].details)o.logger.debug("Same id as current audio-track passed, and track details available -> no-op");else if(e<0||e>=this.tracks.length)o.logger.warn("Invalid id passed to audio-track controller");else{var t=this.tracks[e];o.logger.log("Now switching to audio-track index "+e),this.clearInterval(),this._trackId=e;var r=t.url,n=t.type,a=t.id;this.hls.trigger(i.default.AUDIO_TRACK_SWITCHING,{id:a,type:n,url:r}),this._loadTrackDetailsIfNeeded(t)}},AudioTrackController.prototype.doTick=function(){this._updateTrack(this._trackId)},AudioTrackController.prototype._selectInitialAudioTrack=function(){var e=this,t=this.tracks;if(t.length){var r=this.tracks[this._trackId],n=null;if(r&&(n=r.name),this._selectDefaultTrack){var a=t.filter((function(e){return e.default}));a.length?t=a:o.logger.warn("No default audio tracks defined")}var u=!1,l=function traverseTracks(){t.forEach((function(t){u||e.audioGroupId&&t.groupId!==e.audioGroupId||n&&n!==t.name||(e._setAudioTrack(t.id),u=!0)}))};l(),u||(n=null,l()),u||(o.logger.error("No track found for running audio group-ID: "+this.audioGroupId),this.hls.trigger(i.default.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))}},AudioTrackController.prototype._needsTrackLoading=function(e){var t=e.details,r=e.url;return!(t&&!t.live)&&!!r},AudioTrackController.prototype._loadTrackDetailsIfNeeded=function(e){if(this._needsTrackLoading(e)){var t=e.url,r=e.id;o.logger.log("loading audio-track playlist for id: "+r),this.hls.trigger(i.default.AUDIO_TRACK_LOADING,{url:t,id:r})}},AudioTrackController.prototype._updateTrack=function(e){if(!(e<0||e>=this.tracks.length)){this.clearInterval(),this._trackId=e,o.logger.log("trying to update audio-track "+e);var t=this.tracks[e];this._loadTrackDetailsIfNeeded(t)}},AudioTrackController.prototype._handleLoadError=function(){this.trackIdBlacklist[this._trackId]=!0;var e=this._trackId,t=this.tracks[e],r=t.name,n=t.language,i=t.groupId;o.logger.warn("Loading failed on audio track id: "+e+", group-id: "+i+', name/language: "'+r+'" / "'+n+'"');for(var a=e,s=0;s<this.tracks.length;s++){if(!this.trackIdBlacklist[s])if(this.tracks[s].name===r){a=s;break}}a!==e?(o.logger.log("Attempting audio-track fallback id:",a,"group-id:",this.tracks[a].groupId),this._setAudioTrack(a)):o.logger.warn('No fallback audio-track found for name/language: "'+r+'" / "'+n+'"')},AudioTrackController}(a.default);t.default=u},"./src/controller/base-stream-controller.js":function srcControllerBaseStreamControllerJs(e,t,r){"use strict";(function(e){var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function __(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(__.prototype=r.prototype,new __)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=r("./src/task-loop.js"),a=r("./src/controller/fragment-tracker.js"),o=r("./src/utils/buffer-helper.js"),s=r("./src/utils/logger.js");t.State={STOPPED:"STOPPED",STARTING:"STARTING",IDLE:"IDLE",PAUSED:"PAUSED",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BUFFER_FLUSHING:"BUFFER_FLUSHING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"};var u=function(r){function BaseStreamController(){return null!==r&&r.apply(this,arguments)||this}return n(BaseStreamController,r),BaseStreamController.prototype.doTick=function(){},BaseStreamController.prototype.startLoad=function(){},BaseStreamController.prototype.stopLoad=function(){var e=this.fragCurrent;e&&(e.loader&&e.loader.abort(),this.fragmentTracker.removeFragment(e)),this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=t.State.STOPPED},BaseStreamController.prototype._streamEnded=function(e,t){var r=this.fragCurrent,n=this.fragmentTracker;if(!t.live&&r&&!r.backtracked&&r.sn===t.endSN&&!e.nextStart){var i=n.getState(r);return i===a.FragmentState.PARTIAL||i===a.FragmentState.OK}return!1},BaseStreamController.prototype.onMediaSeeking=function(){var r=this.config,n=this.media,i=this.mediaBuffer,a=this.state,u=n?n.currentTime:null,l=o.BufferHelper.bufferInfo(i||n,u,this.config.maxBufferHole);if(e.isFinite(u)&&s.logger.log("media seeking to "+u.toFixed(3)),a===t.State.FRAG_LOADING){var c=this.fragCurrent;if(0===l.len&&c){var f=r.maxFragLookUpTolerance,d=c.start-f,h=c.start+c.duration+f;u<d||u>h?(c.loader&&(s.logger.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),c.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.state=t.State.IDLE):s.logger.log("seeking outside of buffer but within currently loaded fragment range")}}else a===t.State.ENDED&&(0===l.len&&(this.fragPrevious=null,this.fragCurrent=null),this.state=t.State.IDLE);n&&(this.lastCurrentTime=u),this.loadedmetadata||(this.nextLoadPosition=this.startPosition=u),this.tick()},BaseStreamController.prototype.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},BaseStreamController.prototype.onHandlerDestroying=function(){this.stopLoad(),r.prototype.onHandlerDestroying.call(this)},BaseStreamController.prototype.onHandlerDestroyed=function(){this.state=t.State.STOPPED,this.fragmentTracker=null},BaseStreamController}(i.default);t.default=u}).call(this,r("./src/polyfills/number.js").Number)},"./src/controller/buffer-controller.js":function srcControllerBufferControllerJs(e,t,r){"use strict";(function(e){var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function __(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(__.prototype=r.prototype,new __)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=r("./src/events.js"),a=r("./src/event-handler.js"),o=r("./src/utils/logger.js"),s=r("./src/errors.js"),u=r("./src/utils/mediasource-helper.js").getMediaSource(),l=function(t){function BufferController(e){var r=t.call(this,e,i.default.MEDIA_ATTACHING,i.default.MEDIA_DETACHING,i.default.MANIFEST_PARSED,i.default.BUFFER_RESET,i.default.BUFFER_APPENDING,i.default.BUFFER_CODECS,i.default.BUFFER_EOS,i.default.BUFFER_FLUSHING,i.default.LEVEL_PTS_UPDATED,i.default.LEVEL_UPDATED)||this;return r._msDuration=null,r._levelDuration=null,r._levelTargetDuration=10,r._live=null,r._objectUrl=null,r.bufferCodecEventsExpected=0,r.onsbue=r.onSBUpdateEnd.bind(r),r.onsbe=r.onSBUpdateError.bind(r),r.pendingTracks={},r.tracks={},r}return n(BufferController,t),BufferController.prototype.destroy=function(){a.default.prototype.destroy.call(this)},BufferController.prototype.onLevelPtsUpdated=function(e){var t=e.type,r=this.tracks.audio;if("audio"===t&&r&&"audio/mpeg"===r.container){var n=this.sourceBuffer.audio;if(Math.abs(n.timestampOffset-e.start)>.1){var i=n.updating;try{n.abort()}catch(a){o.logger.warn("can not abort audio buffer: "+a)}i?this.audioTimestampOffset=e.start:(o.logger.warn("change mpeg audio timestamp offset from "+n.timestampOffset+" to "+e.start),n.timestampOffset=e.start)}}},BufferController.prototype.onManifestParsed=function(e){this.bufferCodecEventsExpected=e.altAudio?2:1,o.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},BufferController.prototype.onMediaAttaching=function(e){var t=this.media=e.media;if(t){var r=this.mediaSource=new u;this.onmso=this.onMediaSourceOpen.bind(this),this.onmse=this.onMediaSourceEnded.bind(this),this.onmsc=this.onMediaSourceClose.bind(this),r.addEventListener("sourceopen",this.onmso),r.addEventListener("sourceended",this.onmse),r.addEventListener("sourceclose",this.onmsc),t.src=window.URL.createObjectURL(r),this._objectUrl=t.src}},BufferController.prototype.onMediaDetaching=function(){o.logger.log("media source detaching");var e=this.mediaSource;if(e){if("open"===e.readyState)try{e.endOfStream()}catch(t){o.logger.warn("onMediaDetaching:"+t.message+" while calling endOfStream")}e.removeEventListener("sourceopen",this.onmso),e.removeEventListener("sourceended",this.onmse),e.removeEventListener("sourceclose",this.onmsc),this.media&&(window.URL.revokeObjectURL(this._objectUrl),this.media.src===this._objectUrl?(this.media.removeAttribute("src"),this.media.load()):o.logger.warn("media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.pendingTracks={},this.tracks={},this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0}this.onmso=this.onmse=this.onmsc=null,this.hls.trigger(i.default.MEDIA_DETACHED)},BufferController.prototype.onMediaSourceOpen=function(){o.logger.log("media source opened"),this.hls.trigger(i.default.MEDIA_ATTACHED,{media:this.media});var e=this.mediaSource;e&&e.removeEventListener("sourceopen",this.onmso),this.checkPendingTracks()},BufferController.prototype.checkPendingTracks=function(){var e=this.bufferCodecEventsExpected,t=this.pendingTracks,r=Object.keys(t).length;(r&&!e||2===r)&&(this.createSourceBuffers(t),this.pendingTracks={},this.doAppending())},BufferController.prototype.onMediaSourceClose=function(){o.logger.log("media source closed")},BufferController.prototype.onMediaSourceEnded=function(){o.logger.log("media source ended")},BufferController.prototype.onSBUpdateEnd=function(){if(this.audioTimestampOffset){var e=this.sourceBuffer.audio;o.logger.warn("change mpeg audio timestamp offset from "+e.timestampOffset+" to "+this.audioTimestampOffset),e.timestampOffset=this.audioTimestampOffset,delete this.audioTimestampOffset}this._needsFlush&&this.doFlush(),this._needsEos&&this.checkEos(),this.appending=!1;var t=this.parent,r=this.segments.reduce((function(e,r){return r.parent===t?e+1:e}),0),n={},a=this.sourceBuffer;for(var s in a)n[s]=a[s].buffered;this.hls.trigger(i.default.BUFFER_APPENDED,{parent:t,pending:r,timeRanges:n}),this._needsFlush||this.doAppending(),this.updateMediaElementDuration(),0===r&&this.flushLiveBackBuffer()},BufferController.prototype.onSBUpdateError=function(e){o.logger.error("sourceBuffer error:",e),this.hls.trigger(i.default.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})},BufferController.prototype.onBufferReset=function(){var e=this.sourceBuffer;for(var t in e){var r=e[t];try{this.mediaSource.removeSourceBuffer(r),r.removeEventListener("updateend",this.onsbue),r.removeEventListener("error",this.onsbe)}catch(n){}}this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0},BufferController.prototype.onBufferCodecs=function(e){var t=this;if(!Object.keys(this.sourceBuffer).length){Object.keys(e).forEach((function(r){t.pendingTracks[r]=e[r]}));var r=this.mediaSource;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),r&&"open"===r.readyState&&this.checkPendingTracks()}},BufferController.prototype.createSourceBuffers=function(e){var t=this.sourceBuffer,r=this.mediaSource;for(var n in e)if(!t[n]){var a=e[n],u=a.levelCodec||a.codec,l=a.container+";codecs="+u;o.logger.log("creating sourceBuffer("+l+")");try{var c=t[n]=r.addSourceBuffer(l);c.addEventListener("updateend",this.onsbue),c.addEventListener("error",this.onsbe),this.tracks[n]={codec:u,container:a.container},a.buffer=c}catch(f){o.logger.error("error while trying to add sourceBuffer:"+f.message),this.hls.trigger(i.default.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,err:f,mimeType:l})}}this.hls.trigger(i.default.BUFFER_CREATED,{tracks:e})},BufferController.prototype.onBufferAppending=function(e){this._needsFlush||(this.segments?this.segments.push(e):this.segments=[e],this.doAppending())},BufferController.prototype.onBufferAppendFail=function(e){o.logger.error("sourceBuffer error:",e.event),this.hls.trigger(i.default.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})},BufferController.prototype.onBufferEos=function(e){var t=this.sourceBuffer,r=e.type;for(var n in t)r&&n!==r||t[n].ended||(t[n].ended=!0,o.logger.log(n+" sourceBuffer now EOS"));this.checkEos()},BufferController.prototype.checkEos=function(){var e=this.sourceBuffer,t=this.mediaSource;if(t&&"open"===t.readyState){for(var r in e){var n=e[r];if(!n.ended)return;if(n.updating)return void(this._needsEos=!0)}o.logger.log("all media data are available, signal endOfStream() to MediaSource and stop loading fragment");try{t.endOfStream()}catch(i){o.logger.warn("exception while calling mediaSource.endOfStream()")}this._needsEos=!1}else this._needsEos=!1},BufferController.prototype.onBufferFlushing=function(e){this.flushRange.push({start:e.startOffset,end:e.endOffset,type:e.type}),this.flushBufferCounter=0,this.doFlush()},BufferController.prototype.flushLiveBackBuffer=function(){if(this._live){var e=this.hls.config.liveBackBufferLength;if(isFinite(e)&&!(e<0))for(var t=this.media.currentTime,r=this.sourceBuffer,n=Object.keys(r),i=t-Math.max(e,this._levelTargetDuration),a=n.length-1;a>=0;a--){var o=n[a],s=r[o].buffered;s.length>0&&i>s.start(0)&&this.removeBufferRange(o,r[o],0,i)}}},BufferController.prototype.onLevelUpdated=function(e){var t=e.details;t.fragments.length>0&&(this._levelDuration=t.totalduration+t.fragments[0].start,this._levelTargetDuration=t.averagetargetduration||t.targetduration||10,this._live=t.live,this.updateMediaElementDuration())},BufferController.prototype.updateMediaElementDuration=function(){var t,r=this.hls.config;if(null!==this._levelDuration&&this.media&&this.mediaSource&&this.sourceBuffer&&0!==this.media.readyState&&"open"===this.mediaSource.readyState){for(var n in this.sourceBuffer)if(!0===this.sourceBuffer[n].updating)return;t=this.media.duration,null===this._msDuration&&(this._msDuration=this.mediaSource.duration),!0===this._live&&!0===r.liveDurationInfinity?(o.logger.log("Media Source duration is set to Infinity"),this._msDuration=this.mediaSource.duration=1/0):(this._levelDuration>this._msDuration&&this._levelDuration>t||!e.isFinite(t))&&(o.logger.log("Updating Media Source duration to "+this._levelDuration.toFixed(3)),this._msDuration=this.mediaSource.duration=this._levelDuration)}},BufferController.prototype.doFlush=function(){for(;this.flushRange.length;){var e=this.flushRange[0];if(!this.flushBuffer(e.start,e.end,e.type))return void(this._needsFlush=!0);this.flushRange.shift(),this.flushBufferCounter=0}if(0===this.flushRange.length){this._needsFlush=!1;var t=0,r=this.sourceBuffer;try{for(var n in r)t+=r[n].buffered.length}catch(a){o.logger.error("error while accessing sourceBuffer.buffered")}this.appended=t,this.hls.trigger(i.default.BUFFER_FLUSHED)}},BufferController.prototype.doAppending=function(){var e=this.hls,t=this.segments,r=this.sourceBuffer;if(Object.keys(r).length){if(this.media.error)return this.segments=[],void o.logger.error("trying to append although a media error occured, flush segment and abort");if(this.appending)return;if(t&&t.length){var n=t.shift();try{var a=r[n.type];a?a.updating?t.unshift(n):(a.ended=!1,this.parent=n.parent,a.appendBuffer(n.data),this.appendError=0,this.appended++,this.appending=!0):this.onSBUpdateEnd()}catch(l){o.logger.error("error while trying to append buffer:"+l.message),t.unshift(n);var u={type:s.ErrorTypes.MEDIA_ERROR,parent:n.parent};22!==l.code?(this.appendError?this.appendError++:this.appendError=1,u.details=s.ErrorDetails.BUFFER_APPEND_ERROR,this.appendError>e.config.appendErrorMaxRetry?(o.logger.log("fail "+e.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),this.segments=[],u.fatal=!0,e.trigger(i.default.ERROR,u)):(u.fatal=!1,e.trigger(i.default.ERROR,u))):(this.segments=[],u.details=s.ErrorDetails.BUFFER_FULL_ERROR,u.fatal=!1,e.trigger(i.default.ERROR,u))}}}},BufferController.prototype.flushBuffer=function(e,t,r){var n,i=this.sourceBuffer;if(Object.keys(i).length){if(o.logger.log("flushBuffer,pos/start/end: "+this.media.currentTime.toFixed(3)+"/"+e+"/"+t),this.flushBufferCounter<this.appended){for(var a in i)if(!r||a===r){if((n=i[a]).ended=!1,n.updating)return o.logger.warn("cannot flush, sb updating in progress"),!1;if(this.removeBufferRange(a,n,e,t))return this.flushBufferCounter++,!1}}else o.logger.warn("abort flushing too many retries");o.logger.log("buffer flushed")}return!0},BufferController.prototype.removeBufferRange=function(e,t,r,n){try{for(var i=0;i<t.buffered.length;i++){var a=t.buffered.start(i),s=t.buffered.end(i),u=Math.max(a,r),l=Math.min(s,n);if(Math.min(l,s)-u>.5)return o.logger.log("sb remove "+e+" ["+u+","+l+"], of ["+a+","+s+"], pos:"+this.media.currentTime),t.remove(u,l),!0}}catch(c){o.logger.warn("removeBufferRange failed",c)}return!1},BufferController}(a.default);t.default=l}).call(this,r("./src/polyfills/number.js").Number)},"./src/controller/cap-level-controller.js":function srcControllerCapLevelControllerJs(e,t,r){"use strict";(function(e){var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function __(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(__.prototype=r.prototype,new __)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=r("./src/events.js"),a=function(t){function CapLevelController(r){var n=t.call(this,r,i.default.FPS_DROP_LEVEL_CAPPING,i.default.MEDIA_ATTACHING,i.default.MANIFEST_PARSED,i.default.BUFFER_CODECS,i.default.MEDIA_DETACHING)||this;return n.autoLevelCapping=e.POSITIVE_INFINITY,n.firstLevel=null,n.levels=[],n.media=null,n.restrictedLevels=[],n.timer=null,n}return n(CapLevelController,t),CapLevelController.prototype.destroy=function(){this.hls.config.capLevelToPlayerSize&&(this.media=null,this._stopCapping())},CapLevelController.prototype.onFpsDropLevelCapping=function(e){CapLevelController.isLevelAllowed(e.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(e.droppedLevel)},CapLevelController.prototype.onMediaAttaching=function(e){this.media=e.media instanceof window.HTMLVideoElement?e.media:null},CapLevelController.prototype.onManifestParsed=function(e){var t=this.hls;this.restrictedLevels=[],this.levels=e.levels,this.firstLevel=e.firstLevel,t.config.capLevelToPlayerSize&&e.video&&this._startCapping()},CapLevelController.prototype.onBufferCodecs=function(e){this.hls.config.capLevelToPlayerSize&&e.video&&this._startCapping()},CapLevelController.prototype.onLevelsUpdated=function(e){this.levels=e.levels},CapLevelController.prototype.onMediaDetaching=function(){this._stopCapping()},CapLevelController.prototype.detectPlayerSize=function(){if(this.media){var e=this.levels?this.levels.length:0;if(e){var t=this.hls;t.autoLevelCapping=this.getMaxLevel(e-1),t.autoLevelCapping>this.autoLevelCapping&&t.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}},CapLevelController.prototype.getMaxLevel=function(e){var t=this;if(!this.levels)return-1;var r=this.levels.filter((function(r,n){return CapLevelController.isLevelAllowed(n,t.restrictedLevels)&&n<=e}));return CapLevelController.getMaxLevelByMediaSize(r,this.mediaWidth,this.mediaHeight)},CapLevelController.prototype._startCapping=function(){this.timer||(this.autoLevelCapping=e.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),clearInterval(this.timer),this.timer=setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())},CapLevelController.prototype._stopCapping=function(){this.restrictedLevels=[],this.firstLevel=null,this.autoLevelCapping=e.POSITIVE_INFINITY,this.timer&&(this.timer=clearInterval(this.timer),this.timer=null)},Object.defineProperty(CapLevelController.prototype,"mediaWidth",{get:function get(){var e,t=this.media;return t&&(e=t.width||t.clientWidth||t.offsetWidth,e*=CapLevelController.contentScaleFactor),e},enumerable:!0,configurable:!0}),Object.defineProperty(CapLevelController.prototype,"mediaHeight",{get:function get(){var e,t=this.media;return t&&(e=t.height||t.clientHeight||t.offsetHeight,e*=CapLevelController.contentScaleFactor),e},enumerable:!0,configurable:!0}),Object.defineProperty(CapLevelController,"contentScaleFactor",{get:function get(){var e=1;try{e=window.devicePixelRatio}catch(t){}return e},enumerable:!0,configurable:!0}),CapLevelController.isLevelAllowed=function(e,t){return void 0===t&&(t=[]),-1===t.indexOf(e)},CapLevelController.getMaxLevelByMediaSize=function(e,t,r){if(!e||e&&!e.length)return-1;for(var n=function atGreatestBandiwdth(e,t){return!t||(e.width!==t.width||e.height!==t.height)},i=e.length-1,a=0;a<e.length;a+=1){var o=e[a];if((o.width>=t||o.height>=r)&&n(o,e[a+1])){i=a;break}}return i},CapLevelController}(r("./src/event-handler.js").default);t.default=a}).call(this,r("./src/polyfills/number.js").Number)},"./src/controller/eme-controller.js":function srcControllerEmeControllerJs(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function __(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(__.prototype=r.prototype,new __)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=r("./src/event-handler.js"),a=r("./src/events.js"),o=r("./src/errors.js"),s=r("./src/utils/logger.js"),u=window.XMLHttpRequest,l="com.widevine.alpha",c="com.microsoft.playready",f=function(e){function EMEController(t){var r=e.call(this,t,a.default.MEDIA_ATTACHED,a.default.MANIFEST_PARSED)||this;return r._widevineLicenseUrl=t.config.widevineLicenseUrl,r._licenseXhrSetup=t.config.licenseXhrSetup,r._emeEnabled=t.config.emeEnabled,r._requestMediaKeySystemAccess=t.config.requestMediaKeySystemAccessFunc,r._mediaKeysList=[],r._media=null,r._hasSetMediaKeys=!1,r._isMediaEncrypted=!1,r._requestLicenseFailureCount=0,r}return n(EMEController,e),EMEController.prototype.getLicenseServerUrl=function(e){var t;switch(e){case l:t=this._widevineLicenseUrl;break;default:t=null}return t||(s.logger.error('No license server URL configured for key-system "'+e+'"'),this.hls.trigger(a.default.ERROR,{type:o.ErrorTypes.KEY_SYSTEM_ERROR,details:o.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})),t},EMEController.prototype._attemptKeySystemAccess=function(e,t,r){var n=this,i=function getSupportedMediaKeySystemConfigurations(e,t,r){switch(e){case l:return function createWidevineMediaKeySystemConfigurations(e,t,r){var n={videoCapabilities:[]};return t.forEach((function(e){n.videoCapabilities.push({contentType:'video/mp4; codecs="'+e+'"'})})),[n]}(0,r);default:throw Error("Unknown key-system: "+e)}}(e,0,r);i?(s.logger.log("Requesting encrypted media key-system access"),this.requestMediaKeySystemAccess(e,i).then((function(t){n._onMediaKeySystemAccessObtained(e,t)})).catch((function(t){s.logger.error('Failed to obtain key-system "'+e+'" access:',t)}))):s.logger.warn("Can not create config for key-system (maybe because platform is not supported):",e)},Object.defineProperty(EMEController.prototype,"requestMediaKeySystemAccess",{get:function get(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess},enumerable:!0,configurable:!0}),EMEController.prototype._onMediaKeySystemAccessObtained=function(e,t){var r=this;s.logger.log('Access for key-system "'+e+'" obtained');var n={mediaKeys:null,mediaKeysSession:null,mediaKeysSessionInitialized:!1,mediaKeySystemAccess:t,mediaKeySystemDomain:e};this._mediaKeysList.push(n),t.createMediaKeys().then((function(t){n.mediaKeys=t,s.logger.log('Media-keys created for key-system "'+e+'"'),r._onMediaKeysCreated()})).catch((function(e){s.logger.error("Failed to create media-keys:",e)}))},EMEController.prototype._onMediaKeysCreated=function(){var e=this;this._mediaKeysList.forEach((function(t){t.mediaKeysSession||(t.mediaKeysSession=t.mediaKeys.createSession(),e._onNewMediaKeySession(t.mediaKeysSession))}))},EMEController.prototype._onNewMediaKeySession=function(e){var t=this;s.logger.log("New key-system session "+e.sessionId),e.addEventListener("message",(function(r){t._onKeySessionMessage(e,r.message)}),!1)},EMEController.prototype._onKeySessionMessage=function(e,t){s.logger.log("Got EME message event, creating license request"),this._requestLicense(t,(function(t){s.logger.log("Received license data, updating key-session"),e.update(t)}))},EMEController.prototype._onMediaEncrypted=function(e,t){s.logger.log('Media is encrypted using "'+e+'" init data type'),this._isMediaEncrypted=!0,this._mediaEncryptionInitDataType=e,this._mediaEncryptionInitData=t,this._attemptSetMediaKeys(),this._generateRequestWithPreferredKeySession()},EMEController.prototype._attemptSetMediaKeys=function(){if(!this._hasSetMediaKeys){var e=this._mediaKeysList[0];if(!e||!e.mediaKeys)return s.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),void this.hls.trigger(a.default.ERROR,{type:o.ErrorTypes.KEY_SYSTEM_ERROR,details:o.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});s.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(e.mediaKeys),this._hasSetMediaKeys=!0}},EMEController.prototype._generateRequestWithPreferredKeySession=function(){var e=this,t=this._mediaKeysList[0];if(!t)return s.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),void this.hls.trigger(a.default.ERROR,{type:o.ErrorTypes.KEY_SYSTEM_ERROR,details:o.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});if(t.mediaKeysSessionInitialized)s.logger.warn("Key-Session already initialized but requested again");else{var r=t.mediaKeysSession;r||(s.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(a.default.ERROR,{type:o.ErrorTypes.KEY_SYSTEM_ERROR,details:o.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0}));var n=this._mediaEncryptionInitDataType,i=this._mediaEncryptionInitData;s.logger.log('Generating key-session request for "'+n+'" init data type'),t.mediaKeysSessionInitialized=!0,r.generateRequest(n,i).then((function(){s.logger.debug("Key-session generation succeeded")})).catch((function(t){s.logger.error("Error generating key-session request:",t),e.hls.trigger(a.default.ERROR,{type:o.ErrorTypes.KEY_SYSTEM_ERROR,details:o.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})}))}},EMEController.prototype._createLicenseXhr=function(e,t,r){var n=new u,i=this._licenseXhrSetup;try{if(i)try{i(n,e)}catch(l){n.open("POST",e,!0),i(n,e)}n.readyState||n.open("POST",e,!0)}catch(l){return s.logger.error("Error setting up key-system license XHR",l),void this.hls.trigger(a.default.ERROR,{type:o.ErrorTypes.KEY_SYSTEM_ERROR,details:o.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}return n.responseType="arraybuffer",n.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,n,e,t,r),n},EMEController.prototype._onLicenseRequestReadyStageChange=function(e,t,r,n){switch(e.readyState){case 4:if(200===e.status)this._requestLicenseFailureCount=0,s.logger.log("License request succeeded"),n(e.response);else{if(s.logger.error("License Request XHR failed ("+t+"). Status: "+e.status+" ("+e.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount<=3){var i=3-this._requestLicenseFailureCount+1;return s.logger.warn("Retrying license request, "+i+" attempts left"),void this._requestLicense(r,n)}this.hls.trigger(a.default.ERROR,{type:o.ErrorTypes.KEY_SYSTEM_ERROR,details:o.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}}},EMEController.prototype._generateLicenseRequestChallenge=function(e,t){var r;return e.mediaKeySystemDomain===c?s.logger.error("PlayReady is not supported (yet)"):e.mediaKeySystemDomain===l?r=t:s.logger.error("Unsupported key-system:",e.mediaKeySystemDomain),r},EMEController.prototype._requestLicense=function(e,t){s.logger.log("Requesting content license for key-system");var r=this._mediaKeysList[0];if(!r)return s.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),void this.hls.trigger(a.default.ERROR,{type:o.ErrorTypes.KEY_SYSTEM_ERROR,details:o.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});var n=this.getLicenseServerUrl(r.mediaKeySystemDomain),i=this._createLicenseXhr(n,e,t);s.logger.log("Sending license request to URL: "+n),i.send(this._generateLicenseRequestChallenge(r,e))},EMEController.prototype.onMediaAttached=function(e){var t=this;if(this._emeEnabled){var r=e.media;this._media=r,r.addEventListener("encrypted",(function(e){t._onMediaEncrypted(e.initDataType,e.initData)}))}},EMEController.prototype.onManifestParsed=function(e){if(this._emeEnabled){var t=e.levels.map((function(e){return e.audioCodec})),r=e.levels.map((function(e){return e.videoCodec}));this._attemptKeySystemAccess(l,t,r)}},EMEController}(i.default);t.default=f},"./src/controller/fps-controller.js":function srcControllerFpsControllerJs(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function __(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(__.prototype=r.prototype,new __)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=r("./src/events.js"),a=r("./src/event-handler.js"),o=r("./src/utils/logger.js"),s=window.performance,u=function(e){function FPSController(t){return e.call(this,t,i.default.MEDIA_ATTACHING)||this}return n(FPSController,e),FPSController.prototype.destroy=function(){this.timer&&clearInterval(this.timer),this.isVideoPlaybackQualityAvailable=!1},FPSController.prototype.onMediaAttaching=function(e){var t=this.hls.config;t.capLevelOnFPSDrop&&("function"===typeof(this.video=e.media instanceof window.HTMLVideoElement?e.media:null).getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),clearInterval(this.timer),this.timer=setInterval(this.checkFPSInterval.bind(this),t.fpsDroppedMonitoringPeriod))},FPSController.prototype.checkFPS=function(e,t,r){var n=s.now();if(t){if(this.lastTime){var a=n-this.lastTime,u=r-this.lastDroppedFrames,l=t-this.lastDecodedFrames,c=1e3*u/a,f=this.hls;if(f.trigger(i.default.FPS_DROP,{currentDropped:u,currentDecoded:l,totalDroppedFrames:r}),c>0&&u>f.config.fpsDroppedMonitoringThreshold*l){var d=f.currentLevel;o.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+d),d>0&&(-1===f.autoLevelCapping||f.autoLevelCapping>=d)&&(d-=1,f.trigger(i.default.FPS_DROP_LEVEL_CAPPING,{level:d,droppedLevel:f.currentLevel}),f.autoLevelCapping=d,f.streamController.nextLevelSwitch())}}this.lastTime=n,this.lastDroppedFrames=r,this.lastDecodedFrames=t}},FPSController.prototype.checkFPSInterval=function(){var e=this.video;if(e)if(this.isVideoPlaybackQualityAvailable){var t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)},FPSController}(a.default);t.default=u},"./src/controller/fragment-finders.js":function srcControllerFragmentFindersJs(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r("./src/utils/binary-search.js");function fragmentWithinToleranceTest(e,t,r){void 0===e&&(e=0),void 0===t&&(t=0);var n=Math.min(t,r.duration+(r.deltaPTS?r.deltaPTS:0));return r.start+r.duration-n<=e?1:r.start-n>e&&r.start?-1:0}function pdtWithinToleranceTest(e,t,r){var n=1e3*Math.min(t,r.duration+(r.deltaPTS?r.deltaPTS:0));return r.endProgramDateTime-n>e}t.findFragmentByPDT=function findFragmentByPDT(t,r,n){if(!Array.isArray(t)||!t.length||!e.isFinite(r))return null;if(r<t[0].programDateTime)return null;if(r>=t[t.length-1].endProgramDateTime)return null;n=n||0;for(var i=0;i<t.length;++i){var a=t[i];if(pdtWithinToleranceTest(r,n,a))return a}return null},t.findFragmentByPTS=function findFragmentByPTS(e,t,r,i){void 0===r&&(r=0),void 0===i&&(i=0);var a=e?t[e.sn-t[0].sn+1]:null;return a&&!fragmentWithinToleranceTest(r,i,a)?a:n.default.search(t,fragmentWithinToleranceTest.bind(null,r,i))},t.fragmentWithinToleranceTest=fragmentWithinToleranceTest,t.pdtWithinToleranceTest=pdtWithinToleranceTest}).call(this,r("./src/polyfills/number.js").Number)},"./src/controller/fragment-tracker.js":function srcControllerFragmentTrackerJs(e,t,r){"use strict";(function(e){var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function __(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(__.prototype=r.prototype,new __)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=r("./src/event-handler.js"),a=r("./src/events.js");t.FragmentState={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};var o=function(r){function FragmentTracker(e){var t=r.call(this,e,a.default.BUFFER_APPENDED,a.default.FRAG_BUFFERED,a.default.FRAG_LOADED)||this;return t.bufferPadding=.2,t.fragments=Object.create(null),t.timeRanges=Object.create(null),t.config=e.config,t}return n(FragmentTracker,r),FragmentTracker.prototype.destroy=function(){this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.config=null,i.default.prototype.destroy.call(this),r.prototype.destroy.call(this)},FragmentTracker.prototype.getBufferedFrag=function(e,t){var r=this.fragments,n=Object.keys(r).filter((function(n){var i=r[n];if(i.body.type!==t)return!1;if(!i.buffered)return!1;var a=i.body;return a.startPTS<=e&&e<=a.endPTS}));if(0===n.length)return null;var i=n.pop();return r[i].body},FragmentTracker.prototype.detectEvictedFragments=function(e,t){var r,n,i=this;Object.keys(this.fragments).forEach((function(a){var o=i.fragments[a];if(!0===o.buffered){var s=o.range[e];if(s){r=s.time;for(var u=0;u<r.length;u++)if(n=r[u],!1===i.isTimeBuffered(n.startPTS,n.endPTS,t)){i.removeFragment(o.body);break}}}}))},FragmentTracker.prototype.detectPartialFragments=function(e){var t=this,r=this.getFragmentKey(e),n=this.fragments[r];n&&(n.buffered=!0,Object.keys(this.timeRanges).forEach((function(r){if(e.hasElementaryStream(r)){var i=t.timeRanges[r];n.range[r]=t.getBufferedTimes(e.startPTS,e.endPTS,i)}})))},FragmentTracker.prototype.getBufferedTimes=function(e,t,r){for(var n,i,a=[],o=!1,s=0;s<r.length;s++){if(n=r.start(s)-this.bufferPadding,i=r.end(s)+this.bufferPadding,e>=n&&t<=i){a.push({startPTS:Math.max(e,r.start(s)),endPTS:Math.min(t,r.end(s))});break}if(e<i&&t>n)a.push({startPTS:Math.max(e,r.start(s)),endPTS:Math.min(t,r.end(s))}),o=!0;else if(t<=n)break}return{time:a,partial:o}},FragmentTracker.prototype.getFragmentKey=function(e){return e.type+"_"+e.level+"_"+e.urlId+"_"+e.sn},FragmentTracker.prototype.getPartialFragment=function(e){var t,r,n,i=this,a=null,o=0;return Object.keys(this.fragments).forEach((function(s){var u=i.fragments[s];i.isPartial(u)&&(r=u.body.startPTS-i.bufferPadding,n=u.body.endPTS+i.bufferPadding,e>=r&&e<=n&&(t=Math.min(e-r,n-e),o<=t&&(a=u.body,o=t)))})),a},FragmentTracker.prototype.getState=function(e){var r=this.getFragmentKey(e),n=this.fragments[r],i=t.FragmentState.NOT_LOADED;return void 0!==n&&(i=n.buffered?!0===this.isPartial(n)?t.FragmentState.PARTIAL:t.FragmentState.OK:t.FragmentState.APPENDING),i},FragmentTracker.prototype.isPartial=function(e){return!0===e.buffered&&(void 0!==e.range.video&&!0===e.range.video.partial||void 0!==e.range.audio&&!0===e.range.audio.partial)},FragmentTracker.prototype.isTimeBuffered=function(e,t,r){for(var n,i,a=0;a<r.length;a++){if(n=r.start(a)-this.bufferPadding,i=r.end(a)+this.bufferPadding,e>=n&&t<=i)return!0;if(t<=n)return!1}return!1},FragmentTracker.prototype.onFragLoaded=function(t){var r=t.frag;e.isFinite(r.sn)&&!r.bitrateTest&&(this.fragments[this.getFragmentKey(r)]={body:r,range:Object.create(null),buffered:!1})},FragmentTracker.prototype.onBufferAppended=function(e){var t=this;this.timeRanges=e.timeRanges,Object.keys(this.timeRanges).forEach((function(e){var r=t.timeRanges[e];t.detectEvictedFragments(e,r)}))},FragmentTracker.prototype.onFragBuffered=function(e){this.detectPartialFragments(e.frag)},FragmentTracker.prototype.hasFragment=function(e){var t=this.getFragmentKey(e);return void 0!==this.fragments[t]},FragmentTracker.prototype.removeFragment=function(e){var t=this.getFragmentKey(e);delete this.fragments[t]},FragmentTracker.prototype.removeAllFragments=function(){this.fragments=Object.create(null)},FragmentTracker}(i.default);t.FragmentTracker=o}).call(this,r("./src/polyfills/number.js").Number)},"./src/controller/gap-controller.js":function srcControllerGapControllerJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("./src/utils/buffer-helper.js"),i=r("./src/errors.js"),a=r("./src/events.js"),o=r("./src/utils/logger.js"),s=function(){function GapController(e,t,r,n){this.config=e,this.media=t,this.fragmentTracker=r,this.hls=n,this.stallReported=!1}return GapController.prototype.poll=function(e,t){var r=this.config,i=this.media,a=i.currentTime,s=window.performance.now();if(a!==e)return this.stallReported&&(o.logger.warn("playback not stuck anymore @"+a+", after "+Math.round(s-this.stalled)+"ms"),this.stallReported=!1),this.stalled=null,void(this.nudgeRetry=0);if(!(i.ended||!i.buffered.length||i.readyState>2)&&(!i.seeking||!n.BufferHelper.isBuffered(i,a))){var u=s-this.stalled,l=n.BufferHelper.bufferInfo(i,a,r.maxBufferHole);this.stalled?(u>=1e3&&this._reportStall(l.len),this._tryFixBufferStall(l,u)):this.stalled=s}},GapController.prototype._tryFixBufferStall=function(e,t){var r=this.config,n=this.fragmentTracker,i=this.media.currentTime,a=n.getPartialFragment(i);a&&this._trySkipBufferHole(a),e.len>.5&&t>1e3*r.highBufferWatchdogPeriod&&(this.stalled=null,this._tryNudgeBuffer())},GapController.prototype._reportStall=function(e){var t=this.hls,r=this.media;this.stallReported||(this.stallReported=!0,o.logger.warn("Playback stalling at @"+r.currentTime+" due to low buffer"),t.trigger(a.default.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:e}))},GapController.prototype._trySkipBufferHole=function(e){for(var t=this.hls,r=this.media,n=r.currentTime,s=0,u=0;u<r.buffered.length;u++){var l=r.buffered.start(u);if(n>=s&&n<l)return r.currentTime=Math.max(l,r.currentTime+.1),o.logger.warn("skipping hole, adjusting currentTime from "+n+" to "+r.currentTime),this.stalled=null,void t.trigger(a.default.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+n+" to "+r.currentTime,frag:e});s=r.buffered.end(u)}},GapController.prototype._tryNudgeBuffer=function(){var e=this.config,t=this.hls,r=this.media,n=r.currentTime,s=(this.nudgeRetry||0)+1;if(this.nudgeRetry=s,s<e.nudgeMaxRetry){var u=n+s*e.nudgeOffset;o.logger.log("adjust currentTime from "+n+" to "+u),r.currentTime=u,t.trigger(a.default.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else o.logger.error("still stuck in high buffer @"+n+" after "+e.nudgeMaxRetry+", raise fatal error"),t.trigger(a.default.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},GapController}();t.default=s},"./src/controller/id3-track-controller.js":function srcControllerId3TrackControllerJs(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function __(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(__.prototype=r.prototype,new __)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=r("./src/events.js"),a=r("./src/event-handler.js"),o=r("./src/demux/id3.js"),s=r("./src/utils/texttrack-utils.js"),u=function(e){function ID3TrackController(t){var r=e.call(this,t,i.default.MEDIA_ATTACHED,i.default.MEDIA_DETACHING,i.default.FRAG_PARSING_METADATA)||this;return r.id3Track=void 0,r.media=void 0,r}return n(ID3TrackController,e),ID3TrackController.prototype.destroy=function(){a.default.prototype.destroy.call(this)},ID3TrackController.prototype.onMediaAttached=function(e){this.media=e.media,this.media},ID3TrackController.prototype.onMediaDetaching=function(){s.clearCurrentCues(this.id3Track),this.id3Track=void 0,this.media=void 0},ID3TrackController.prototype.getID3Track=function(e){for(var t=0;t<e.length;t++){var r=e[t];if("metadata"===r.kind&&"id3"===r.label)return s.sendAddTrackEvent(r,this.media),r}return this.media.addTextTrack("metadata","id3")},ID3TrackController.prototype.onFragParsingMetadata=function(e){var t=e.frag,r=e.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var n=window.WebKitDataCue||window.VTTCue||window.TextTrackCue,i=0;i<r.length;i++){var a=o.default.getID3Frames(r[i].data);if(a){var s=r[i].pts,u=i<r.length-1?r[i+1].pts:t.endPTS;s===u&&(u+=1e-4);for(var l=0;l<a.length;l++){var c=a[l];if(!o.default.isTimeStampFrame(c)){var f=new n(s,u,"");f.value=c,this.id3Track.addCue(f)}}}}},ID3TrackController}(a.default);t.default=u},"./src/controller/level-controller.js":function srcControllerLevelControllerJs(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function __(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(__.prototype=r.prototype,new __)}}();Object.defineProperty(t,"__esModule",{value:!0});var i,a=r("./src/events.js"),o=r("./src/event-handler.js"),s=r("./src/utils/logger.js"),u=r("./src/errors.js"),l=r("./src/utils/codecs.js"),c=r("./src/controller/level-helper.js"),f=(window.performance,function(e){function LevelController(t){var r=e.call(this,t,a.default.MANIFEST_LOADED,a.default.LEVEL_LOADED,a.default.AUDIO_TRACK_SWITCHED,a.default.FRAG_LOADED,a.default.ERROR)||this;return r.canload=!1,r.currentLevelIndex=null,r.manualLevelIndex=-1,r.timer=null,i=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),r}return n(LevelController,e),LevelController.prototype.onHandlerDestroying=function(){this.clearTimer(),this.manualLevelIndex=-1},LevelController.prototype.clearTimer=function(){null!==this.timer&&(clearTimeout(this.timer),this.timer=null)},LevelController.prototype.startLoad=function(){var e=this._levels;this.canload=!0,this.levelRetryCount=0,e&&e.forEach((function(e){e.loadError=0;var t=e.details;t&&t.live&&(e.details=void 0)})),null!==this.timer&&this.loadLevel()},LevelController.prototype.stopLoad=function(){this.canload=!1},LevelController.prototype.onManifestLoaded=function(e){var t,r=[],n=[],o={},f=null,d=!1,h=!1;if(e.levels.forEach((function(e){var t=e.attrs;e.loadError=0,e.fragmentError=!1,d=d||!!e.videoCodec,h=h||!!e.audioCodec,i&&e.audioCodec&&-1!==e.audioCodec.indexOf("mp4a.40.34")&&(e.audioCodec=void 0),(f=o[e.bitrate])?f.url.push(e.url):(e.url=[e.url],e.urlId=0,o[e.bitrate]=e,r.push(e)),t&&(t.AUDIO&&(h=!0,c.addGroupId(f||e,"audio",t.AUDIO)),t.SUBTITLES&&c.addGroupId(f||e,"text",t.SUBTITLES))})),d&&h&&(r=r.filter((function(e){return!!e.videoCodec}))),r=r.filter((function(e){var t=e.audioCodec,r=e.videoCodec;return(!t||l.isCodecSupportedInMp4(t,"audio"))&&(!r||l.isCodecSupportedInMp4(r,"video"))})),e.audioTracks&&(n=e.audioTracks.filter((function(e){return!e.audioCodec||l.isCodecSupportedInMp4(e.audioCodec,"audio")}))).forEach((function(e,t){e.id=t})),r.length>0){t=r[0].bitrate,r.sort((function(e,t){return e.bitrate-t.bitrate})),this._levels=r;for(var p=0;p<r.length;p++)if(r[p].bitrate===t){this._firstLevel=p,s.logger.log("manifest loaded,"+r.length+" level(s) found, first bitrate:"+t);break}this.hls.trigger(a.default.MANIFEST_PARSED,{levels:r,audioTracks:n,firstLevel:this._firstLevel,stats:e.stats,audio:h,video:d,altAudio:n.some((function(e){return!!e.url}))})}else this.hls.trigger(a.default.ERROR,{type:u.ErrorTypes.MEDIA_ERROR,details:u.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:this.hls.url,reason:"no level with compatible codecs found in manifest"})},Object.defineProperty(LevelController.prototype,"levels",{get:function get(){return this._levels},enumerable:!0,configurable:!0}),Object.defineProperty(LevelController.prototype,"level",{get:function get(){return this.currentLevelIndex},set:function set(e){var t=this._levels;t&&(e=Math.min(e,t.length-1),this.currentLevelIndex===e&&t[e].details||this.setLevelInternal(e))},enumerable:!0,configurable:!0}),LevelController.prototype.setLevelInternal=function(e){var t=this._levels,r=this.hls;if(e>=0&&e<t.length){if(this.clearTimer(),this.currentLevelIndex!==e){s.logger.log("switching to level "+e),this.currentLevelIndex=e;var n=t[e];n.level=e,r.trigger(a.default.LEVEL_SWITCHING,n)}var i=t[e],o=i.details;if(!o||o.live){var l=i.urlId;r.trigger(a.default.LEVEL_LOADING,{url:i.url[l],level:e,id:l})}}else r.trigger(a.default.ERROR,{type:u.ErrorTypes.OTHER_ERROR,details:u.ErrorDetails.LEVEL_SWITCH_ERROR,level:e,fatal:!1,reason:"invalid level idx"})},Object.defineProperty(LevelController.prototype,"manualLevel",{get:function get(){return this.manualLevelIndex},set:function set(e){this.manualLevelIndex=e,void 0===this._startLevel&&(this._startLevel=e),-1!==e&&(this.level=e)},enumerable:!0,configurable:!0}),Object.defineProperty(LevelController.prototype,"firstLevel",{get:function get(){return this._firstLevel},set:function set(e){this._firstLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(LevelController.prototype,"startLevel",{get:function get(){if(void 0===this._startLevel){var e=this.hls.config.startLevel;return void 0!==e?e:this._firstLevel}return this._startLevel},set:function set(e){this._startLevel=e},enumerable:!0,configurable:!0}),LevelController.prototype.onError=function(e){if(e.fatal)e.type===u.ErrorTypes.NETWORK_ERROR&&this.clearTimer();else{var t,r=!1,n=!1;switch(e.details){case u.ErrorDetails.FRAG_LOAD_ERROR:case u.ErrorDetails.FRAG_LOAD_TIMEOUT:case u.ErrorDetails.KEY_LOAD_ERROR:case u.ErrorDetails.KEY_LOAD_TIMEOUT:t=e.frag.level,n=!0;break;case u.ErrorDetails.LEVEL_LOAD_ERROR:case u.ErrorDetails.LEVEL_LOAD_TIMEOUT:t=e.context.level,r=!0;break;case u.ErrorDetails.REMUX_ALLOC_ERROR:t=e.level,r=!0}void 0!==t&&this.recoverLevel(e,t,r,n)}},LevelController.prototype.recoverLevel=function(e,t,r,n){var i,a,o,u=this,l=this.hls.config,c=e.details,f=this._levels[t];if(f.loadError++,f.fragmentError=n,r){if(!(this.levelRetryCount+1<=l.levelLoadingMaxRetry))return s.logger.error("level controller, cannot recover from "+c+" error"),this.currentLevelIndex=null,this.clearTimer(),void(e.fatal=!0);a=Math.min(Math.pow(2,this.levelRetryCount)*l.levelLoadingRetryDelay,l.levelLoadingMaxRetryTimeout),this.timer=setTimeout((function(){return u.loadLevel()}),a),e.levelRetry=!0,this.levelRetryCount++,s.logger.warn("level controller, "+c+", retry in "+a+" ms, current retry count is "+this.levelRetryCount)}(r||n)&&((i=f.url.length)>1&&f.loadError<i?(f.urlId=(f.urlId+1)%i,f.details=void 0,s.logger.warn("level controller, "+c+" for level "+t+": switching to redundant URL-id "+f.urlId)):-1===this.manualLevelIndex?(o=0===t?this._levels.length-1:t-1,s.logger.warn("level controller, "+c+": switch to "+o),this.hls.nextAutoLevel=this.currentLevelIndex=o):n&&(s.logger.warn("level controller, "+c+": reload a fragment"),this.currentLevelIndex=null))},LevelController.prototype.onFragLoaded=function(e){var t=e.frag;if(void 0!==t&&"main"===t.type){var r=this._levels[t.level];void 0!==r&&(r.fragmentError=!1,r.loadError=0,this.levelRetryCount=0)}},LevelController.prototype.onLevelLoaded=function(e){var t=this,r=e.level,n=e.details;if(r===this.currentLevelIndex){var i=this._levels[r];if(i.fragmentError||(i.loadError=0,this.levelRetryCount=0),n.live){var a=c.computeReloadInterval(i.details,n,e.stats.trequest);s.logger.log("live playlist, reload in "+Math.round(a)+" ms"),this.timer=setTimeout((function(){return t.loadLevel()}),a)}else this.clearTimer()}},LevelController.prototype.onAudioTrackSwitched=function(e){var t=this.hls.audioTracks[e.id].groupId,r=this.hls.levels[this.currentLevelIndex];if(r&&r.audioGroupIds){for(var n=-1,i=0;i<r.audioGroupIds.length;i++)if(r.audioGroupIds[i]===t){n=i;break}n!==r.urlId&&(r.urlId=n,this.startLoad())}},LevelController.prototype.loadLevel=function(){if(s.logger.debug("call to loadLevel"),null!==this.currentLevelIndex&&this.canload){var e=this._levels[this.currentLevelIndex];if("object"===typeof e&&e.url.length>0){var t=this.currentLevelIndex,r=e.urlId,n=e.url[r];s.logger.log("Attempt loading level index "+t+" with URL-id "+r),this.hls.trigger(a.default.LEVEL_LOADING,{url:n,level:t,id:r})}}},Object.defineProperty(LevelController.prototype,"nextLoadLevel",{get:function get(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel},set:function set(e){this.level=e,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=e)},enumerable:!0,configurable:!0}),LevelController}(o.default));t.default=f},"./src/controller/level-helper.js":function srcControllerLevelHelperJs(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r("./src/utils/logger.js");function updatePTS(t,r,i){var a=t[r],o=t[i],s=o.startPTS;e.isFinite(s)?i>r?(a.duration=s-a.start,a.duration<0&&n.logger.warn("negative duration computed for frag "+a.sn+",level "+a.level+", there should be some duration drift between playlist and fragment!")):(o.duration=a.start-s,o.duration<0&&n.logger.warn("negative duration computed for frag "+o.sn+",level "+o.level+", there should be some duration drift between playlist and fragment!")):o.start=i>r?a.start+a.duration:Math.max(a.start-o.duration,0)}function updateFragPTSDTS(t,r,n,i,a,o){var s=n;if(e.isFinite(r.startPTS)){var u=Math.abs(r.startPTS-n);e.isFinite(r.deltaPTS)?r.deltaPTS=Math.max(u,r.deltaPTS):r.deltaPTS=u,s=Math.max(n,r.startPTS),n=Math.min(n,r.startPTS),i=Math.max(i,r.endPTS),a=Math.min(a,r.startDTS),o=Math.max(o,r.endDTS)}var l=n-r.start;r.start=r.startPTS=n,r.maxStartPTS=s,r.endPTS=i,r.startDTS=a,r.endDTS=o,r.duration=i-n;var c,f,d,h=r.sn;if(!t||h<t.startSN||h>t.endSN)return 0;for(c=h-t.startSN,(f=t.fragments)[c]=r,d=c;d>0;d--)updatePTS(f,d,d-1);for(d=c;d<f.length-1;d++)updatePTS(f,d,d+1);return t.PTSKnown=!0,l}function mapFragmentIntersection(e,t,r){if(e&&t)for(var n=Math.max(e.startSN,t.startSN)-t.startSN,i=Math.min(e.endSN,t.endSN)-t.startSN,a=t.startSN-e.startSN,o=n;o<=i;o++){var s=e.fragments[a+o],u=t.fragments[o];if(!s||!u)break;r(s,u,o)}}function adjustSliding(e,t){var r=t.startSN-e.startSN,n=e.fragments,i=t.fragments;if(!(r<0||r>n.length))for(var a=0;a<i.length;a++)i[a].start+=n[r].start}t.addGroupId=function addGroupId(e,t,r){switch(t){case"audio":e.audioGroupIds||(e.audioGroupIds=[]),e.audioGroupIds.push(r);break;case"text":e.textGroupIds||(e.textGroupIds=[]),e.textGroupIds.push(r)}},t.updatePTS=updatePTS,t.updateFragPTSDTS=updateFragPTSDTS,t.mergeDetails=function mergeDetails(t,r){r.initSegment&&t.initSegment&&(r.initSegment=t.initSegment);var i,a=0;if(mapFragmentIntersection(t,r,(function(t,n){a=t.cc-n.cc,e.isFinite(t.startPTS)&&(n.start=n.startPTS=t.startPTS,n.endPTS=t.endPTS,n.duration=t.duration,n.backtracked=t.backtracked,n.dropped=t.dropped,i=n),r.PTSKnown=!0})),r.PTSKnown){if(a){n.logger.log("discontinuity sliding from playlist, take drift into account");for(var o=r.fragments,s=0;s<o.length;s++)o[s].cc+=a}i?updateFragPTSDTS(r,i,i.startPTS,i.endPTS,i.startDTS,i.endDTS):adjustSliding(t,r),r.PTSKnown=t.PTSKnown}},t.mergeSubtitlePlaylists=function mergeSubtitlePlaylists(e,t,r){void 0===r&&(r=0);var n=-1;mapFragmentIntersection(e,t,(function(e,t,r){t.start=e.start,n=r}));var i=t.fragments;if(n<0)i.forEach((function(e){e.start+=r}));else for(var a=n+1;a<i.length;a++)i[a].start=i[a-1].start+i[a-1].duration},t.mapFragmentIntersection=mapFragmentIntersection,t.adjustSliding=adjustSliding,t.computeReloadInterval=function computeReloadInterval(e,t,r){var n=1e3*(t.averagetargetduration?t.averagetargetduration:t.targetduration),i=n/2;return e&&t.endSN===e.endSN&&(n=i),r&&(n=Math.max(i,n-(window.performance.now()-r))),Math.round(n)}}).call(this,r("./src/polyfills/number.js").Number)},"./src/controller/stream-controller.js":function srcControllerStreamControllerJs(e,t,r){"use strict";(function(e){var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function __(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(__.prototype=r.prototype,new __)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=r("./src/utils/binary-search.js"),a=r("./src/utils/buffer-helper.js"),o=r("./src/demux/demuxer.js"),s=r("./src/events.js"),u=r("./src/controller/fragment-tracker.js"),l=r("./src/loader/fragment.js"),c=r("./src/loader/playlist-loader.js"),f=r("./src/controller/level-helper.js"),d=r("./src/utils/time-ranges.js"),h=r("./src/errors.js"),p=r("./src/utils/logger.js"),g=r("./src/utils/discontinuities.js"),m=r("./src/controller/fragment-finders.js"),v=r("./src/controller/gap-controller.js"),y=r("./src/controller/base-stream-controller.js"),_=function(t){function StreamController(e,r){var n=t.call(this,e,s.default.MEDIA_ATTACHED,s.default.MEDIA_DETACHING,s.default.MANIFEST_LOADING,s.default.MANIFEST_PARSED,s.default.LEVEL_LOADED,s.default.KEY_LOADED,s.default.FRAG_LOADED,s.default.FRAG_LOAD_EMERGENCY_ABORTED,s.default.FRAG_PARSING_INIT_SEGMENT,s.default.FRAG_PARSING_DATA,s.default.FRAG_PARSED,s.default.ERROR,s.default.AUDIO_TRACK_SWITCHING,s.default.AUDIO_TRACK_SWITCHED,s.default.BUFFER_CREATED,s.default.BUFFER_APPENDED,s.default.BUFFER_FLUSHED)||this;return n.fragmentTracker=r,n.config=e.config,n.audioCodecSwap=!1,n._state=y.State.STOPPED,n.stallReported=!1,n.gapController=null,n}return n(StreamController,t),StreamController.prototype.startLoad=function(e){if(this.levels){var t=this.lastCurrentTime,r=this.hls;if(this.stopLoad(),this.setInterval(100),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var n=r.startLevel;-1===n&&(n=0,this.bitrateTest=!0),this.level=r.nextLoadLevel=n,this.loadedmetadata=!1}t>0&&-1===e&&(p.logger.log("override startPosition with lastCurrentTime @"+t.toFixed(3)),e=t),this.state=y.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this.forceStartLoad=!0,this.state=y.State.STOPPED},StreamController.prototype.stopLoad=function(){this.forceStartLoad=!1,t.prototype.stopLoad.call(this)},StreamController.prototype.doTick=function(){switch(this.state){case y.State.BUFFER_FLUSHING:this.fragLoadError=0;break;case y.State.IDLE:this._doTickIdle();break;case y.State.WAITING_LEVEL:var e=this.levels[this.level];e&&e.details&&(this.state=y.State.IDLE);break;case y.State.FRAG_LOADING_WAITING_RETRY:var t=window.performance.now(),r=this.retryDate;(!r||t>=r||this.media&&this.media.seeking)&&(p.logger.log("mediaController: retryDate reached, switch back to IDLE state"),this.state=y.State.IDLE);break;case y.State.ERROR:case y.State.STOPPED:case y.State.FRAG_LOADING:case y.State.PARSING:case y.State.PARSED:case y.State.ENDED:}this._checkBuffer(),this._checkFragmentChanged()},StreamController.prototype._doTickIdle=function(){var e=this.hls,t=e.config,r=this.media;if(void 0!==this.levelLastLoaded&&(r||!this.startFragRequested&&t.startFragPrefetch)){var n;n=this.loadedmetadata?r.currentTime:this.nextLoadPosition;var i=e.nextLoadLevel,o=this.levels[i];if(o){var u,l=o.bitrate;u=l?Math.max(8*t.maxBufferSize/l,t.maxBufferLength):t.maxBufferLength,u=Math.min(u,t.maxMaxBufferLength);var c=a.BufferHelper.bufferInfo(this.mediaBuffer?this.mediaBuffer:r,n,t.maxBufferHole),f=c.len;if(!(f>=u)){p.logger.trace("buffer length of "+f.toFixed(3)+" is below max of "+u.toFixed(3)+". checking for more payload ..."),this.level=e.nextLoadLevel=i;var d=o.details;if(!d||d.live&&this.levelLastLoaded!==i)this.state=y.State.WAITING_LEVEL;else{if(this._streamEnded(c,d)){var h={};return this.altAudio&&(h.type="video"),this.hls.trigger(s.default.BUFFER_EOS,h),void(this.state=y.State.ENDED)}this._fetchPayloadOrEos(n,c,d)}}}}},StreamController.prototype._fetchPayloadOrEos=function(e,t,r){var n=this.fragPrevious,i=this.level,a=r.fragments,o=a.length;if(0!==o){var s,u=a[0].start,l=a[o-1].start+a[o-1].duration,c=t.end;if(r.initSegment&&!r.initSegment.data)s=r.initSegment;else if(r.live){var f=this.config.initialLiveManifestSize;if(o<f)return void p.logger.warn("Can not start playback of a level, reason: not enough fragments "+o+" < "+f);if(null===(s=this._ensureFragmentAtLivePoint(r,c,u,l,n,a,o)))return}else c<u&&(s=a[0]);s||(s=this._findFragment(u,n,o,a,c,l,r)),s&&(s.encrypted?(p.logger.log("Loading key for "+s.sn+" of ["+r.startSN+" ,"+r.endSN+"],level "+i),this._loadKey(s)):(p.logger.log("Loading "+s.sn+" of ["+r.startSN+" ,"+r.endSN+"],level "+i+", currentTime:"+e.toFixed(3)+",bufferEnd:"+c.toFixed(3)),this._loadFragment(s)))}},StreamController.prototype._ensureFragmentAtLivePoint=function(e,t,r,n,a,o,s){var u,l=this.hls.config,c=this.media,f=void 0!==l.liveMaxLatencyDuration?l.liveMaxLatencyDuration:l.liveMaxLatencyDurationCount*e.targetduration;if(t<Math.max(r-l.maxFragLookUpTolerance,n-f)){var d=this.liveSyncPosition=this.computeLivePosition(r,e);p.logger.log("buffer end: "+t.toFixed(3)+" is located too far from the end of live sliding playlist, reset currentTime to : "+d.toFixed(3)),t=d,c&&c.readyState&&c.duration>d&&(c.currentTime=d),this.nextLoadPosition=d}if(e.PTSKnown&&t>n&&c&&c.readyState)return null;if(this.startFragRequested&&!e.PTSKnown){if(a)if(e.hasProgramDateTime)p.logger.log("live playlist, switching playlist, load frag with same PDT: "+a.programDateTime),u=m.findFragmentByPDT(o,a.endProgramDateTime,l.maxFragLookUpTolerance);else{var h=a.sn+1;if(h>=e.startSN&&h<=e.endSN){var g=o[h-e.startSN];a.cc===g.cc&&(u=g,p.logger.log("live playlist, switching playlist, load frag with next SN: "+u.sn))}u||(u=i.default.search(o,(function(e){return a.cc-e.cc})))&&p.logger.log("live playlist, switching playlist, load frag with same CC: "+u.sn)}u||(u=o[Math.min(s-1,Math.round(s/2))],p.logger.log("live playlist, switching playlist, unknown, load middle frag : "+u.sn))}return u},StreamController.prototype._findFragment=function(e,t,r,n,i,a,o){var s,u=this.hls.config;if(i<a){var l=i>a-u.maxFragLookUpTolerance?0:u.maxFragLookUpTolerance;s=m.findFragmentByPTS(t,n,i,l)}else s=n[r-1];if(s){var c=s.sn-o.startSN,f=t&&s.level===t.level,d=n[c-1],h=n[c+1];if(t&&s.sn===t.sn)if(f&&!s.backtracked)if(s.sn<o.endSN){var g=t.deltaPTS;g&&g>u.maxBufferHole&&t.dropped&&c?(s=d,p.logger.warn("SN just loaded, with large PTS gap between audio and video, maybe frag is not starting with a keyframe ? load previous one to try to overcome this")):(s=h,p.logger.log("SN just loaded, load next one: "+s.sn,s))}else s=null;else s.backtracked&&(h&&h.backtracked?(p.logger.warn("Already backtracked from fragment "+h.sn+", will not backtrack to fragment "+s.sn+". Loading fragment "+h.sn),s=h):(p.logger.warn("Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe"),s.dropped=0,d?(s=d).backtracked=!0:c&&(s=null)))}return s},StreamController.prototype._loadKey=function(e){this.state=y.State.KEY_LOADING,this.hls.trigger(s.default.KEY_LOADING,{frag:e})},StreamController.prototype._loadFragment=function(t){var r=this.fragmentTracker.getState(t);this.fragCurrent=t,this.startFragRequested=!0,e.isFinite(t.sn)&&!t.bitrateTest&&(this.nextLoadPosition=t.start+t.duration),t.backtracked||r===u.FragmentState.NOT_LOADED||r===u.FragmentState.PARTIAL?(t.autoLevel=this.hls.autoLevelEnabled,t.bitrateTest=this.bitrateTest,this.hls.trigger(s.default.FRAG_LOADING,{frag:t}),this.demuxer||(this.demuxer=new o.default(this.hls,"main")),this.state=y.State.FRAG_LOADING):r===u.FragmentState.APPENDING&&this._reduceMaxBufferLength(t.duration)&&this.fragmentTracker.removeFragment(t)},Object.defineProperty(StreamController.prototype,"state",{get:function get(){return this._state},set:function set(e){if(this.state!==e){var t=this.state;this._state=e,p.logger.log("main stream:"+t+"->"+e),this.hls.trigger(s.default.STREAM_STATE_TRANSITION,{previousState:t,nextState:e})}},enumerable:!0,configurable:!0}),StreamController.prototype.getBufferedFrag=function(e){return this.fragmentTracker.getBufferedFrag(e,c.default.LevelType.MAIN)},Object.defineProperty(StreamController.prototype,"currentLevel",{get:function get(){var e=this.media;if(e){var t=this.getBufferedFrag(e.currentTime);if(t)return t.level}return-1},enumerable:!0,configurable:!0}),Object.defineProperty(StreamController.prototype,"nextBufferedFrag",{get:function get(){var e=this.media;return e?this.followingBufferedFrag(this.getBufferedFrag(e.currentTime)):null},enumerable:!0,configurable:!0}),StreamController.prototype.followingBufferedFrag=function(e){return e?this.getBufferedFrag(e.endPTS+.5):null},Object.defineProperty(StreamController.prototype,"nextLevel",{get:function get(){var e=this.nextBufferedFrag;return e?e.level:-1},enumerable:!0,configurable:!0}),StreamController.prototype._checkFragmentChanged=function(){var e,t,r=this.media;if(r&&r.readyState&&!1===r.seeking&&((t=r.currentTime)>this.lastCurrentTime&&(this.lastCurrentTime=t),a.BufferHelper.isBuffered(r,t)?e=this.getBufferedFrag(t):a.BufferHelper.isBuffered(r,t+.1)&&(e=this.getBufferedFrag(t+.1)),e)){var n=e;if(n!==this.fragPlaying){this.hls.trigger(s.default.FRAG_CHANGED,{frag:n});var i=n.level;this.fragPlaying&&this.fragPlaying.level===i||this.hls.trigger(s.default.LEVEL_SWITCHED,{level:i}),this.fragPlaying=n}}},StreamController.prototype.immediateLevelSwitch=function(){if(p.logger.log("immediateLevelSwitch"),!this.immediateSwitch){this.immediateSwitch=!0;var t=this.media,r=void 0;t?(r=t.paused,t.pause()):r=!0,this.previouslyPaused=r}var n=this.fragCurrent;n&&n.loader&&n.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(0,e.POSITIVE_INFINITY)},StreamController.prototype.immediateLevelSwitchEnd=function(){var e=this.media;e&&e.buffered.length&&(this.immediateSwitch=!1,a.BufferHelper.isBuffered(e,e.currentTime)&&(e.currentTime-=1e-4),this.previouslyPaused||e.play())},StreamController.prototype.nextLevelSwitch=function(){var t=this.media;if(t&&t.readyState){var r,n=void 0,i=void 0;if((r=this.getBufferedFrag(t.currentTime))&&r.startPTS>1&&this.flushMainBuffer(0,r.startPTS-1),t.paused)n=0;else{var a=this.hls.nextLoadLevel,o=this.levels[a],s=this.fragLastKbps;n=s&&this.fragCurrent?this.fragCurrent.duration*o.bitrate/(1e3*s)+1:0}if((i=this.getBufferedFrag(t.currentTime+n))&&(i=this.followingBufferedFrag(i))){var u=this.fragCurrent;u&&u.loader&&u.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(i.maxStartPTS,e.POSITIVE_INFINITY)}}},StreamController.prototype.flushMainBuffer=function(e,t){this.state=y.State.BUFFER_FLUSHING;var r={startOffset:e,endOffset:t};this.altAudio&&(r.type="video"),this.hls.trigger(s.default.BUFFER_FLUSHING,r)},StreamController.prototype.onMediaAttached=function(e){var t=this.media=this.mediaBuffer=e.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),this.onvended=this.onMediaEnded.bind(this),t.addEventListener("seeking",this.onvseeking),t.addEventListener("seeked",this.onvseeked),t.addEventListener("ended",this.onvended);var r=this.config;this.levels&&r.autoStartLoad&&this.hls.startLoad(r.startPosition),this.gapController=new v.default(r,t,this.fragmentTracker,this.hls)},StreamController.prototype.onMediaDetaching=function(){var e=this.media;e&&e.ended&&(p.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var t=this.levels;t&&t.forEach((function(e){e.details&&e.details.fragments.forEach((function(e){e.backtracked=void 0}))})),e&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("seeked",this.onvseeked),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.stopLoad()},StreamController.prototype.onMediaSeeked=function(){var t=this.media,r=t?t.currentTime:void 0;e.isFinite(r)&&p.logger.log("media seeked to "+r.toFixed(3)),this.tick()},StreamController.prototype.onManifestLoading=function(){p.logger.log("trigger BUFFER_RESET"),this.hls.trigger(s.default.BUFFER_RESET),this.fragmentTracker.removeAllFragments(),this.stalled=!1,this.startPosition=this.lastCurrentTime=0},StreamController.prototype.onManifestParsed=function(e){var t,r=!1,n=!1;e.levels.forEach((function(e){(t=e.audioCodec)&&(-1!==t.indexOf("mp4a.40.2")&&(r=!0),-1!==t.indexOf("mp4a.40.5")&&(n=!0))})),this.audioCodecSwitch=r&&n,this.audioCodecSwitch&&p.logger.log("both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=e.levels,this.startFragRequested=!1;var i=this.config;(i.autoStartLoad||this.forceStartLoad)&&this.hls.startLoad(i.startPosition)},StreamController.prototype.onLevelLoaded=function(t){var r=t.details,n=t.level,i=this.levels[this.levelLastLoaded],a=this.levels[n],o=r.totalduration,u=0;if(p.logger.log("level "+n+" loaded ["+r.startSN+","+r.endSN+"],duration:"+o),r.live){var l=a.details;l&&r.fragments.length>0?(f.mergeDetails(l,r),u=r.fragments[0].start,this.liveSyncPosition=this.computeLivePosition(u,l),r.PTSKnown&&e.isFinite(u)?p.logger.log("live playlist sliding:"+u.toFixed(3)):(p.logger.log("live playlist - outdated PTS, unknown sliding"),g.alignStream(this.fragPrevious,i,r))):(p.logger.log("live playlist - first load, unknown sliding"),r.PTSKnown=!1,g.alignStream(this.fragPrevious,i,r))}else r.PTSKnown=!1;if(a.details=r,this.levelLastLoaded=n,this.hls.trigger(s.default.LEVEL_UPDATED,{details:r,level:n}),!1===this.startFragRequested){if(-1===this.startPosition||-1===this.lastCurrentTime){var c=r.startTimeOffset;e.isFinite(c)?(c<0&&(p.logger.log("negative start time offset "+c+", count from end of last fragment"),c=u+o+c),p.logger.log("start time offset found in playlist, adjust startPosition to "+c),this.startPosition=c):r.live?(this.startPosition=this.computeLivePosition(u,r),p.logger.log("configure startPosition to "+this.startPosition)):this.startPosition=0,this.lastCurrentTime=this.startPosition}this.nextLoadPosition=this.startPosition}this.state===y.State.WAITING_LEVEL&&(this.state=y.State.IDLE),this.tick()},StreamController.prototype.onKeyLoaded=function(){this.state===y.State.KEY_LOADING&&(this.state=y.State.IDLE,this.tick())},StreamController.prototype.onFragLoaded=function(e){var t=this.fragCurrent,r=this.hls,n=this.levels,i=this.media,a=e.frag;if(this.state===y.State.FRAG_LOADING&&t&&"main"===a.type&&a.level===t.level&&a.sn===t.sn){var u=e.stats,l=n[t.level],c=l.details;if(this.bitrateTest=!1,this.stats=u,p.logger.log("Loaded "+t.sn+" of ["+c.startSN+" ,"+c.endSN+"],level "+t.level),a.bitrateTest&&r.nextLoadLevel)this.state=y.State.IDLE,this.startFragRequested=!1,u.tparsed=u.tbuffered=window.performance.now(),r.trigger(s.default.FRAG_BUFFERED,{stats:u,frag:t,id:"main"}),this.tick();else if("initSegment"===a.sn)this.state=y.State.IDLE,u.tparsed=u.tbuffered=window.performance.now(),c.initSegment.data=e.payload,r.trigger(s.default.FRAG_BUFFERED,{stats:u,frag:t,id:"main"}),this.tick();else{p.logger.log("Parsing "+t.sn+" of ["+c.startSN+" ,"+c.endSN+"],level "+t.level+", cc "+t.cc),this.state=y.State.PARSING,this.pendingBuffering=!0,this.appended=!1,a.bitrateTest&&(a.bitrateTest=!1,this.fragmentTracker.onFragLoaded({frag:a}));var f=!(i&&i.seeking)&&(c.PTSKnown||!c.live),d=c.initSegment?c.initSegment.data:[],h=this._getAudioCodec(l);(this.demuxer=this.demuxer||new o.default(this.hls,"main")).push(e.payload,d,h,l.videoCodec,t,c.totalduration,f)}}this.fragLoadError=0},StreamController.prototype.onFragParsingInitSegment=function(e){var t=this.fragCurrent,r=e.frag;if(t&&"main"===e.id&&r.sn===t.sn&&r.level===t.level&&this.state===y.State.PARSING){var n=e.tracks,i=void 0,a=void 0;if(n.audio&&this.altAudio&&delete n.audio,a=n.audio){var o=this.levels[this.level].audioCodec,u=navigator.userAgent.toLowerCase();o&&this.audioCodecSwap&&(p.logger.log("swapping playlist audio codec"),o=-1!==o.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),this.audioCodecSwitch&&1!==a.metadata.channelCount&&-1===u.indexOf("firefox")&&(o="mp4a.40.5"),-1!==u.indexOf("android")&&"audio/mpeg"!==a.container&&(o="mp4a.40.2",p.logger.log("Android: force audio codec to "+o)),a.levelCodec=o,a.id=e.id}for(i in(a=n.video)&&(a.levelCodec=this.levels[this.level].videoCodec,a.id=e.id),this.hls.trigger(s.default.BUFFER_CODECS,n),n){a=n[i],p.logger.log("main track:"+i+",container:"+a.container+",codecs[level/parsed]=["+a.levelCodec+"/"+a.codec+"]");var l=a.initSegment;l&&(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(s.default.BUFFER_APPENDING,{type:i,data:l,parent:"main",content:"initSegment"}))}this.tick()}},StreamController.prototype.onFragParsingData=function(t){var r=this,n=this.fragCurrent,i=t.frag;if(n&&"main"===t.id&&i.sn===n.sn&&i.level===n.level&&("audio"!==t.type||!this.altAudio)&&this.state===y.State.PARSING){var a=this.levels[this.level],o=n;if(e.isFinite(t.endPTS)||(t.endPTS=t.startPTS+n.duration,t.endDTS=t.startDTS+n.duration),!0===t.hasAudio&&o.addElementaryStream(l.default.ElementaryStreamTypes.AUDIO),!0===t.hasVideo&&o.addElementaryStream(l.default.ElementaryStreamTypes.VIDEO),p.logger.log("Parsed "+t.type+",PTS:["+t.startPTS.toFixed(3)+","+t.endPTS.toFixed(3)+"],DTS:["+t.startDTS.toFixed(3)+"/"+t.endDTS.toFixed(3)+"],nb:"+t.nb+",dropped:"+(t.dropped||0)),"video"===t.type)if(o.dropped=t.dropped,o.dropped)if(o.backtracked)p.logger.warn("Already backtracked on this fragment, appending with the gap",o.sn);else{var u=a.details;if(!u||o.sn!==u.startSN)return p.logger.warn("missing video frame(s), backtracking fragment",o.sn),this.fragmentTracker.removeFragment(o),o.backtracked=!0,this.nextLoadPosition=t.startPTS,this.state=y.State.IDLE,this.fragPrevious=o,void this.tick();p.logger.warn("missing video frame(s) on first frag, appending with gap",o.sn)}else o.backtracked=!1;var c=f.updateFragPTSDTS(a.details,o,t.startPTS,t.endPTS,t.startDTS,t.endDTS),d=this.hls;d.trigger(s.default.LEVEL_PTS_UPDATED,{details:a.details,level:this.level,drift:c,type:t.type,start:t.startPTS,end:t.endPTS}),[t.data1,t.data2].forEach((function(e){e&&e.length&&r.state===y.State.PARSING&&(r.appended=!0,r.pendingBuffering=!0,d.trigger(s.default.BUFFER_APPENDING,{type:t.type,data:e,parent:"main",content:"data"}))})),this.tick()}},StreamController.prototype.onFragParsed=function(e){var t=this.fragCurrent,r=e.frag;t&&"main"===e.id&&r.sn===t.sn&&r.level===t.level&&this.state===y.State.PARSING&&(this.stats.tparsed=window.performance.now(),this.state=y.State.PARSED,this._checkAppendedParsed())},StreamController.prototype.onAudioTrackSwitching=function(t){var r=!!t.url,n=t.id;if(!r){if(this.mediaBuffer!==this.media){p.logger.log("switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var i=this.fragCurrent;i.loader&&(p.logger.log("switching to main audio track, cancel main fragment load"),i.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=y.State.IDLE}var a=this.hls;a.trigger(s.default.BUFFER_FLUSHING,{startOffset:0,endOffset:e.POSITIVE_INFINITY,type:"audio"}),a.trigger(s.default.AUDIO_TRACK_SWITCHED,{id:n}),this.altAudio=!1}},StreamController.prototype.onAudioTrackSwitched=function(e){var t=e.id,r=!!this.hls.audioTracks[t].url;if(r){var n=this.videoBuffer;n&&this.mediaBuffer!==n&&(p.logger.log("switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=n)}this.altAudio=r,this.tick()},StreamController.prototype.onBufferCreated=function(e){var t,r,n=e.tracks,i=!1;for(var a in n){var o=n[a];"main"===o.id?(r=a,t=o,"video"===a&&(this.videoBuffer=n[a].buffer)):i=!0}i&&t?(p.logger.log("alternate track found, use "+r+".buffered to schedule main fragment loading"),this.mediaBuffer=t.buffer):this.mediaBuffer=this.media},StreamController.prototype.onBufferAppended=function(e){if("main"===e.parent){var t=this.state;t!==y.State.PARSING&&t!==y.State.PARSED||(this.pendingBuffering=e.pending>0,this._checkAppendedParsed())}},StreamController.prototype._checkAppendedParsed=function(){if(this.state===y.State.PARSED&&(!this.appended||!this.pendingBuffering)){var e=this.fragCurrent;if(e){var t=this.mediaBuffer?this.mediaBuffer:this.media;p.logger.log("main buffered : "+d.default.toString(t.buffered)),this.fragPrevious=e;var r=this.stats;r.tbuffered=window.performance.now(),this.fragLastKbps=Math.round(8*r.total/(r.tbuffered-r.tfirst)),this.hls.trigger(s.default.FRAG_BUFFERED,{stats:r,frag:e,id:"main"}),this.state=y.State.IDLE}this.tick()}},StreamController.prototype.onError=function(t){var r=t.frag||this.fragCurrent;if(!r||"main"===r.type){var n=!!this.media&&a.BufferHelper.isBuffered(this.media,this.media.currentTime)&&a.BufferHelper.isBuffered(this.media,this.media.currentTime+.5);switch(t.details){case h.ErrorDetails.FRAG_LOAD_ERROR:case h.ErrorDetails.FRAG_LOAD_TIMEOUT:case h.ErrorDetails.KEY_LOAD_ERROR:case h.ErrorDetails.KEY_LOAD_TIMEOUT:if(!t.fatal)if(this.fragLoadError+1<=this.config.fragLoadingMaxRetry){var i=Math.min(Math.pow(2,this.fragLoadError)*this.config.fragLoadingRetryDelay,this.config.fragLoadingMaxRetryTimeout);p.logger.warn("mediaController: frag loading failed, retry in "+i+" ms"),this.retryDate=window.performance.now()+i,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.fragLoadError++,this.state=y.State.FRAG_LOADING_WAITING_RETRY}else p.logger.error("mediaController: "+t.details+" reaches max retry, redispatch as fatal ..."),t.fatal=!0,this.state=y.State.ERROR;break;case h.ErrorDetails.LEVEL_LOAD_ERROR:case h.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==y.State.ERROR&&(t.fatal?(this.state=y.State.ERROR,p.logger.warn("streamController: "+t.details+",switch to "+this.state+" state ...")):t.levelRetry||this.state!==y.State.WAITING_LEVEL||(this.state=y.State.IDLE));break;case h.ErrorDetails.BUFFER_FULL_ERROR:"main"!==t.parent||this.state!==y.State.PARSING&&this.state!==y.State.PARSED||(n?(this._reduceMaxBufferLength(this.config.maxBufferLength),this.state=y.State.IDLE):(p.logger.warn("buffer full error also media.currentTime is not buffered, flush everything"),this.fragCurrent=null,this.flushMainBuffer(0,e.POSITIVE_INFINITY)))}}},StreamController.prototype._reduceMaxBufferLength=function(e){var t=this.config;return t.maxMaxBufferLength>=e&&(t.maxMaxBufferLength/=2,p.logger.warn("main:reduce max buffer length to "+t.maxMaxBufferLength+"s"),!0)},StreamController.prototype._checkBuffer=function(){var e=this.media;if(e&&0!==e.readyState){var t=(this.mediaBuffer?this.mediaBuffer:e).buffered;!this.loadedmetadata&&t.length?(this.loadedmetadata=!0,this._seekToStartPos()):this.immediateSwitch?this.immediateLevelSwitchEnd():this.gapController.poll(this.lastCurrentTime,t)}},StreamController.prototype.onFragLoadEmergencyAborted=function(){this.state=y.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tick()},StreamController.prototype.onBufferFlushed=function(){var e=this.mediaBuffer?this.mediaBuffer:this.media;e&&this.fragmentTracker.detectEvictedFragments(l.default.ElementaryStreamTypes.VIDEO,e.buffered),this.state=y.State.IDLE,this.fragPrevious=null},StreamController.prototype.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},StreamController.prototype.computeLivePosition=function(e,t){var r=void 0!==this.config.liveSyncDuration?this.config.liveSyncDuration:this.config.liveSyncDurationCount*t.targetduration;return e+Math.max(0,t.totalduration-r)},StreamController.prototype._seekToStartPos=function(){var e=this.media,t=e.currentTime,r=e.seeking?t:this.startPosition;t!==r&&(p.logger.log("target start position not buffered, seek to buffered.start(0) "+r+" from current time "+t+" "),e.currentTime=r)},StreamController.prototype._getAudioCodec=function(e){var t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&(p.logger.log("swapping playlist audio codec"),t&&(t=-1!==t.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5")),t},Object.defineProperty(StreamController.prototype,"liveSyncPosition",{get:function get(){return this._liveSyncPosition},set:function set(e){this._liveSyncPosition=e},enumerable:!0,configurable:!0}),StreamController}(y.default);t.default=_}).call(this,r("./src/polyfills/number.js").Number)},"./src/controller/subtitle-stream-controller.js":function srcControllerSubtitleStreamControllerJs(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function __(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(__.prototype=r.prototype,new __)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=r("./src/events.js"),a=r("./src/utils/logger.js"),o=r("./src/crypt/decrypter.js"),s=r("./src/utils/buffer-helper.js"),u=r("./src/controller/fragment-finders.js"),l=r("./src/controller/fragment-tracker.js"),c=r("./src/controller/base-stream-controller.js"),f=r("./src/controller/level-helper.js"),d=window.performance,h=function(e){function SubtitleStreamController(t,r){var n=e.call(this,t,i.default.MEDIA_ATTACHED,i.default.MEDIA_DETACHING,i.default.ERROR,i.default.KEY_LOADED,i.default.FRAG_LOADED,i.default.SUBTITLE_TRACKS_UPDATED,i.default.SUBTITLE_TRACK_SWITCH,i.default.SUBTITLE_TRACK_LOADED,i.default.SUBTITLE_FRAG_PROCESSED,i.default.LEVEL_UPDATED)||this;return n.fragmentTracker=r,n.config=t.config,n.state=c.State.STOPPED,n.tracks=[],n.tracksBuffered=[],n.currentTrackId=-1,n.decrypter=new o.default(t,t.config),n.lastAVStart=0,n._onMediaSeeking=n.onMediaSeeking.bind(n),n}return n(SubtitleStreamController,e),SubtitleStreamController.prototype.onSubtitleFragProcessed=function(e){var t=e.frag,r=e.success;if(this.fragPrevious=t,this.state=c.State.IDLE,r){var n=this.tracksBuffered[this.currentTrackId];if(n){for(var i,a=t.start,o=0;o<n.length;o++)if(a>=n[o].start&&a<=n[o].end){i=n[o];break}var s=t.start+t.duration;i?i.end=s:(i={start:a,end:s},n.push(i))}}},SubtitleStreamController.prototype.onMediaAttached=function(e){var t=e.media;this.media=t,t.addEventListener("seeking",this._onMediaSeeking),this.state=c.State.IDLE},SubtitleStreamController.prototype.onMediaDetaching=function(){this.media.removeEventListener("seeking",this._onMediaSeeking),this.media=null,this.state=c.State.STOPPED},SubtitleStreamController.prototype.onError=function(e){var t=e.frag;t&&"subtitle"===t.type&&(this.state=c.State.IDLE)},SubtitleStreamController.prototype.onSubtitleTracksUpdated=function(e){var t=this;a.logger.log("subtitle tracks updated"),this.tracksBuffered=[],this.tracks=e.subtitleTracks,this.tracks.forEach((function(e){t.tracksBuffered[e.id]=[]}))},SubtitleStreamController.prototype.onSubtitleTrackSwitch=function(e){if(this.currentTrackId=e.id,this.tracks&&-1!==this.currentTrackId){var t=this.tracks[this.currentTrackId];t&&t.details&&this.setInterval(500)}else this.clearInterval()},SubtitleStreamController.prototype.onSubtitleTrackLoaded=function(e){var t=e.id,r=e.details,n=this.currentTrackId,i=this.tracks,a=i[n];t>=i.length||t!==n||!a||(r.live&&f.mergeSubtitlePlaylists(a.details,r,this.lastAVStart),a.details=r,this.setInterval(500))},SubtitleStreamController.prototype.onKeyLoaded=function(){this.state===c.State.KEY_LOADING&&(this.state=c.State.IDLE)},SubtitleStreamController.prototype.onFragLoaded=function(e){var t=this.fragCurrent,r=e.frag.decryptdata,n=e.frag,a=this.hls;if(this.state===c.State.FRAG_LOADING&&t&&"subtitle"===e.frag.type&&t.sn===e.frag.sn&&e.payload.byteLength>0&&r&&r.key&&"AES-128"===r.method){var o=d.now();this.decrypter.decrypt(e.payload,r.key.buffer,r.iv.buffer,(function(e){var t=d.now();a.trigger(i.default.FRAG_DECRYPTED,{frag:n,payload:e,stats:{tstart:o,tdecrypt:t}})}))}},SubtitleStreamController.prototype.onLevelUpdated=function(e){var t=e.details.fragments;this.lastAVStart=t.length?t[0].start:0},SubtitleStreamController.prototype.doTick=function(){if(this.media)switch(this.state){case c.State.IDLE:var e=this,t=e.config,r=e.currentTrackId,n=e.fragmentTracker,o=e.media,f=e.tracks;if(!f||!f[r]||!f[r].details)break;var d=t.maxBufferHole,h=t.maxFragLookUpTolerance,p=Math.min(t.maxBufferLength,t.maxMaxBufferLength),g=s.BufferHelper.bufferedInfo(this._getBuffered(),o.currentTime,d),m=g.end,v=g.len,y=f[r].details,_=y.fragments,b=_.length,x=_[b-1].start+_[b-1].duration;if(v>p)return;var w=void 0,k=this.fragPrevious;m<x?(k&&y.hasProgramDateTime&&(w=u.findFragmentByPDT(_,k.endProgramDateTime,h)),w||(w=u.findFragmentByPTS(k,_,m,h))):w=_[b-1],w&&w.encrypted?(a.logger.log("Loading key for "+w.sn),this.state=c.State.KEY_LOADING,this.hls.trigger(i.default.KEY_LOADING,{frag:w})):w&&n.getState(w)===l.FragmentState.NOT_LOADED&&(this.fragCurrent=w,this.state=c.State.FRAG_LOADING,this.hls.trigger(i.default.FRAG_LOADING,{frag:w}))}else this.state=c.State.IDLE},SubtitleStreamController.prototype.stopLoad=function(){this.lastAVStart=0,e.prototype.stopLoad.call(this)},SubtitleStreamController.prototype._getBuffered=function(){return this.tracksBuffered[this.currentTrackId]||[]},SubtitleStreamController.prototype.onMediaSeeking=function(){this.fragPrevious=null},SubtitleStreamController}(c.default);t.SubtitleStreamController=h},"./src/controller/subtitle-track-controller.js":function srcControllerSubtitleTrackControllerJs(e,t,r){"use strict";(function(e){var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function __(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(__.prototype=r.prototype,new __)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=r("./src/events.js"),a=r("./src/event-handler.js"),o=r("./src/utils/logger.js"),s=r("./src/controller/level-helper.js"),u=function(t){function SubtitleTrackController(e){var r=t.call(this,e,i.default.MEDIA_ATTACHED,i.default.MEDIA_DETACHING,i.default.MANIFEST_LOADED,i.default.SUBTITLE_TRACK_LOADED)||this;return r.tracks=[],r.trackId=-1,r.media=null,r.stopped=!0,r.subtitleDisplay=!0,r}return n(SubtitleTrackController,t),SubtitleTrackController.prototype.destroy=function(){a.default.prototype.destroy.call(this)},SubtitleTrackController.prototype.onMediaAttached=function(e){var t=this;this.media=e.media,this.media&&(this.queuedDefaultTrack&&(this.subtitleTrack=this.queuedDefaultTrack,delete this.queuedDefaultTrack),this.trackChangeListener=this._onTextTracksChanged.bind(this),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.subtitlePollingInterval=setInterval((function(){t.trackChangeListener()}),500):this.media.textTracks.addEventListener("change",this.trackChangeListener))},SubtitleTrackController.prototype.onMediaDetaching=function(){this.media&&(this.useTextTrackPolling?clearInterval(this.subtitlePollingInterval):this.media.textTracks.removeEventListener("change",this.trackChangeListener),this.media=null)},SubtitleTrackController.prototype.onManifestLoaded=function(e){var t=this,r=e.subtitles||[];this.tracks=r,this.hls.trigger(i.default.SUBTITLE_TRACKS_UPDATED,{subtitleTracks:r}),r.forEach((function(e){e.default&&(t.media?t.subtitleTrack=e.id:t.queuedDefaultTrack=e.id)}))},SubtitleTrackController.prototype.onSubtitleTrackLoaded=function(e){var t=this,r=e.id,n=e.details,i=this.trackId,a=this.tracks,u=a[i];if(r>=a.length||r!==i||!u||this.stopped)this._clearReloadTimer();else if(o.logger.log("subtitle track "+r+" loaded"),n.live){var l=s.computeReloadInterval(u.details,n,e.stats.trequest);o.logger.log("Reloading live subtitle playlist in "+l+"ms"),this.timer=setTimeout((function(){t._loadCurrentTrack()}),l)}else this._clearReloadTimer()},SubtitleTrackController.prototype.startLoad=function(){this.stopped=!1,this._loadCurrentTrack()},SubtitleTrackController.prototype.stopLoad=function(){this.stopped=!0,this._clearReloadTimer()},Object.defineProperty(SubtitleTrackController.prototype,"subtitleTracks",{get:function get(){return this.tracks},enumerable:!0,configurable:!0}),Object.defineProperty(SubtitleTrackController.prototype,"subtitleTrack",{get:function get(){return this.trackId},set:function set(e){this.trackId!==e&&(this._toggleTrackModes(e),this._setSubtitleTrackInternal(e))},enumerable:!0,configurable:!0}),SubtitleTrackController.prototype._clearReloadTimer=function(){this.timer&&(clearTimeout(this.timer),this.timer=null)},SubtitleTrackController.prototype._loadCurrentTrack=function(){var e=this.trackId,t=this.tracks,r=this.hls,n=t[e];e<0||!n||n.details&&!n.details.live||(o.logger.log("Loading subtitle track "+e),r.trigger(i.default.SUBTITLE_TRACK_LOADING,{url:n.url,id:e}))},SubtitleTrackController.prototype._toggleTrackModes=function(e){var t=this.media,r=this.subtitleDisplay,n=this.trackId;if(t){var i=filterSubtitleTracks(t.textTracks);if(-1===e)[].slice.call(i).forEach((function(e){e.mode="disabled"}));else{var a=i[n];a&&(a.mode="disabled")}var o=i[e];o&&(o.mode=r?"showing":"hidden")}},SubtitleTrackController.prototype._setSubtitleTrackInternal=function(t){var r=this.hls,n=this.tracks;!e.isFinite(t)||t<-1||t>=n.length||(this.trackId=t,o.logger.log("Switching to subtitle track "+t),r.trigger(i.default.SUBTITLE_TRACK_SWITCH,{id:t}),this._loadCurrentTrack())},SubtitleTrackController.prototype._onTextTracksChanged=function(){if(this.media){for(var e=-1,t=filterSubtitleTracks(this.media.textTracks),r=0;r<t.length;r++)if("hidden"===t[r].mode)e=r;else if("showing"===t[r].mode){e=r;break}this.subtitleTrack=e}},SubtitleTrackController}(a.default);function filterSubtitleTracks(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];"subtitles"===n.kind&&n.label&&t.push(e[r])}return t}t.default=u}).call(this,r("./src/polyfills/number.js").Number)},"./src/controller/timeline-controller.js":function srcControllerTimelineControllerJs(e,t,r){"use strict";(function(e){var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function __(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(__.prototype=r.prototype,new __)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=r("./src/events.js"),a=r("./src/event-handler.js"),o=r("./src/utils/cea-608-parser.js"),s=r("./src/utils/output-filter.js"),u=r("./src/utils/webvtt-parser.js"),l=r("./src/utils/logger.js"),c=r("./src/utils/texttrack-utils.js");function canReuseVttTextTrack(e,t){return e&&e.label===t.name&&!(e.textTrack1||e.textTrack2)}var f=function(t){function TimelineController(e){var r=t.call(this,e,i.default.MEDIA_ATTACHING,i.default.MEDIA_DETACHING,i.default.FRAG_PARSING_USERDATA,i.default.FRAG_DECRYPTED,i.default.MANIFEST_LOADING,i.default.MANIFEST_LOADED,i.default.FRAG_LOADED,i.default.LEVEL_SWITCHING,i.default.INIT_PTS_FOUND)||this;if(r.hls=e,r.config=e.config,r.enabled=!0,r.Cues=e.config.cueHandler,r.textTracks=[],r.tracks=[],r.unparsedVttFrags=[],r.initPTS=[],r.cueRanges=[],r.captionsTracks={},r.captionsProperties={textTrack1:{label:r.config.captionsTextTrack1Label,languageCode:r.config.captionsTextTrack1LanguageCode},textTrack2:{label:r.config.captionsTextTrack2Label,languageCode:r.config.captionsTextTrack2LanguageCode}},r.config.enableCEA708Captions){var n=new s.default(r,"textTrack1"),a=new s.default(r,"textTrack2");r.cea608Parser=new o.default(0,n,a)}return r}return n(TimelineController,t),TimelineController.prototype.addCues=function(e,t,r,n){for(var i,a,o,s,u=this.cueRanges,l=!1,c=u.length;c--;){var f=u[c],d=(i=f[0],a=f[1],o=t,s=r,Math.min(a,s)-Math.max(i,o));if(d>=0&&(f[0]=Math.min(f[0],t),f[1]=Math.max(f[1],r),l=!0,d/(r-t)>.5))return}l||u.push([t,r]),this.Cues.newCue(this.captionsTracks[e],t,r,n)},TimelineController.prototype.onInitPtsFound=function(e){var t=this;if("main"===e.id&&(this.initPTS[e.frag.cc]=e.initPTS),this.unparsedVttFrags.length){var r=this.unparsedVttFrags;this.unparsedVttFrags=[],r.forEach((function(e){t.onFragLoaded(e)}))}},TimelineController.prototype.getExistingTrack=function(e){var t=this.media;if(t)for(var r=0;r<t.textTracks.length;r++){var n=t.textTracks[r];if(n[e])return n}return null},TimelineController.prototype.createCaptionsTrack=function(e){var t=this.captionsProperties[e],r=t.label,n=t.languageCode,i=this.captionsTracks;if(!i[e]){var a=this.getExistingTrack(e);if(a)i[e]=a,c.clearCurrentCues(i[e]),c.sendAddTrackEvent(i[e],this.media);else{var o=this.createTextTrack("captions",r,n);o&&(o[e]=!0,i[e]=o)}}},TimelineController.prototype.createTextTrack=function(e,t,r){var n=this.media;if(n)return n.addTextTrack(e,t,r)},TimelineController.prototype.destroy=function(){a.default.prototype.destroy.call(this)},TimelineController.prototype.onMediaAttaching=function(e){this.media=e.media,this._cleanTracks()},TimelineController.prototype.onMediaDetaching=function(){var e=this.captionsTracks;Object.keys(e).forEach((function(t){c.clearCurrentCues(e[t]),delete e[t]}))},TimelineController.prototype.onManifestLoading=function(){this.lastSn=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}},this._cleanTracks()},TimelineController.prototype._cleanTracks=function(){var e=this.media;if(e){var t=e.textTracks;if(t)for(var r=0;r<t.length;r++)c.clearCurrentCues(t[r])}},TimelineController.prototype.onManifestLoaded=function(e){var t=this;if(this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.cueRanges=[],this.config.enableWebVTT){this.tracks=e.subtitles||[];var r=this.media?this.media.textTracks:[];this.tracks.forEach((function(e,n){var i;if(n<r.length){for(var a=null,o=0;o<r.length;o++)if(canReuseVttTextTrack(r[o],e)){a=r[o];break}a&&(i=a)}i||(i=t.createTextTrack("subtitles",e.name,e.lang)),e.default?i.mode=t.hls.subtitleDisplay?"showing":"hidden":i.mode="disabled",t.textTracks.push(i)}))}},TimelineController.prototype.onLevelSwitching=function(){this.enabled="NONE"!==this.hls.currentLevel.closedCaptions},TimelineController.prototype.onFragLoaded=function(t){var r=t.frag,n=t.payload;if("main"===r.type){var a=r.sn;if(a!==this.lastSn+1){var o=this.cea608Parser;o&&o.reset()}this.lastSn=a}else if("subtitle"===r.type)if(n.byteLength){if(!e.isFinite(this.initPTS[r.cc]))return this.unparsedVttFrags.push(t),void(this.initPTS.length&&this.hls.trigger(i.default.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r}));var s=r.decryptdata;null!=s&&null!=s.key&&"AES-128"===s.method||this._parseVTTs(r,n)}else this.hls.trigger(i.default.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r})},TimelineController.prototype._parseVTTs=function(e,t){var r=this.vttCCs;r[e.cc]||(r[e.cc]={start:e.start,prevCC:this.prevCC,new:!0},this.prevCC=e.cc);var n=this.textTracks,a=this.hls;u.default.parse(t,this.initPTS[e.cc],r,e.cc,(function(t){var r=n[e.level];"disabled"!==r.mode?(t.forEach((function(e){if(!r.cues.getCueById(e.id))try{r.addCue(e)}catch(n){var t=new window.TextTrackCue(e.startTime,e.endTime,e.text);t.id=e.id,r.addCue(t)}})),a.trigger(i.default.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})):a.trigger(i.default.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e})}),(function(t){l.logger.log("Failed to parse VTT cue: "+t),a.trigger(i.default.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e})}))},TimelineController.prototype.onFragDecrypted=function(t){var r=t.payload,n=t.frag;if("subtitle"===n.type){if(!e.isFinite(this.initPTS[n.cc]))return void this.unparsedVttFrags.push(t);this._parseVTTs(n,r)}},TimelineController.prototype.onFragParsingUserdata=function(e){if(this.enabled&&this.config.enableCEA708Captions)for(var t=0;t<e.samples.length;t++){var r=this.extractCea608Data(e.samples[t].bytes);this.cea608Parser.addData(e.samples[t].pts,r)}},TimelineController.prototype.extractCea608Data=function(e){for(var t,r,n,i=31&e[0],a=2,o=[],s=0;s<i;s++)t=e[a++],r=127&e[a++],n=127&e[a++],0===r&&0===n||0!==(4&t)&&0===(3&t)&&(o.push(r),o.push(n));return o},TimelineController}(a.default);t.default=f}).call(this,r("./src/polyfills/number.js").Number)},"./src/crypt/aes-crypto.js":function srcCryptAesCryptoJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function AESCrypto(e,t){this.subtle=e,this.aesIV=t}return AESCrypto.prototype.decrypt=function(e,t){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e)},AESCrypto}();t.default=n},"./src/crypt/aes-decryptor.js":function srcCryptAesDecryptorJs(e,t,r){"use strict";function removePadding(e){var t=e.byteLength,r=t&&new DataView(e).getUint8(t-1);return r?e.slice(0,t-r):e}Object.defineProperty(t,"__esModule",{value:!0}),t.removePadding=removePadding;var n=function(){function AESDecryptor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.initTable()}return AESDecryptor.prototype.uint8ArrayToUint32Array_=function(e){for(var t=new DataView(e),r=new Uint32Array(4),n=0;n<4;n++)r[n]=t.getUint32(4*n);return r},AESDecryptor.prototype.initTable=function(){var e=this.sBox,t=this.invSBox,r=this.subMix,n=r[0],i=r[1],a=r[2],o=r[3],s=this.invSubMix,u=s[0],l=s[1],c=s[2],f=s[3],d=new Uint32Array(256),h=0,p=0,g=0;for(g=0;g<256;g++)d[g]=g<128?g<<1:g<<1^283;for(g=0;g<256;g++){var m=p^p<<1^p<<2^p<<3^p<<4;m=m>>>8^255&m^99,e[h]=m,t[m]=h;var v=d[h],y=d[v],_=d[y],b=257*d[m]^16843008*m;n[h]=b<<24|b>>>8,i[h]=b<<16|b>>>16,a[h]=b<<8|b>>>24,o[h]=b,b=16843009*_^65537*y^257*v^16843008*h,u[m]=b<<24|b>>>8,l[m]=b<<16|b>>>16,c[m]=b<<8|b>>>24,f[m]=b,h?(h=v^d[d[d[_^v]]],p^=d[d[p]]):h=p=1}},AESDecryptor.prototype.expandKey=function(e){for(var t=this.uint8ArrayToUint32Array_(e),r=!0,n=0;n<t.length&&r;)r=t[n]===this.key[n],n++;if(!r){this.key=t;var i=this.keySize=t.length;if(4!==i&&6!==i&&8!==i)throw new Error("Invalid aes key size="+i);var a,o,s,u,l=this.ksRows=4*(i+6+1),c=this.keySchedule=new Uint32Array(l),f=this.invKeySchedule=new Uint32Array(l),d=this.sBox,h=this.rcon,p=this.invSubMix,g=p[0],m=p[1],v=p[2],y=p[3];for(a=0;a<l;a++)a<i?s=c[a]=t[a]:(u=s,a%i===0?(u=d[(u=u<<8|u>>>24)>>>24]<<24|d[u>>>16&255]<<16|d[u>>>8&255]<<8|d[255&u],u^=h[a/i|0]<<24):i>6&&a%i===4&&(u=d[u>>>24]<<24|d[u>>>16&255]<<16|d[u>>>8&255]<<8|d[255&u]),c[a]=s=(c[a-i]^u)>>>0);for(o=0;o<l;o++)a=l-o,u=3&o?c[a]:c[a-4],f[o]=o<4||a<=4?u:g[d[u>>>24]]^m[d[u>>>16&255]]^v[d[u>>>8&255]]^y[d[255&u]],f[o]=f[o]>>>0}},AESDecryptor.prototype.networkToHostOrderSwap=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},AESDecryptor.prototype.decrypt=function(e,t,r,n){for(var i,a,o,s,u,l,c,f,d,h,p,g,m,v,y=this.keySize+6,_=this.invKeySchedule,b=this.invSBox,x=this.invSubMix,w=x[0],k=x[1],S=x[2],E=x[3],C=this.uint8ArrayToUint32Array_(r),T=C[0],O=C[1],A=C[2],R=C[3],D=new Int32Array(e),P=new Int32Array(D.length),j=this.networkToHostOrderSwap;t<D.length;){for(d=j(D[t]),h=j(D[t+1]),p=j(D[t+2]),g=j(D[t+3]),u=d^_[0],l=g^_[1],c=p^_[2],f=h^_[3],m=4,v=1;v<y;v++)i=w[u>>>24]^k[l>>16&255]^S[c>>8&255]^E[255&f]^_[m],a=w[l>>>24]^k[c>>16&255]^S[f>>8&255]^E[255&u]^_[m+1],o=w[c>>>24]^k[f>>16&255]^S[u>>8&255]^E[255&l]^_[m+2],s=w[f>>>24]^k[u>>16&255]^S[l>>8&255]^E[255&c]^_[m+3],u=i,l=a,c=o,f=s,m+=4;i=b[u>>>24]<<24^b[l>>16&255]<<16^b[c>>8&255]<<8^b[255&f]^_[m],a=b[l>>>24]<<24^b[c>>16&255]<<16^b[f>>8&255]<<8^b[255&u]^_[m+1],o=b[c>>>24]<<24^b[f>>16&255]<<16^b[u>>8&255]<<8^b[255&l]^_[m+2],s=b[f>>>24]<<24^b[u>>16&255]<<16^b[l>>8&255]<<8^b[255&c]^_[m+3],m+=3,P[t]=j(i^T),P[t+1]=j(s^O),P[t+2]=j(o^A),P[t+3]=j(a^R),T=d,O=h,A=p,R=g,t+=4}return n?removePadding(P.buffer):P.buffer},AESDecryptor.prototype.destroy=function(){this.key=void 0,this.keySize=void 0,this.ksRows=void 0,this.sBox=void 0,this.invSBox=void 0,this.subMix=void 0,this.invSubMix=void 0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.rcon=void 0},AESDecryptor}();t.default=n},"./src/crypt/decrypter.js":function srcCryptDecrypterJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("./src/crypt/aes-crypto.js"),i=r("./src/crypt/fast-aes-key.js"),a=r("./src/crypt/aes-decryptor.js"),o=r("./src/errors.js"),s=r("./src/utils/logger.js"),u=r("./src/events.js"),l=r("./src/utils/get-self-scope.js").getSelfScope(),c=function(){function Decrypter(e,t,r){var n=(void 0===r?{}:r).removePKCS7Padding,i=void 0===n||n;if(this.logEnabled=!0,this.observer=e,this.config=t,this.removePKCS7Padding=i,i)try{var a=l.crypto;a&&(this.subtle=a.subtle||a.webkitSubtle)}catch(o){}this.disableWebCrypto=!this.subtle}return Decrypter.prototype.isSync=function(){return this.disableWebCrypto&&this.config.enableSoftwareAES},Decrypter.prototype.decrypt=function(e,t,r,o){var u=this;if(this.disableWebCrypto&&this.config.enableSoftwareAES){this.logEnabled&&(s.logger.log("JS AES decrypt"),this.logEnabled=!1);var l=this.decryptor;l||(this.decryptor=l=new a.default),l.expandKey(t),o(l.decrypt(e,0,r,this.removePKCS7Padding))}else{this.logEnabled&&(s.logger.log("WebCrypto AES decrypt"),this.logEnabled=!1);var c=this.subtle;this.key!==t&&(this.key=t,this.fastAesKey=new i.default(c,t)),this.fastAesKey.expandKey().then((function(i){new n.default(c,r).decrypt(e,i).catch((function(n){u.onWebCryptoError(n,e,t,r,o)})).then((function(e){o(e)}))})).catch((function(n){u.onWebCryptoError(n,e,t,r,o)}))}},Decrypter.prototype.onWebCryptoError=function(e,t,r,n,i){this.config.enableSoftwareAES?(s.logger.log("WebCrypto Error, disable WebCrypto API"),this.disableWebCrypto=!0,this.logEnabled=!0,this.decrypt(t,r,n,i)):(s.logger.error("decrypting error : "+e.message),this.observer.trigger(u.default.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.FRAG_DECRYPT_ERROR,fatal:!0,reason:e.message}))},Decrypter.prototype.destroy=function(){var e=this.decryptor;e&&(e.destroy(),this.decryptor=void 0)},Decrypter}();t.default=c},"./src/crypt/fast-aes-key.js":function srcCryptFastAesKeyJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function FastAESKey(e,t){this.subtle=e,this.key=t}return FastAESKey.prototype.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},FastAESKey}();t.default=n},"./src/demux/aacdemuxer.js":function srcDemuxAacdemuxerJs(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r("./src/demux/adts.js"),i=r("./src/utils/logger.js"),a=r("./src/demux/id3.js"),o=function(){function AACDemuxer(e,t,r){this.observer=e,this.config=r,this.remuxer=t}return AACDemuxer.prototype.resetInitSegment=function(e,t,r,n){this._audioTrack={container:"audio/adts",type:"audio",id:0,sequenceNumber:0,isAAC:!0,samples:[],len:0,manifestCodec:t,duration:n,inputTimeScale:9e4}},AACDemuxer.prototype.resetTimeStamp=function(){},AACDemuxer.probe=function(e){if(!e)return!1;for(var t=(a.default.getID3Data(e,0)||[]).length,r=e.length;t<r;t++)if(n.probe(e,t))return i.logger.log("ADTS sync word found !"),!0;return!1},AACDemuxer.prototype.append=function(t,r,o,s){for(var u=this._audioTrack,l=a.default.getID3Data(t,0)||[],c=a.default.getTimeStamp(l),f=e.isFinite(c)?90*c:9e4*r,d=0,h=f,p=t.length,g=l.length,m=[{pts:h,dts:h,data:l}];g<p-1;)if(n.isHeader(t,g)&&g+5<p){n.initTrackConfig(u,this.observer,t,g,u.manifestCodec);var v=n.appendFrame(u,t,g,f,d);if(!v){i.logger.log("Unable to parse AAC frame");break}g+=v.length,h=v.sample.pts,d++}else a.default.isHeader(t,g)?(l=a.default.getID3Data(t,g),m.push({pts:h,dts:h,data:l}),g+=l.length):g++;this.remuxer.remux(u,{samples:[]},{samples:m,inputTimeScale:9e4},{samples:[]},r,o,s)},AACDemuxer.prototype.destroy=function(){},AACDemuxer}();t.default=o}).call(this,r("./src/polyfills/number.js").Number)},"./src/demux/adts.js":function srcDemuxAdtsJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("./src/utils/logger.js"),i=r("./src/errors.js"),a=r("./src/events.js");function getAudioConfig(e,t,r,o){var s,u,l,c,f,d=navigator.userAgent.toLowerCase(),h=o,p=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];if(s=1+((192&t[r+2])>>>6),!((u=(60&t[r+2])>>>2)>p.length-1))return c=(1&t[r+2])<<2,c|=(192&t[r+3])>>>6,n.logger.log("manifest codec:"+o+",ADTS data:type:"+s+",sampleingIndex:"+u+"["+p[u]+"Hz],channelConfig:"+c),/firefox/i.test(d)?u>=6?(s=5,f=new Array(4),l=u-3):(s=2,f=new Array(2),l=u):-1!==d.indexOf("android")?(s=2,f=new Array(2),l=u):(s=5,f=new Array(4),o&&(-1!==o.indexOf("mp4a.40.29")||-1!==o.indexOf("mp4a.40.5"))||!o&&u>=6?l=u-3:((o&&-1!==o.indexOf("mp4a.40.2")&&(u>=6&&1===c||/vivaldi/i.test(d))||!o&&1===c)&&(s=2,f=new Array(2)),l=u)),f[0]=s<<3,f[0]|=(14&u)>>1,f[1]|=(1&u)<<7,f[1]|=c<<3,5===s&&(f[1]|=(14&l)>>1,f[2]=(1&l)<<7,f[2]|=8,f[3]=0),{config:f,samplerate:p[u],channelCount:c,codec:"mp4a.40."+s,manifestCodec:h};e.trigger(a.default.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+u})}function isHeaderPattern(e,t){return 255===e[t]&&240===(246&e[t+1])}function getHeaderLength(e,t){return 1&e[t+1]?7:9}function getFullFrameLength(e,t){return(3&e[t+3])<<11|e[t+4]<<3|(224&e[t+5])>>>5}function getFrameDuration(e){return 9216e4/e}function parseFrameHeader(e,t,r,n,i){var a,o,s=e.length;if(a=getHeaderLength(e,t),o=getFullFrameLength(e,t),(o-=a)>0&&t+a+o<=s)return{headerLength:a,frameLength:o,stamp:r+n*i}}t.getAudioConfig=getAudioConfig,t.isHeaderPattern=isHeaderPattern,t.getHeaderLength=getHeaderLength,t.getFullFrameLength=getFullFrameLength,t.isHeader=function isHeader(e,t){return!!(t+1<e.length&&isHeaderPattern(e,t))},t.probe=function probe(e,t){if(t+1<e.length&&isHeaderPattern(e,t)){var r=getHeaderLength(e,t);t+5<e.length&&(r=getFullFrameLength(e,t));var n=t+r;if(n===e.length||n+1<e.length&&isHeaderPattern(e,n))return!0}return!1},t.initTrackConfig=function initTrackConfig(e,t,r,i,a){if(!e.samplerate){var o=getAudioConfig(t,r,i,a);e.config=o.config,e.samplerate=o.samplerate,e.channelCount=o.channelCount,e.codec=o.codec,e.manifestCodec=o.manifestCodec,n.logger.log("parsed codec:"+e.codec+",rate:"+o.samplerate+",nb channel:"+o.channelCount)}},t.getFrameDuration=getFrameDuration,t.parseFrameHeader=parseFrameHeader,t.appendFrame=function appendFrame(e,t,r,n,i){var a=parseFrameHeader(t,r,n,i,getFrameDuration(e.samplerate));if(a){var o=a.stamp,s=a.headerLength,u=a.frameLength,l={unit:t.subarray(r+s,r+s+u),pts:o,dts:o};return e.samples.push(l),e.len+=u,{sample:l,length:u+s}}}},"./src/demux/demuxer-inline.js":function srcDemuxDemuxerInlineJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r("./src/events.js"),a=r("./src/errors.js"),o=r("./src/crypt/decrypter.js"),s=r("./src/demux/aacdemuxer.js"),u=r("./src/demux/mp4demuxer.js"),l=r("./src/demux/tsdemuxer.js"),c=r("./src/demux/mp3demuxer.js"),f=r("./src/remux/mp4-remuxer.js"),d=r("./src/remux/passthrough-remuxer.js"),h=r("./src/utils/get-self-scope.js"),p=r("./src/utils/logger.js"),g=h.getSelfScope();try{n=g.performance.now.bind(g.performance)}catch(v){p.logger.debug("Unable to use Performance API on this environment"),n=g.Date.now}var m=function(){function DemuxerInline(e,t,r,n){this.observer=e,this.typeSupported=t,this.config=r,this.vendor=n}return DemuxerInline.prototype.destroy=function(){var e=this.demuxer;e&&e.destroy()},DemuxerInline.prototype.push=function(e,t,r,a,s,u,l,c,f,d,h,p){var g=this;if(e.byteLength>0&&null!=t&&null!=t.key&&"AES-128"===t.method){var m=this.decrypter;null==m&&(m=this.decrypter=new o.default(this.observer,this.config));var v=n();m.decrypt(e,t.key.buffer,t.iv.buffer,(function(e){var o=n();g.observer.trigger(i.default.FRAG_DECRYPTED,{stats:{tstart:v,tdecrypt:o}}),g.pushDecrypted(new Uint8Array(e),t,new Uint8Array(r),a,s,u,l,c,f,d,h,p)}))}else this.pushDecrypted(new Uint8Array(e),t,new Uint8Array(r),a,s,u,l,c,f,d,h,p)},DemuxerInline.prototype.pushDecrypted=function(e,t,r,n,o,h,p,g,m,v,y,_){var b=this.demuxer;if(!b||(p||g)&&!this.probe(e)){for(var x=this.observer,w=this.typeSupported,k=this.config,S=[{demux:l.default,remux:f.default},{demux:u.default,remux:d.default},{demux:s.default,remux:f.default},{demux:c.default,remux:f.default}],E=0,C=S.length;E<C;E++){var T=S[E],O=T.demux.probe;if(O(e)){var A=this.remuxer=new T.remux(x,k,w,this.vendor);b=new T.demux(x,A,k,w),this.probe=O;break}}if(!b)return void x.trigger(i.default.ERROR,{type:a.ErrorTypes.MEDIA_ERROR,details:a.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"});this.demuxer=b}var R=this.remuxer;(p||g)&&(b.resetInitSegment(r,n,o,v),R.resetInitSegment()),p&&(b.resetTimeStamp(_),R.resetTimeStamp(_)),"function"===typeof b.setDecryptData&&b.setDecryptData(t),b.append(e,h,m,y)},DemuxerInline}();t.default=m},"./src/demux/demuxer-worker.js":function srcDemuxDemuxerWorkerJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("./src/demux/demuxer-inline.js"),i=r("./src/events.js"),a=r("./src/utils/logger.js"),o=r("./node_modules/node-libs-browser/node_modules/events/events.js");t.default=function DemuxerWorker(e){var t=new o.EventEmitter;t.trigger=function trigger(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];t.emit.apply(t,[e,e].concat(r))},t.off=function off(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];t.removeListener.apply(t,[e].concat(r))};var r=function forwardMessage(t,r){e.postMessage({event:t,data:r})};e.addEventListener("message",(function(i){var o=i.data;switch(o.cmd){case"init":var s=JSON.parse(o.config);e.demuxer=new n.default(t,o.typeSupported,s,o.vendor),a.enableLogs(s.debug),r("init",null);break;case"demux":e.demuxer.push(o.data,o.decryptdata,o.initSegment,o.audioCodec,o.videoCodec,o.timeOffset,o.discontinuity,o.trackSwitch,o.contiguous,o.duration,o.accurateTimeOffset,o.defaultInitPTS)}})),t.on(i.default.FRAG_DECRYPTED,r),t.on(i.default.FRAG_PARSING_INIT_SEGMENT,r),t.on(i.default.FRAG_PARSED,r),t.on(i.default.ERROR,r),t.on(i.default.FRAG_PARSING_METADATA,r),t.on(i.default.FRAG_PARSING_USERDATA,r),t.on(i.default.INIT_PTS_FOUND,r),t.on(i.default.FRAG_PARSING_DATA,(function(t,r){var n=[],i={event:t,data:r};r.data1&&(i.data1=r.data1.buffer,n.push(r.data1.buffer),delete r.data1),r.data2&&(i.data2=r.data2.buffer,n.push(r.data2.buffer),delete r.data2),e.postMessage(i,n)}))}},"./src/demux/demuxer.js":function srcDemuxDemuxerJs(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r("./node_modules/webworkify-webpack/index.js"),i=r("./src/events.js"),a=r("./src/demux/demuxer-inline.js"),o=r("./src/utils/logger.js"),s=r("./src/errors.js"),u=r("./src/utils/mediasource-helper.js"),l=r("./src/utils/get-self-scope.js"),c=r("./src/observer.js"),f=l.getSelfScope(),d=u.getMediaSource(),h=function(){function Demuxer(e,t){var r=this;this.hls=e,this.id=t;var u=this.observer=new c.Observer,l=e.config,h=function forwardMessage(t,n){(n=n||{}).frag=r.frag,n.id=r.id,e.trigger(t,n)};u.on(i.default.FRAG_DECRYPTED,h),u.on(i.default.FRAG_PARSING_INIT_SEGMENT,h),u.on(i.default.FRAG_PARSING_DATA,h),u.on(i.default.FRAG_PARSED,h),u.on(i.default.ERROR,h),u.on(i.default.FRAG_PARSING_METADATA,h),u.on(i.default.FRAG_PARSING_USERDATA,h),u.on(i.default.INIT_PTS_FOUND,h);var p={mp4:d.isTypeSupported("video/mp4"),mpeg:d.isTypeSupported("audio/mpeg"),mp3:d.isTypeSupported('audio/mp4; codecs="mp3"')},g=navigator.vendor;if(l.enableWorker&&"undefined"!==typeof Worker){o.logger.log("demuxing in webworker");var m=void 0;try{m=this.w=n("./src/demux/demuxer-worker.js"),this.onwmsg=this.onWorkerMessage.bind(this),m.addEventListener("message",this.onwmsg),m.onerror=function(t){e.trigger(i.default.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",err:{message:t.message+" ("+t.filename+":"+t.lineno+")"}})},m.postMessage({cmd:"init",typeSupported:p,vendor:g,id:t,config:JSON.stringify(l)})}catch(v){o.logger.warn("Error in worker:",v),o.logger.error("Error while initializing DemuxerWorker, fallback on DemuxerInline"),m&&f.URL.revokeObjectURL(m.objectURL),this.demuxer=new a.default(u,p,l,g),this.w=void 0}}else this.demuxer=new a.default(u,p,l,g)}return Demuxer.prototype.destroy=function(){var e=this.w;if(e)e.removeEventListener("message",this.onwmsg),e.terminate(),this.w=null;else{var t=this.demuxer;t&&(t.destroy(),this.demuxer=null)}var r=this.observer;r&&(r.removeAllListeners(),this.observer=null)},Demuxer.prototype.push=function(t,r,n,i,a,s,u,l){var c=this.w,f=e.isFinite(a.startPTS)?a.startPTS:a.start,d=a.decryptdata,h=this.frag,p=!(h&&a.cc===h.cc),g=!(h&&a.level===h.level),m=h&&a.sn===h.sn+1,v=!g&&m;if(p&&o.logger.log(this.id+":discontinuity detected"),g&&o.logger.log(this.id+":switch detected"),this.frag=a,c)c.postMessage({cmd:"demux",data:t,decryptdata:d,initSegment:r,audioCodec:n,videoCodec:i,timeOffset:f,discontinuity:p,trackSwitch:g,contiguous:v,duration:s,accurateTimeOffset:u,defaultInitPTS:l},t instanceof ArrayBuffer?[t]:[]);else{var y=this.demuxer;y&&y.push(t,d,r,n,i,f,p,g,v,s,u,l)}},Demuxer.prototype.onWorkerMessage=function(e){var t=e.data,r=this.hls;switch(t.event){case"init":f.URL.revokeObjectURL(this.w.objectURL);break;case i.default.FRAG_PARSING_DATA:t.data.data1=new Uint8Array(t.data1),t.data2&&(t.data.data2=new Uint8Array(t.data2));default:t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,r.trigger(t.event,t.data)}},Demuxer}();t.default=h}).call(this,r("./src/polyfills/number.js").Number)},"./src/demux/exp-golomb.js":function srcDemuxExpGolombJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("./src/utils/logger.js"),i=function(){function ExpGolomb(e){this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}return ExpGolomb.prototype.loadWord=function(){var e=this.data,t=this.bytesAvailable,r=e.byteLength-t,n=new Uint8Array(4),i=Math.min(4,t);if(0===i)throw new Error("no bytes available");n.set(e.subarray(r,r+i)),this.word=new DataView(n.buffer).getUint32(0),this.bitsAvailable=8*i,this.bytesAvailable-=i},ExpGolomb.prototype.skipBits=function(e){var t;this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,e-=(t=e>>3)>>3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)},ExpGolomb.prototype.readBits=function(e){var t=Math.min(this.bitsAvailable,e),r=this.word>>>32-t;return e>32&&n.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0?this.word<<=t:this.bytesAvailable>0&&this.loadWord(),(t=e-t)>0&&this.bitsAvailable?r<<t|this.readBits(t):r},ExpGolomb.prototype.skipLZ=function(){var e;for(e=0;e<this.bitsAvailable;++e)if(0!==(this.word&2147483648>>>e))return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()},ExpGolomb.prototype.skipUEG=function(){this.skipBits(1+this.skipLZ())},ExpGolomb.prototype.skipEG=function(){this.skipBits(1+this.skipLZ())},ExpGolomb.prototype.readUEG=function(){var e=this.skipLZ();return this.readBits(e+1)-1},ExpGolomb.prototype.readEG=function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)},ExpGolomb.prototype.readBoolean=function(){return 1===this.readBits(1)},ExpGolomb.prototype.readUByte=function(){return this.readBits(8)},ExpGolomb.prototype.readUShort=function(){return this.readBits(16)},ExpGolomb.prototype.readUInt=function(){return this.readBits(32)},ExpGolomb.prototype.skipScalingList=function(e){var t,r=8,n=8;for(t=0;t<e;t++)0!==n&&(n=(r+this.readEG()+256)%256),r=0===n?r:n},ExpGolomb.prototype.readSPS=function(){var e,t,r,n,i,a,o,s=0,u=0,l=0,c=0,f=this.readUByte.bind(this),d=this.readBits.bind(this),h=this.readUEG.bind(this),p=this.readBoolean.bind(this),g=this.skipBits.bind(this),m=this.skipEG.bind(this),v=this.skipUEG.bind(this),y=this.skipScalingList.bind(this);if(f(),e=f(),d(5),g(3),f(),v(),100===e||110===e||122===e||244===e||44===e||83===e||86===e||118===e||128===e){var _=h();if(3===_&&g(1),v(),v(),g(1),p())for(a=3!==_?8:12,o=0;o<a;o++)p()&&y(o<6?16:64)}v();var b=h();if(0===b)h();else if(1===b)for(g(1),m(),m(),t=h(),o=0;o<t;o++)m();v(),g(1),r=h(),n=h(),0===(i=d(1))&&g(1),g(1),p()&&(s=h(),u=h(),l=h(),c=h());var x=[1,1];if(p()&&p())switch(f()){case 1:x=[1,1];break;case 2:x=[12,11];break;case 3:x=[10,11];break;case 4:x=[16,11];break;case 5:x=[40,33];break;case 6:x=[24,11];break;case 7:x=[20,11];break;case 8:x=[32,11];break;case 9:x=[80,33];break;case 10:x=[18,11];break;case 11:x=[15,11];break;case 12:x=[64,33];break;case 13:x=[160,99];break;case 14:x=[4,3];break;case 15:x=[3,2];break;case 16:x=[2,1];break;case 255:x=[f()<<8|f(),f()<<8|f()]}return{width:Math.ceil(16*(r+1)-2*s-2*u),height:(2-i)*(n+1)*16-(i?2:4)*(l+c),pixelRatio:x}},ExpGolomb.prototype.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},ExpGolomb}();t.default=i},"./src/demux/id3.js":function srcDemuxId3Js(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function ID3(){}return ID3.isHeader=function(e,t){return t+10<=e.length&&73===e[t]&&68===e[t+1]&&51===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128},ID3.isFooter=function(e,t){return t+10<=e.length&&51===e[t]&&68===e[t+1]&&73===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128},ID3.getID3Data=function(e,t){for(var r=t,n=0;ID3.isHeader(e,t);){n+=10,n+=ID3._readSize(e,t+6),ID3.isFooter(e,t+10)&&(n+=10),t+=n}if(n>0)return e.subarray(r,r+n)},ID3._readSize=function(e,t){var r=0;return r=(127&e[t])<<21,r|=(127&e[t+1])<<14,r|=(127&e[t+2])<<7,r|=127&e[t+3]},ID3.getTimeStamp=function(e){for(var t=ID3.getID3Frames(e),r=0;r<t.length;r++){var n=t[r];if(ID3.isTimeStampFrame(n))return ID3._readTimeStamp(n)}},ID3.isTimeStampFrame=function(e){return e&&"PRIV"===e.key&&"com.apple.streaming.transportStreamTimestamp"===e.info},ID3._getFrameData=function(e){var t=String.fromCharCode(e[0],e[1],e[2],e[3]),r=ID3._readSize(e,4);return{type:t,size:r,data:e.subarray(10,10+r)}},ID3.getID3Frames=function(e){for(var t=0,r=[];ID3.isHeader(e,t);){for(var n=ID3._readSize(e,t+6),i=(t+=10)+n;t+8<i;){var a=ID3._getFrameData(e.subarray(t)),o=ID3._decodeFrame(a);o&&r.push(o),t+=a.size+10}ID3.isFooter(e,t)&&(t+=10)}return r},ID3._decodeFrame=function(e){return"PRIV"===e.type?ID3._decodePrivFrame(e):"T"===e.type[0]?ID3._decodeTextFrame(e):"W"===e.type[0]?ID3._decodeURLFrame(e):void 0},ID3._readTimeStamp=function(e){if(8===e.data.byteLength){var t=new Uint8Array(e.data),r=1&t[3],n=(t[4]<<23)+(t[5]<<15)+(t[6]<<7)+t[7];return n/=45,r&&(n+=47721858.84),Math.round(n)}},ID3._decodePrivFrame=function(e){if(!(e.size<2)){var t=ID3._utf8ArrayToStr(e.data,!0),r=new Uint8Array(e.data.subarray(t.length+1));return{key:e.type,info:t,data:r.buffer}}},ID3._decodeTextFrame=function(e){if(!(e.size<2)){if("TXXX"===e.type){var t=1,r=ID3._utf8ArrayToStr(e.data.subarray(t));t+=r.length+1;var n=ID3._utf8ArrayToStr(e.data.subarray(t));return{key:e.type,info:r,data:n}}var i=ID3._utf8ArrayToStr(e.data.subarray(1));return{key:e.type,data:i}}},ID3._decodeURLFrame=function(e){if("WXXX"===e.type){if(e.size<2)return;var t=1,r=ID3._utf8ArrayToStr(e.data.subarray(t));t+=r.length+1;var n=ID3._utf8ArrayToStr(e.data.subarray(t));return{key:e.type,info:r,data:n}}var i=ID3._utf8ArrayToStr(e.data);return{key:e.type,data:i}},ID3._utf8ArrayToStr=function(e,t){void 0===t&&(t=!1);for(var r,n,i,a=e.length,o="",s=0;s<a;){if(0===(r=e[s++])&&t)return o;if(0!==r&&3!==r)switch(r>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(r);break;case 12:case 13:n=e[s++],o+=String.fromCharCode((31&r)<<6|63&n);break;case 14:n=e[s++],i=e[s++],o+=String.fromCharCode((15&r)<<12|(63&n)<<6|(63&i)<<0)}}return o},ID3}(),i=n._utf8ArrayToStr;t.utf8ArrayToStr=i,t.default=n},"./src/demux/mp3demuxer.js":function srcDemuxMp3demuxerJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("./src/demux/id3.js"),i=r("./src/utils/logger.js"),a=r("./src/demux/mpegaudio.js"),o=function(){function MP3Demuxer(e,t,r){this.observer=e,this.config=r,this.remuxer=t}return MP3Demuxer.prototype.resetInitSegment=function(e,t,r,n){this._audioTrack={container:"audio/mpeg",type:"audio",id:-1,sequenceNumber:0,isAAC:!1,samples:[],len:0,manifestCodec:t,duration:n,inputTimeScale:9e4}},MP3Demuxer.prototype.resetTimeStamp=function(){},MP3Demuxer.probe=function(e){var t,r,o=n.default.getID3Data(e,0);if(o&&void 0!==n.default.getTimeStamp(o))for(t=o.length,r=Math.min(e.length-1,t+100);t<r;t++)if(a.default.probe(e,t))return i.logger.log("MPEG Audio sync word found !"),!0;return!1},MP3Demuxer.prototype.append=function(e,t,r,i){for(var o=n.default.getID3Data(e,0),s=n.default.getTimeStamp(o),u=s?90*s:9e4*t,l=o.length,c=e.length,f=0,d=0,h=this._audioTrack,p=[{pts:u,dts:u,data:o}];l<c;)if(a.default.isHeader(e,l)){var g=a.default.appendFrame(h,e,l,u,f);if(!g)break;l+=g.length,d=g.sample.pts,f++}else n.default.isHeader(e,l)?(o=n.default.getID3Data(e,l),p.push({pts:d,dts:d,data:o}),l+=o.length):l++;this.remuxer.remux(h,{samples:[]},{samples:p,inputTimeScale:9e4},{samples:[]},t,r,i)},MP3Demuxer.prototype.destroy=function(){},MP3Demuxer}();t.default=o},"./src/demux/mp4demuxer.js":function srcDemuxMp4demuxerJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("./src/utils/logger.js"),i=r("./src/events.js"),a=Math.pow(2,32)-1,o=function(){function MP4Demuxer(e,t){this.observer=e,this.remuxer=t}return MP4Demuxer.prototype.resetTimeStamp=function(e){this.initPTS=e},MP4Demuxer.prototype.resetInitSegment=function(e,t,r,n){if(e&&e.byteLength){var a=this.initData=MP4Demuxer.parseInitSegment(e);null==t&&(t="mp4a.40.5"),null==r&&(r="avc1.42e01e");var o={};a.audio&&a.video?o.audiovideo={container:"video/mp4",codec:t+","+r,initSegment:n?e:null}:(a.audio&&(o.audio={container:"audio/mp4",codec:t,initSegment:n?e:null}),a.video&&(o.video={container:"video/mp4",codec:r,initSegment:n?e:null})),this.observer.trigger(i.default.FRAG_PARSING_INIT_SEGMENT,{tracks:o})}else t&&(this.audioCodec=t),r&&(this.videoCodec=r)},MP4Demuxer.probe=function(e){return MP4Demuxer.findBox({data:e,start:0,end:Math.min(e.length,16384)},["moof"]).length>0},MP4Demuxer.bin2str=function(e){return String.fromCharCode.apply(null,e)},MP4Demuxer.readUint16=function(e,t){e.data&&(t+=e.start,e=e.data);var r=e[t]<<8|e[t+1];return r<0?65536+r:r},MP4Demuxer.readUint32=function(e,t){e.data&&(t+=e.start,e=e.data);var r=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];return r<0?4294967296+r:r},MP4Demuxer.writeUint32=function(e,t,r){e.data&&(t+=e.start,e=e.data),e[t]=r>>24,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r},MP4Demuxer.findBox=function(e,t){var r,n,i,a,o,s,u=[];if(e.data?(o=e.start,i=e.end,e=e.data):(o=0,i=e.byteLength),!t.length)return null;for(r=o;r<i;)s=(n=MP4Demuxer.readUint32(e,r))>1?r+n:i,MP4Demuxer.bin2str(e.subarray(r+4,r+8))===t[0]&&(1===t.length?u.push({data:e,start:r+8,end:s}):(a=MP4Demuxer.findBox({data:e,start:r+8,end:s},t.slice(1))).length&&(u=u.concat(a))),r=s;return u},MP4Demuxer.parseSegmentIndex=function(e){var t,r=MP4Demuxer.findBox(e,["moov"])[0],n=r?r.end:null,i=0,a=MP4Demuxer.findBox(e,["sidx"]);if(!a||!a[0])return null;t=[];var o=(a=a[0]).data[0];i=0===o?8:16;var s=MP4Demuxer.readUint32(a,i);i+=4;i+=0===o?8:16,i+=2;var u=a.end+0,l=MP4Demuxer.readUint16(a,i);i+=2;for(var c=0;c<l;c++){var f=i,d=MP4Demuxer.readUint32(a,f);f+=4;var h=2147483647&d;if(1===(2147483648&d)>>>31)return void console.warn("SIDX has hierarchical references (not supported)");var p=MP4Demuxer.readUint32(a,f);f+=4,t.push({referenceSize:h,subsegmentDuration:p,info:{duration:p/s,start:u,end:u+h-1}}),u+=h,i=f+=4}return{earliestPresentationTime:0,timescale:s,version:o,referencesCount:l,references:t,moovEndOffset:n}},MP4Demuxer.parseInitSegment=function(e){var t=[];return MP4Demuxer.findBox(e,["moov","trak"]).forEach((function(e){var r=MP4Demuxer.findBox(e,["tkhd"])[0];if(r){var i=r.data[r.start],a=0===i?12:20,o=MP4Demuxer.readUint32(r,a),s=MP4Demuxer.findBox(e,["mdia","mdhd"])[0];if(s){a=0===(i=s.data[s.start])?12:20;var u=MP4Demuxer.readUint32(s,a),l=MP4Demuxer.findBox(e,["mdia","hdlr"])[0];if(l){var c={soun:"audio",vide:"video"}[MP4Demuxer.bin2str(l.data.subarray(l.start+8,l.start+12))];if(c){var f=MP4Demuxer.findBox(e,["mdia","minf","stbl","stsd"]);if(f.length){f=f[0];var d=MP4Demuxer.bin2str(f.data.subarray(f.start+12,f.start+16));n.logger.log("MP4Demuxer:"+c+":"+d+" found")}t[o]={timescale:u,type:c},t[c]={timescale:u,id:o}}}}}})),t},MP4Demuxer.getStartDTS=function(e,t){var r,n,i;return r=MP4Demuxer.findBox(t,["moof","traf"]),n=[].concat.apply([],r.map((function(t){return MP4Demuxer.findBox(t,["tfhd"]).map((function(r){var n,i;return n=MP4Demuxer.readUint32(r,4),i=e[n].timescale||9e4,MP4Demuxer.findBox(t,["tfdt"]).map((function(e){var t,r;return t=e.data[e.start],r=MP4Demuxer.readUint32(e,4),1===t&&(r*=Math.pow(2,32),r+=MP4Demuxer.readUint32(e,8)),r}))[0]/i}))}))),i=Math.min.apply(null,n),isFinite(i)?i:0},MP4Demuxer.offsetStartDTS=function(e,t,r){MP4Demuxer.findBox(t,["moof","traf"]).map((function(t){return MP4Demuxer.findBox(t,["tfhd"]).map((function(n){var i=MP4Demuxer.readUint32(n,4),o=e[i].timescale||9e4;MP4Demuxer.findBox(t,["tfdt"]).map((function(e){var t=e.data[e.start],n=MP4Demuxer.readUint32(e,4);if(0===t)MP4Demuxer.writeUint32(e,4,n-r*o);else{n*=Math.pow(2,32),n+=MP4Demuxer.readUint32(e,8),n-=r*o,n=Math.max(n,0);var i=Math.floor(n/(a+1)),s=Math.floor(n%(a+1));MP4Demuxer.writeUint32(e,4,i),MP4Demuxer.writeUint32(e,8,s)}}))}))}))},MP4Demuxer.prototype.append=function(e,t,r,n){var a=this.initData;a||(this.resetInitSegment(e,this.audioCodec,this.videoCodec,!1),a=this.initData);var o,s=this.initPTS;if(void 0===s){var u=MP4Demuxer.getStartDTS(a,e);this.initPTS=s=u-t,this.observer.trigger(i.default.INIT_PTS_FOUND,{initPTS:s})}MP4Demuxer.offsetStartDTS(a,e,s),o=MP4Demuxer.getStartDTS(a,e),this.remuxer.remux(a.audio,a.video,null,null,o,r,n,e)},MP4Demuxer.prototype.destroy=function(){},MP4Demuxer}();t.default=o},"./src/demux/mpegaudio.js":function srcDemuxMpegaudioJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={BitratesMap:[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],SamplingRateMap:[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],SamplesCoefficients:[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],BytesInSlot:[0,1,1,4],appendFrame:function appendFrame(e,t,r,n,i){if(!(r+24>t.length)){var a=this.parseHeader(t,r);if(a&&r+a.frameLength<=t.length){var o=n+i*(9e4*a.samplesPerFrame/a.sampleRate),s={unit:t.subarray(r,r+a.frameLength),pts:o,dts:o};return e.config=[],e.channelCount=a.channelCount,e.samplerate=a.sampleRate,e.samples.push(s),e.len+=a.frameLength,{sample:s,length:a.frameLength}}}},parseHeader:function parseHeader(e,t){var r=e[t+1]>>3&3,i=e[t+1]>>1&3,a=e[t+2]>>4&15,o=e[t+2]>>2&3,s=e[t+2]>>1&1;if(1!==r&&0!==a&&15!==a&&3!==o){var u=3===r?3-i:3===i?3:4,l=1e3*n.BitratesMap[14*u+a-1],c=3===r?0:2===r?1:2,f=n.SamplingRateMap[3*c+o],d=e[t+3]>>6===3?1:2,h=n.SamplesCoefficients[r][i],p=n.BytesInSlot[i],g=8*h*p;return{sampleRate:f,channelCount:d,frameLength:parseInt(h*l/f+s,10)*p,samplesPerFrame:g}}},isHeaderPattern:function isHeaderPattern(e,t){return 255===e[t]&&224===(224&e[t+1])&&0!==(6&e[t+1])},isHeader:function isHeader(e,t){return!!(t+1<e.length&&this.isHeaderPattern(e,t))},probe:function probe(e,t){if(t+1<e.length&&this.isHeaderPattern(e,t)){var r=this.parseHeader(e,t),n=4;r&&r.frameLength&&(n=r.frameLength);var i=t+n;if(i===e.length||i+1<e.length&&this.isHeaderPattern(e,i))return!0}return!1}};t.default=n},"./src/demux/sample-aes.js":function srcDemuxSampleAesJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("./src/crypt/decrypter.js"),i=function(){function SampleAesDecrypter(e,t,r,i){this.decryptdata=r,this.discardEPB=i,this.decrypter=new n.default(e,t,{removePKCS7Padding:!1})}return SampleAesDecrypter.prototype.decryptBuffer=function(e,t){this.decrypter.decrypt(e,this.decryptdata.key.buffer,this.decryptdata.iv.buffer,t)},SampleAesDecrypter.prototype.decryptAacSample=function(e,t,r,n){var i=e[t].unit,a=i.subarray(16,i.length-i.length%16),o=a.buffer.slice(a.byteOffset,a.byteOffset+a.length),s=this;this.decryptBuffer(o,(function(a){a=new Uint8Array(a),i.set(a,16),n||s.decryptAacSamples(e,t+1,r)}))},SampleAesDecrypter.prototype.decryptAacSamples=function(e,t,r){for(;;t++){if(t>=e.length)return void r();if(!(e[t].unit.length<32)){var n=this.decrypter.isSync();if(this.decryptAacSample(e,t,r,n),!n)return}}},SampleAesDecrypter.prototype.getAvcEncryptedData=function(e){for(var t=16*Math.floor((e.length-48)/160)+16,r=new Int8Array(t),n=0,i=32;i<=e.length-16;i+=160,n+=16)r.set(e.subarray(i,i+16),n);return r},SampleAesDecrypter.prototype.getAvcDecryptedUnit=function(e,t){t=new Uint8Array(t);for(var r=0,n=32;n<=e.length-16;n+=160,r+=16)e.set(t.subarray(r,r+16),n);return e},SampleAesDecrypter.prototype.decryptAvcSample=function(e,t,r,n,i,a){var o=this.discardEPB(i.data),s=this.getAvcEncryptedData(o),u=this;this.decryptBuffer(s.buffer,(function(s){i.data=u.getAvcDecryptedUnit(o,s),a||u.decryptAvcSamples(e,t,r+1,n)}))},SampleAesDecrypter.prototype.decryptAvcSamples=function(e,t,r,n){for(;;t++,r=0){if(t>=e.length)return void n();for(var i=e[t].units;!(r>=i.length);r++){var a=i[r];if(!(a.length<=48||1!==a.type&&5!==a.type)){var o=this.decrypter.isSync();if(this.decryptAvcSample(e,t,r,n,a,o),!o)return}}}},SampleAesDecrypter}();t.default=i},"./src/demux/tsdemuxer.js":function srcDemuxTsdemuxerJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("./src/demux/adts.js"),i=r("./src/demux/mpegaudio.js"),a=r("./src/events.js"),o=r("./src/demux/exp-golomb.js"),s=r("./src/demux/sample-aes.js"),u=r("./src/utils/logger.js"),l=r("./src/errors.js"),c={video:1,audio:2,id3:3,text:4},f=function(){function TSDemuxer(e,t,r,n){this.observer=e,this.config=r,this.typeSupported=n,this.remuxer=t,this.sampleAes=null}return TSDemuxer.prototype.setDecryptData=function(e){null!=e&&null!=e.key&&"SAMPLE-AES"===e.method?this.sampleAes=new s.default(this.observer,this.config,e,this.discardEPB):this.sampleAes=null},TSDemuxer.probe=function(e){var t=TSDemuxer._syncOffset(e);return!(t<0)&&(t&&u.logger.warn("MPEG2-TS detected but first sync word found @ offset "+t+", junk ahead ?"),!0)},TSDemuxer._syncOffset=function(e){for(var t=Math.min(1e3,e.length-564),r=0;r<t;){if(71===e[r]&&71===e[r+188]&&71===e[r+376])return r;r++}return-1},TSDemuxer.createTrack=function(e,t){return{container:"video"===e||"audio"===e?"video/mp2t":void 0,type:e,id:c[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],len:0,dropped:"video"===e?0:void 0,isAAC:"audio"===e||void 0,duration:"audio"===e?t:void 0}},TSDemuxer.prototype.resetInitSegment=function(e,t,r,n){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=TSDemuxer.createTrack("video",n),this._audioTrack=TSDemuxer.createTrack("audio",n),this._id3Track=TSDemuxer.createTrack("id3",n),this._txtTrack=TSDemuxer.createTrack("text",n),this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=t,this.videoCodec=r,this._duration=n},TSDemuxer.prototype.resetTimeStamp=function(){},TSDemuxer.prototype.append=function(e,t,r,n){var i,o,s,c,f,d=e.length,h=!1;this.contiguous=r;var p=this.pmtParsed,g=this._avcTrack,m=this._audioTrack,v=this._id3Track,y=g.pid,_=m.pid,b=v.pid,x=this._pmtId,w=g.pesData,k=m.pesData,S=v.pesData,E=this._parsePAT,C=this._parsePMT,T=this._parsePES,O=this._parseAVCPES.bind(this),A=this._parseAACPES.bind(this),R=this._parseMPEGPES.bind(this),D=this._parseID3PES.bind(this),P=TSDemuxer._syncOffset(e);for(d-=(d+P)%188,i=P;i<d;i+=188)if(71===e[i]){if(o=!!(64&e[i+1]),s=((31&e[i+1])<<8)+e[i+2],(48&e[i+3])>>4>1){if((c=i+5+e[i+4])===i+188)continue}else c=i+4;switch(s){case y:o&&(w&&(f=T(w))&&void 0!==f.pts&&O(f,!1),w={data:[],size:0}),w&&(w.data.push(e.subarray(c,i+188)),w.size+=i+188-c);break;case _:o&&(k&&(f=T(k))&&void 0!==f.pts&&(m.isAAC?A(f):R(f)),k={data:[],size:0}),k&&(k.data.push(e.subarray(c,i+188)),k.size+=i+188-c);break;case b:o&&(S&&(f=T(S))&&void 0!==f.pts&&D(f),S={data:[],size:0}),S&&(S.data.push(e.subarray(c,i+188)),S.size+=i+188-c);break;case 0:o&&(c+=e[c]+1),x=this._pmtId=E(e,c);break;case x:o&&(c+=e[c]+1);var j=C(e,c,!0===this.typeSupported.mpeg||!0===this.typeSupported.mp3,null!=this.sampleAes);(y=j.avc)>0&&(g.pid=y),(_=j.audio)>0&&(m.pid=_,m.isAAC=j.isAAC),(b=j.id3)>0&&(v.pid=b),h&&!p&&(u.logger.log("reparse from beginning"),h=!1,i=P-188),p=this.pmtParsed=!0;break;case 17:case 8191:break;default:h=!0}}else this.observer.trigger(a.default.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});w&&(f=T(w))&&void 0!==f.pts?(O(f,!0),g.pesData=null):g.pesData=w,k&&(f=T(k))&&void 0!==f.pts?(m.isAAC?A(f):R(f),m.pesData=null):(k&&k.size&&u.logger.log("last AAC PES packet truncated,might overlap between fragments"),m.pesData=k),S&&(f=T(S))&&void 0!==f.pts?(D(f),v.pesData=null):v.pesData=S,null==this.sampleAes?this.remuxer.remux(m,g,v,this._txtTrack,t,r,n):this.decryptAndRemux(m,g,v,this._txtTrack,t,r,n)},TSDemuxer.prototype.decryptAndRemux=function(e,t,r,n,i,a,o){if(e.samples&&e.isAAC){var s=this;this.sampleAes.decryptAacSamples(e.samples,0,(function(){s.decryptAndRemuxAvc(e,t,r,n,i,a,o)}))}else this.decryptAndRemuxAvc(e,t,r,n,i,a,o)},TSDemuxer.prototype.decryptAndRemuxAvc=function(e,t,r,n,i,a,o){if(t.samples){var s=this;this.sampleAes.decryptAvcSamples(t.samples,0,0,(function(){s.remuxer.remux(e,t,r,n,i,a,o)}))}else this.remuxer.remux(e,t,r,n,i,a,o)},TSDemuxer.prototype.destroy=function(){this._initPTS=this._initDTS=void 0,this._duration=0},TSDemuxer.prototype._parsePAT=function(e,t){return(31&e[t+10])<<8|e[t+11]},TSDemuxer.prototype._parsePMT=function(e,t,r,n){var i,a,o={audio:-1,avc:-1,id3:-1,isAAC:!0};for(i=t+3+((15&e[t+1])<<8|e[t+2])-4,t+=12+((15&e[t+10])<<8|e[t+11]);t<i;){switch(a=(31&e[t+1])<<8|e[t+2],e[t]){case 207:if(!n){u.logger.log("unkown stream type:"+e[t]);break}case 15:-1===o.audio&&(o.audio=a);break;case 21:-1===o.id3&&(o.id3=a);break;case 219:if(!n){u.logger.log("unkown stream type:"+e[t]);break}case 27:-1===o.avc&&(o.avc=a);break;case 3:case 4:r?-1===o.audio&&(o.audio=a,o.isAAC=!1):u.logger.log("MPEG audio found, not supported in this browser for now");break;case 36:u.logger.warn("HEVC stream type found, not supported for now");break;default:u.logger.log("unkown stream type:"+e[t])}t+=5+((15&e[t+3])<<8|e[t+4])}return o},TSDemuxer.prototype._parsePES=function(e){var t,r,n,i,a,o,s,l,c=0,f=e.data;if(!e||0===e.size)return null;for(;f[0].length<19&&f.length>1;){var d=new Uint8Array(f[0].length+f[1].length);d.set(f[0]),d.set(f[1],f[0].length),f[0]=d,f.splice(1,1)}if(1===((t=f[0])[0]<<16)+(t[1]<<8)+t[2]){if((n=(t[4]<<8)+t[5])&&n>e.size-6)return null;192&(r=t[7])&&(o=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2,64&r?((s=536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2)>4294967295&&(s-=8589934592),o-s>54e5&&(u.logger.warn(Math.round((o-s)/9e4)+"s delta between PTS and DTS, align them"),o=s)):s=o),l=(i=t[8])+9,e.size-=l,a=new Uint8Array(e.size);for(var h=0,p=f.length;h<p;h++){var g=(t=f[h]).byteLength;if(l){if(l>g){l-=g;continue}t=t.subarray(l),g-=l,l=0}a.set(t,c),c+=g}return n&&(n-=i+3),{data:a,pts:o,dts:s,len:n}}return null},TSDemuxer.prototype.pushAccesUnit=function(e,t){if(e.units.length&&e.frame){var r=t.samples,n=r.length;!this.config.forceKeyFrameOnDiscontinuity||!0===e.key||t.sps&&(n||this.contiguous)?(e.id=n,r.push(e)):t.dropped++}e.debug.length&&u.logger.log(e.pts+"/"+e.dts+":"+e.debug)},TSDemuxer.prototype._parseAVCPES=function(e,t){var r,n,i,a=this,s=this._avcTrack,u=this._parseAVCNALu(e.data),l=this.avcSample,c=!1,f=this.pushAccesUnit.bind(this),d=function createAVCSample(e,t,r,n){return{key:e,pts:t,dts:r,units:[],debug:n}};e.data=null,l&&u.length&&!s.audFound&&(f(l,s),l=this.avcSample=d(!1,e.pts,e.dts,"")),u.forEach((function(t){switch(t.type){case 1:n=!0,l||(l=a.avcSample=d(!0,e.pts,e.dts,"")),l.frame=!0;var u=t.data;if(c&&u.length>4){var h=new o.default(u).readSliceType();2!==h&&4!==h&&7!==h&&9!==h||(l.key=!0)}break;case 5:n=!0,l||(l=a.avcSample=d(!0,e.pts,e.dts,"")),l.key=!0,l.frame=!0;break;case 6:n=!0,(r=new o.default(a.discardEPB(t.data))).readUByte();for(var p=0,g=0,m=!1,v=0;!m&&r.bytesAvailable>1;){p=0;do{p+=v=r.readUByte()}while(255===v);g=0;do{g+=v=r.readUByte()}while(255===v);if(4===p&&0!==r.bytesAvailable){if(m=!0,181===r.readUByte())if(49===r.readUShort())if(1195456820===r.readUInt())if(3===r.readUByte()){var y=r.readUByte(),_=31&y,b=[y,r.readUByte()];for(i=0;i<_;i++)b.push(r.readUByte()),b.push(r.readUByte()),b.push(r.readUByte());a._insertSampleInOrder(a._txtTrack.samples,{type:3,pts:e.pts,bytes:b})}}else if(g<r.bytesAvailable)for(i=0;i<g;i++)r.readUByte()}break;case 7:if(n=!0,c=!0,!s.sps){var x=(r=new o.default(t.data)).readSPS();s.width=x.width,s.height=x.height,s.pixelRatio=x.pixelRatio,s.sps=[t.data],s.duration=a._duration;var w=t.data.subarray(1,4),k="avc1.";for(i=0;i<3;i++){var S=w[i].toString(16);S.length<2&&(S="0"+S),k+=S}s.codec=k}break;case 8:n=!0,s.pps||(s.pps=[t.data]);break;case 9:n=!1,s.audFound=!0,l&&f(l,s),l=a.avcSample=d(!1,e.pts,e.dts,"");break;case 12:n=!1;break;default:n=!1,l&&(l.debug+="unknown NAL "+t.type+" ")}l&&n&&l.units.push(t)})),t&&l&&(f(l,s),this.avcSample=null)},TSDemuxer.prototype._insertSampleInOrder=function(e,t){var r=e.length;if(r>0){if(t.pts>=e[r-1].pts)e.push(t);else for(var n=r-1;n>=0;n--)if(t.pts<e[n].pts){e.splice(n,0,t);break}}else e.push(t)},TSDemuxer.prototype._getLastNalUnit=function(){var e,t=this.avcSample;if(!t||0===t.units.length){var r=this._avcTrack.samples;t=r[r.length-1]}if(t){var n=t.units;e=n[n.length-1]}return e},TSDemuxer.prototype._parseAVCNALu=function(e){var t,r,n,i,a=0,o=e.byteLength,s=this._avcTrack,u=s.naluState||0,l=u,c=[],f=-1;for(-1===u&&(f=0,i=31&e[0],u=0,a=1);a<o;)if(t=e[a++],u)if(1!==u)if(t)if(1===t){var d,h;if(f>=0)n={data:e.subarray(f,a-u-1),type:i},c.push(n);else if(d=this._getLastNalUnit())if(l&&a<=4-l&&d.state&&(d.data=d.data.subarray(0,d.data.byteLength-l)),(r=a-u-1)>0)(h=new Uint8Array(d.data.byteLength+r)).set(d.data,0),h.set(e.subarray(0,r),d.data.byteLength),d.data=h;a<o?(f=a,i=31&e[a],u=0):u=-1}else u=0;else u=3;else u=t?0:2;else u=t?0:1;(f>=0&&u>=0&&(n={data:e.subarray(f,o),type:i,state:u},c.push(n)),0===c.length)&&((d=this._getLastNalUnit())&&((h=new Uint8Array(d.data.byteLength+e.byteLength)).set(d.data,0),h.set(e,d.data.byteLength),d.data=h));return s.naluState=u,c},TSDemuxer.prototype.discardEPB=function(e){for(var t,r,n=e.byteLength,i=[],a=1;a<n-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(i.push(a+2),a+=2):a++;if(0===i.length)return e;t=n-i.length,r=new Uint8Array(t);var o=0;for(a=0;a<t;o++,a++)o===i[0]&&(o++,i.shift()),r[a]=e[o];return r},TSDemuxer.prototype._parseAACPES=function(e){var t,r,i,o,s,c=this._audioTrack,f=e.data,d=e.pts,h=this.aacOverFlow,p=this.aacLastPTS;if(h){var g=new Uint8Array(h.byteLength+f.byteLength);g.set(h,0),g.set(f,h.byteLength),f=g}for(i=0,s=f.length;i<s-1&&!n.isHeader(f,i);i++);if(i){var m=void 0,v=void 0;if(i<s-1?(m="AAC PES did not start with ADTS header,offset:"+i,v=!1):(m="no ADTS header found in AAC PES",v=!0),u.logger.warn("parsing error:"+m),this.observer.trigger(a.default.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.FRAG_PARSING_ERROR,fatal:v,reason:m}),v)return}if(n.initTrackConfig(c,this.observer,f,i,this.audioCodec),r=0,t=n.getFrameDuration(c.samplerate),h&&p){var y=p+t;Math.abs(y-d)>1&&(u.logger.log("AAC: align PTS for overlapping frames by "+Math.round((y-d)/90)),d=y)}for(;i<s;)if(n.isHeader(f,i)&&i+5<s){var _=n.appendFrame(c,f,i,d,r);if(!_)break;i+=_.length,o=_.sample.pts,r++}else i++;h=i<s?f.subarray(i,s):null,this.aacOverFlow=h,this.aacLastPTS=o},TSDemuxer.prototype._parseMPEGPES=function(e){for(var t=e.data,r=t.length,n=0,a=0,o=e.pts;a<r;)if(i.default.isHeader(t,a)){var s=i.default.appendFrame(this._audioTrack,t,a,o,n);if(!s)break;a+=s.length,n++}else a++},TSDemuxer.prototype._parseID3PES=function(e){this._id3Track.samples.push(e)},TSDemuxer}();t.default=f},"./src/errors.js":function srcErrorsJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorTypes={NETWORK_ERROR:"networkError",MEDIA_ERROR:"mediaError",KEY_SYSTEM_ERROR:"keySystemError",MUX_ERROR:"muxError",OTHER_ERROR:"otherError"},t.ErrorDetails={KEY_SYSTEM_NO_KEYS:"keySystemNoKeys",KEY_SYSTEM_NO_ACCESS:"keySystemNoAccess",KEY_SYSTEM_NO_SESSION:"keySystemNoSession",KEY_SYSTEM_LICENSE_REQUEST_FAILED:"keySystemLicenseRequestFailed",MANIFEST_LOAD_ERROR:"manifestLoadError",MANIFEST_LOAD_TIMEOUT:"manifestLoadTimeOut",MANIFEST_PARSING_ERROR:"manifestParsingError",MANIFEST_INCOMPATIBLE_CODECS_ERROR:"manifestIncompatibleCodecsError",LEVEL_LOAD_ERROR:"levelLoadError",LEVEL_LOAD_TIMEOUT:"levelLoadTimeOut",LEVEL_SWITCH_ERROR:"levelSwitchError",AUDIO_TRACK_LOAD_ERROR:"audioTrackLoadError",AUDIO_TRACK_LOAD_TIMEOUT:"audioTrackLoadTimeOut",FRAG_LOAD_ERROR:"fragLoadError",FRAG_LOAD_TIMEOUT:"fragLoadTimeOut",FRAG_DECRYPT_ERROR:"fragDecryptError",FRAG_PARSING_ERROR:"fragParsingError",REMUX_ALLOC_ERROR:"remuxAllocError",KEY_LOAD_ERROR:"keyLoadError",KEY_LOAD_TIMEOUT:"keyLoadTimeOut",BUFFER_ADD_CODEC_ERROR:"bufferAddCodecError",BUFFER_APPEND_ERROR:"bufferAppendError",BUFFER_APPENDING_ERROR:"bufferAppendingError",BUFFER_STALLED_ERROR:"bufferStalledError",BUFFER_FULL_ERROR:"bufferFullError",BUFFER_SEEK_OVER_HOLE:"bufferSeekOverHole",BUFFER_NUDGE_ON_STALL:"bufferNudgeOnStall",INTERNAL_EXCEPTION:"internalException"}},"./src/event-handler.js":function srcEventHandlerJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("./src/utils/logger.js"),i=r("./src/errors.js"),a=r("./src/events.js"),o={hlsEventGeneric:!0,hlsHandlerDestroying:!0,hlsHandlerDestroyed:!0},s=function(){function EventHandler(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this.hls=e,this.onEvent=this.onEvent.bind(this),this.handledEvents=t,this.useGenericHandler=!0,this.registerListeners()}return EventHandler.prototype.destroy=function(){this.onHandlerDestroying(),this.unregisterListeners(),this.onHandlerDestroyed()},EventHandler.prototype.onHandlerDestroying=function(){},EventHandler.prototype.onHandlerDestroyed=function(){},EventHandler.prototype.isEventHandler=function(){return"object"===typeof this.handledEvents&&this.handledEvents.length&&"function"===typeof this.onEvent},EventHandler.prototype.registerListeners=function(){this.isEventHandler()&&this.handledEvents.forEach((function(e){if(o[e])throw new Error("Forbidden event-name: "+e);this.hls.on(e,this.onEvent)}),this)},EventHandler.prototype.unregisterListeners=function(){this.isEventHandler()&&this.handledEvents.forEach((function(e){this.hls.off(e,this.onEvent)}),this)},EventHandler.prototype.onEvent=function(e,t){this.onEventGeneric(e,t)},EventHandler.prototype.onEventGeneric=function(e,t){try{(function eventToFunction(e,t){var r="on"+e.replace("hls","");if("function"!==typeof this[r])throw new Error("Event "+e+" has no generic handler in this "+this.constructor.name+" class (tried "+r+")");return this[r].bind(this,t)}).call(this,e,t).call()}catch(r){n.logger.error("An internal error happened while handling event "+e+'. Error message: "'+r.message+'". Here is a stacktrace:',r),this.hls.trigger(a.default.ERROR,{type:i.ErrorTypes.OTHER_ERROR,details:i.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:e,err:r})}},EventHandler}();t.default=s},"./src/events.js":function srcEventsJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={MEDIA_ATTACHING:"hlsMediaAttaching",MEDIA_ATTACHED:"hlsMediaAttached",MEDIA_DETACHING:"hlsMediaDetaching",MEDIA_DETACHED:"hlsMediaDetached",BUFFER_RESET:"hlsBufferReset",BUFFER_CODECS:"hlsBufferCodecs",BUFFER_CREATED:"hlsBufferCreated",BUFFER_APPENDING:"hlsBufferAppending",BUFFER_APPENDED:"hlsBufferAppended",BUFFER_EOS:"hlsBufferEos",BUFFER_FLUSHING:"hlsBufferFlushing",BUFFER_FLUSHED:"hlsBufferFlushed",MANIFEST_LOADING:"hlsManifestLoading",MANIFEST_LOADED:"hlsManifestLoaded",MANIFEST_PARSED:"hlsManifestParsed",LEVEL_SWITCHING:"hlsLevelSwitching",LEVEL_SWITCHED:"hlsLevelSwitched",LEVEL_LOADING:"hlsLevelLoading",LEVEL_LOADED:"hlsLevelLoaded",LEVEL_UPDATED:"hlsLevelUpdated",LEVEL_PTS_UPDATED:"hlsLevelPtsUpdated",AUDIO_TRACKS_UPDATED:"hlsAudioTracksUpdated",AUDIO_TRACK_SWITCHING:"hlsAudioTrackSwitching",AUDIO_TRACK_SWITCHED:"hlsAudioTrackSwitched",AUDIO_TRACK_LOADING:"hlsAudioTrackLoading",AUDIO_TRACK_LOADED:"hlsAudioTrackLoaded",SUBTITLE_TRACKS_UPDATED:"hlsSubtitleTracksUpdated",SUBTITLE_TRACK_SWITCH:"hlsSubtitleTrackSwitch",SUBTITLE_TRACK_LOADING:"hlsSubtitleTrackLoading",SUBTITLE_TRACK_LOADED:"hlsSubtitleTrackLoaded",SUBTITLE_FRAG_PROCESSED:"hlsSubtitleFragProcessed",INIT_PTS_FOUND:"hlsInitPtsFound",FRAG_LOADING:"hlsFragLoading",FRAG_LOAD_PROGRESS:"hlsFragLoadProgress",FRAG_LOAD_EMERGENCY_ABORTED:"hlsFragLoadEmergencyAborted",FRAG_LOADED:"hlsFragLoaded",FRAG_DECRYPTED:"hlsFragDecrypted",FRAG_PARSING_INIT_SEGMENT:"hlsFragParsingInitSegment",FRAG_PARSING_USERDATA:"hlsFragParsingUserdata",FRAG_PARSING_METADATA:"hlsFragParsingMetadata",FRAG_PARSING_DATA:"hlsFragParsingData",FRAG_PARSED:"hlsFragParsed",FRAG_BUFFERED:"hlsFragBuffered",FRAG_CHANGED:"hlsFragChanged",FPS_DROP:"hlsFpsDrop",FPS_DROP_LEVEL_CAPPING:"hlsFpsDropLevelCapping",ERROR:"hlsError",DESTROYING:"hlsDestroying",KEY_LOADING:"hlsKeyLoading",KEY_LOADED:"hlsKeyLoaded",STREAM_STATE_TRANSITION:"hlsStreamStateTransition"}},"./src/hls.js":function srcHlsJs(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function __(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(__.prototype=r.prototype,new __)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=r("./node_modules/url-toolkit/src/url-toolkit.js"),a=r("./src/errors.js"),o=r("./src/loader/playlist-loader.js"),s=r("./src/loader/fragment-loader.js"),u=r("./src/loader/key-loader.js"),l=r("./src/controller/fragment-tracker.js"),c=r("./src/controller/stream-controller.js"),f=r("./src/controller/level-controller.js"),d=r("./src/controller/id3-track-controller.js"),h=r("./src/is-supported.js"),p=r("./src/utils/logger.js"),g=r("./src/config.js"),m=r("./src/events.js"),v=function(e){function Hls(t){void 0===t&&(t={});var r=e.call(this)||this,n=Hls.DefaultConfig;if((t.liveSyncDurationCount||t.liveMaxLatencyDurationCount)&&(t.liveSyncDuration||t.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");for(var i in n)i in t||(t[i]=n[i]);if(void 0!==t.liveMaxLatencyDurationCount&&t.liveMaxLatencyDurationCount<=t.liveSyncDurationCount)throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be gt "liveSyncDurationCount"');if(void 0!==t.liveMaxLatencyDuration&&(t.liveMaxLatencyDuration<=t.liveSyncDuration||void 0===t.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be gt "liveSyncDuration"');p.enableLogs(t.debug),r.config=t,r._autoLevelCapping=-1;var a=r.abrController=new t.abrController(r),h=new t.bufferController(r),g=new t.capLevelController(r),m=new t.fpsController(r),v=new o.default(r),y=new s.default(r),_=new u.default(r),b=new d.default(r),x=r.levelController=new f.default(r),w=new l.FragmentTracker(r),k=[x,r.streamController=new c.default(r,w)],S=t.audioStreamController;S&&k.push(new S(r,w)),r.networkControllers=k;var E=[v,y,_,a,h,g,m,b,w];if(S=t.audioTrackController){var C=new S(r);r.audioTrackController=C,E.push(C)}if(S=t.subtitleTrackController){var T=new S(r);r.subtitleTrackController=T,k.push(T)}if(S=t.emeController){var O=new S(r);r.emeController=O,E.push(O)}return(S=t.subtitleStreamController)&&k.push(new S(r,w)),(S=t.timelineController)&&E.push(new S(r)),r.coreComponents=E,r}return n(Hls,e),Object.defineProperty(Hls,"version",{get:function get(){return"0.12.6"},enumerable:!0,configurable:!0}),Hls.isSupported=function(){return h.isSupported()},Object.defineProperty(Hls,"Events",{get:function get(){return m.default},enumerable:!0,configurable:!0}),Object.defineProperty(Hls,"ErrorTypes",{get:function get(){return a.ErrorTypes},enumerable:!0,configurable:!0}),Object.defineProperty(Hls,"ErrorDetails",{get:function get(){return a.ErrorDetails},enumerable:!0,configurable:!0}),Object.defineProperty(Hls,"DefaultConfig",{get:function get(){return Hls.defaultConfig?Hls.defaultConfig:g.hlsDefaultConfig},set:function set(e){Hls.defaultConfig=e},enumerable:!0,configurable:!0}),Hls.prototype.destroy=function(){p.logger.log("destroy"),this.trigger(m.default.DESTROYING),this.detachMedia(),this.coreComponents.concat(this.networkControllers).forEach((function(e){e.destroy()})),this.url=null,this.removeAllListeners(),this._autoLevelCapping=-1},Hls.prototype.attachMedia=function(e){p.logger.log("attachMedia"),this.media=e,this.trigger(m.default.MEDIA_ATTACHING,{media:e})},Hls.prototype.detachMedia=function(){p.logger.log("detachMedia"),this.trigger(m.default.MEDIA_DETACHING),this.media=null},Hls.prototype.loadSource=function(e){e=i.buildAbsoluteURL(window.location.href,e,{alwaysNormalize:!0}),p.logger.log("loadSource:"+e),this.url=e,this.trigger(m.default.MANIFEST_LOADING,{url:e})},Hls.prototype.startLoad=function(e){void 0===e&&(e=-1),p.logger.log("startLoad("+e+")"),this.networkControllers.forEach((function(t){t.startLoad(e)}))},Hls.prototype.stopLoad=function(){p.logger.log("stopLoad"),this.networkControllers.forEach((function(e){e.stopLoad()}))},Hls.prototype.swapAudioCodec=function(){p.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},Hls.prototype.recoverMediaError=function(){p.logger.log("recoverMediaError");var e=this.media;this.detachMedia(),this.attachMedia(e)},Object.defineProperty(Hls.prototype,"levels",{get:function get(){return this.levelController.levels},enumerable:!0,configurable:!0}),Object.defineProperty(Hls.prototype,"currentLevel",{get:function get(){return this.streamController.currentLevel},set:function set(e){p.logger.log("set currentLevel:"+e),this.loadLevel=e,this.streamController.immediateLevelSwitch()},enumerable:!0,configurable:!0}),Object.defineProperty(Hls.prototype,"nextLevel",{get:function get(){return this.streamController.nextLevel},set:function set(e){p.logger.log("set nextLevel:"+e),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()},enumerable:!0,configurable:!0}),Object.defineProperty(Hls.prototype,"loadLevel",{get:function get(){return this.levelController.level},set:function set(e){p.logger.log("set loadLevel:"+e),this.levelController.manualLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(Hls.prototype,"nextLoadLevel",{get:function get(){return this.levelController.nextLoadLevel},set:function set(e){this.levelController.nextLoadLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(Hls.prototype,"firstLevel",{get:function get(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function set(e){p.logger.log("set firstLevel:"+e),this.levelController.firstLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(Hls.prototype,"startLevel",{get:function get(){return this.levelController.startLevel},set:function set(e){p.logger.log("set startLevel:"+e);-1!==e&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(Hls.prototype,"autoLevelCapping",{get:function get(){return this._autoLevelCapping},set:function set(e){p.logger.log("set autoLevelCapping:"+e),this._autoLevelCapping=e},enumerable:!0,configurable:!0}),Object.defineProperty(Hls.prototype,"autoLevelEnabled",{get:function get(){return-1===this.levelController.manualLevel},enumerable:!0,configurable:!0}),Object.defineProperty(Hls.prototype,"manualLevel",{get:function get(){return this.levelController.manualLevel},enumerable:!0,configurable:!0}),Object.defineProperty(Hls.prototype,"minAutoLevel",{get:function get(){for(var e=this.levels,t=this.config.minAutoBitrate,r=e?e.length:0,n=0;n<r;n++){if((e[n].realBitrate?Math.max(e[n].realBitrate,e[n].bitrate):e[n].bitrate)>t)return n}return 0},enumerable:!0,configurable:!0}),Object.defineProperty(Hls.prototype,"maxAutoLevel",{get:function get(){var e=this.levels,t=this.autoLevelCapping;return-1===t&&e&&e.length?e.length-1:t},enumerable:!0,configurable:!0}),Object.defineProperty(Hls.prototype,"nextAutoLevel",{get:function get(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function set(e){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,e)},enumerable:!0,configurable:!0}),Object.defineProperty(Hls.prototype,"audioTracks",{get:function get(){var e=this.audioTrackController;return e?e.audioTracks:[]},enumerable:!0,configurable:!0}),Object.defineProperty(Hls.prototype,"audioTrack",{get:function get(){var e=this.audioTrackController;return e?e.audioTrack:-1},set:function set(e){var t=this.audioTrackController;t&&(t.audioTrack=e)},enumerable:!0,configurable:!0}),Object.defineProperty(Hls.prototype,"liveSyncPosition",{get:function get(){return this.streamController.liveSyncPosition},enumerable:!0,configurable:!0}),Object.defineProperty(Hls.prototype,"subtitleTracks",{get:function get(){var e=this.subtitleTrackController;return e?e.subtitleTracks:[]},enumerable:!0,configurable:!0}),Object.defineProperty(Hls.prototype,"subtitleTrack",{get:function get(){var e=this.subtitleTrackController;return e?e.subtitleTrack:-1},set:function set(e){var t=this.subtitleTrackController;t&&(t.subtitleTrack=e)},enumerable:!0,configurable:!0}),Object.defineProperty(Hls.prototype,"subtitleDisplay",{get:function get(){var e=this.subtitleTrackController;return!!e&&e.subtitleDisplay},set:function set(e){var t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)},enumerable:!0,configurable:!0}),Hls}(r("./src/observer.js").Observer);t.default=v},"./src/is-supported.js":function srcIsSupportedJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("./src/utils/mediasource-helper.js");t.isSupported=function isSupported(){var e=n.getMediaSource(),t=window.SourceBuffer||window.WebKitSourceBuffer,r=e&&"function"===typeof e.isTypeSupported&&e.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),i=!t||t.prototype&&"function"===typeof t.prototype.appendBuffer&&"function"===typeof t.prototype.remove;return!!r&&!!i}},"./src/loader/fragment-loader.js":function srcLoaderFragmentLoaderJs(e,t,r){"use strict";(function(e){var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function __(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(__.prototype=r.prototype,new __)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=r("./src/events.js"),a=r("./src/event-handler.js"),o=r("./src/errors.js"),s=r("./src/utils/logger.js"),u=function(t){function FragmentLoader(e){var r=t.call(this,e,i.default.FRAG_LOADING)||this;return r.loaders={},r}return n(FragmentLoader,t),FragmentLoader.prototype.destroy=function(){var e=this.loaders;for(var r in e){var n=e[r];n&&n.destroy()}this.loaders={},t.prototype.destroy.call(this)},FragmentLoader.prototype.onFragLoading=function(t){var r=t.frag,n=r.type,i=this.loaders,a=this.hls.config,o=a.fLoader,u=a.loader;r.loaded=0;var l,c,f,d=i[n];d&&(s.logger.warn("abort previous fragment loader for type: "+n),d.abort()),d=i[n]=r.loader=a.fLoader?new o(a):new u(a),l={url:r.url,frag:r,responseType:"arraybuffer",progressData:!1};var h=r.byteRangeStartOffset,p=r.byteRangeEndOffset;e.isFinite(h)&&e.isFinite(p)&&(l.rangeStart=h,l.rangeEnd=p),c={timeout:a.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:a.fragLoadingMaxRetryTimeout},f={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this),onProgress:this.loadprogress.bind(this)},d.load(l,c,f)},FragmentLoader.prototype.loadsuccess=function(e,t,r,n){void 0===n&&(n=null);var a=e.data,o=r.frag;o.loader=void 0,this.loaders[o.type]=void 0,this.hls.trigger(i.default.FRAG_LOADED,{payload:a,frag:o,stats:t,networkDetails:n})},FragmentLoader.prototype.loaderror=function(e,t,r){void 0===r&&(r=null);var n=t.frag,a=n.loader;a&&a.abort(),this.loaders[n.type]=void 0,this.hls.trigger(i.default.ERROR,{type:o.ErrorTypes.NETWORK_ERROR,details:o.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t.frag,response:e,networkDetails:r})},FragmentLoader.prototype.loadtimeout=function(e,t,r){void 0===r&&(r=null);var n=t.frag,a=n.loader;a&&a.abort(),this.loaders[n.type]=void 0,this.hls.trigger(i.default.ERROR,{type:o.ErrorTypes.NETWORK_ERROR,details:o.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t.frag,networkDetails:r})},FragmentLoader.prototype.loadprogress=function(e,t,r,n){void 0===n&&(n=null);var a=t.frag;a.loaded=e.loaded,this.hls.trigger(i.default.FRAG_LOAD_PROGRESS,{frag:a,stats:e,networkDetails:n})},FragmentLoader}(a.default);t.default=u}).call(this,r("./src/polyfills/number.js").Number)},"./src/loader/fragment.js":function srcLoaderFragmentJs(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r("./node_modules/url-toolkit/src/url-toolkit.js"),i=r("./src/loader/level-key.js"),a=function(){function Fragment(){var e;this._url=null,this._byteRange=null,this._decryptdata=null,this.tagList=[],this.programDateTime=null,this.rawProgramDateTime=null,this._elementaryStreams=((e={})[Fragment.ElementaryStreamTypes.AUDIO]=!1,e[Fragment.ElementaryStreamTypes.VIDEO]=!1,e)}return Object.defineProperty(Fragment,"ElementaryStreamTypes",{get:function get(){return{AUDIO:"audio",VIDEO:"video"}},enumerable:!0,configurable:!0}),Object.defineProperty(Fragment.prototype,"url",{get:function get(){return!this._url&&this.relurl&&(this._url=n.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url},set:function set(e){this._url=e},enumerable:!0,configurable:!0}),Object.defineProperty(Fragment.prototype,"byteRange",{get:function get(){if(!this._byteRange&&!this.rawByteRange)return[];if(this._byteRange)return this._byteRange;var e=[];if(this.rawByteRange){var t=this.rawByteRange.split("@",2);if(1===t.length){var r=this.lastByteRangeEndOffset;e[0]=r||0}else e[0]=parseInt(t[1]);e[1]=parseInt(t[0])+e[0],this._byteRange=e}return e},enumerable:!0,configurable:!0}),Object.defineProperty(Fragment.prototype,"byteRangeStartOffset",{get:function get(){return this.byteRange[0]},enumerable:!0,configurable:!0}),Object.defineProperty(Fragment.prototype,"byteRangeEndOffset",{get:function get(){return this.byteRange[1]},enumerable:!0,configurable:!0}),Object.defineProperty(Fragment.prototype,"decryptdata",{get:function get(){return this._decryptdata||(this._decryptdata=this.fragmentDecryptdataFromLevelkey(this.levelkey,this.sn)),this._decryptdata},enumerable:!0,configurable:!0}),Object.defineProperty(Fragment.prototype,"endProgramDateTime",{get:function get(){if(!e.isFinite(this.programDateTime))return null;var t=e.isFinite(this.duration)?this.duration:0;return this.programDateTime+1e3*t},enumerable:!0,configurable:!0}),Object.defineProperty(Fragment.prototype,"encrypted",{get:function get(){return!(!this.decryptdata||null===this.decryptdata.uri||null!==this.decryptdata.key)},enumerable:!0,configurable:!0}),Fragment.prototype.addElementaryStream=function(e){this._elementaryStreams[e]=!0},Fragment.prototype.hasElementaryStream=function(e){return!0===this._elementaryStreams[e]},Fragment.prototype.createInitializationVector=function(e){for(var t=new Uint8Array(16),r=12;r<16;r++)t[r]=e>>8*(15-r)&255;return t},Fragment.prototype.fragmentDecryptdataFromLevelkey=function(e,t){var r=e;return e&&e.method&&e.uri&&!e.iv&&((r=new i.default).method=e.method,r.baseuri=e.baseuri,r.reluri=e.reluri,r.iv=this.createInitializationVector(t)),r},Fragment}();t.default=a}).call(this,r("./src/polyfills/number.js").Number)},"./src/loader/key-loader.js":function srcLoaderKeyLoaderJs(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function __(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(__.prototype=r.prototype,new __)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=r("./src/events.js"),a=r("./src/event-handler.js"),o=r("./src/errors.js"),s=r("./src/utils/logger.js"),u=function(e){function KeyLoader(t){var r=e.call(this,t,i.default.KEY_LOADING)||this;return r.loaders={},r.decryptkey=null,r.decrypturl=null,r}return n(KeyLoader,e),KeyLoader.prototype.destroy=function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy()}this.loaders={},a.default.prototype.destroy.call(this)},KeyLoader.prototype.onKeyLoading=function(e){var t=e.frag,r=t.type,n=this.loaders[r],a=t.decryptdata,o=a.uri;if(o!==this.decrypturl||null===this.decryptkey){var u=this.hls.config;n&&(s.logger.warn("abort previous key loader for type:"+r),n.abort()),t.loader=this.loaders[r]=new u.loader(u),this.decrypturl=o,this.decryptkey=null;var l,c,f;l={url:o,frag:t,responseType:"arraybuffer"},c={timeout:u.fragLoadingTimeOut,maxRetry:0,retryDelay:u.fragLoadingRetryDelay,maxRetryDelay:u.fragLoadingMaxRetryTimeout},f={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)},t.loader.load(l,c,f)}else this.decryptkey&&(a.key=this.decryptkey,this.hls.trigger(i.default.KEY_LOADED,{frag:t}))},KeyLoader.prototype.loadsuccess=function(e,t,r){var n=r.frag;this.decryptkey=n.decryptdata.key=new Uint8Array(e.data),n.loader=void 0,this.loaders[n.type]=void 0,this.hls.trigger(i.default.KEY_LOADED,{frag:n})},KeyLoader.prototype.loaderror=function(e,t){var r=t.frag,n=r.loader;n&&n.abort(),this.loaders[t.type]=void 0,this.hls.trigger(i.default.ERROR,{type:o.ErrorTypes.NETWORK_ERROR,details:o.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:r,response:e})},KeyLoader.prototype.loadtimeout=function(e,t){var r=t.frag,n=r.loader;n&&n.abort(),this.loaders[t.type]=void 0,this.hls.trigger(i.default.ERROR,{type:o.ErrorTypes.NETWORK_ERROR,details:o.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:r})},KeyLoader}(a.default);t.default=u},"./src/loader/level-key.js":function srcLoaderLevelKeyJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("./node_modules/url-toolkit/src/url-toolkit.js"),i=function(){function LevelKey(){this.method=null,this.key=null,this.iv=null,this._uri=null}return Object.defineProperty(LevelKey.prototype,"uri",{get:function get(){return!this._uri&&this.reluri&&(this._uri=n.buildAbsoluteURL(this.baseuri,this.reluri,{alwaysNormalize:!0})),this._uri},enumerable:!0,configurable:!0}),LevelKey}();t.default=i},"./src/loader/level.js":function srcLoaderLevelJs(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function Level(e){this.endCC=0,this.endSN=0,this.fragments=[],this.initSegment=null,this.live=!0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=e,this.version=null}return Object.defineProperty(Level.prototype,"hasProgramDateTime",{get:function get(){return!(!this.fragments[0]||!e.isFinite(this.fragments[0].programDateTime))},enumerable:!0,configurable:!0}),Level}();t.default=r}).call(this,r("./src/polyfills/number.js").Number)},"./src/loader/m3u8-parser.js":function srcLoaderM3u8ParserJs(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r("./node_modules/url-toolkit/src/url-toolkit.js"),i=r("./src/loader/fragment.js"),a=r("./src/loader/level.js"),o=r("./src/loader/level-key.js"),s=r("./src/utils/attr-list.js"),u=r("./src/utils/logger.js"),l=r("./src/utils/codecs.js"),c=/#EXT-X-STREAM-INF:([^\n\r]*)[\r\n]+([^\r\n]+)/g,f=/#EXT-X-MEDIA:(.*)/g,d=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/|(?!#)([\S+ ?]+)/.source,/|#EXT-X-BYTERANGE:*(.+)/.source,/|#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/|#.*/.source].join(""),"g"),h=/(?:(?:#(EXTM3U))|(?:#EXT-X-(PLAYLIST-TYPE):(.+))|(?:#EXT-X-(MEDIA-SEQUENCE): *(\d+))|(?:#EXT-X-(TARGETDURATION): *(\d+))|(?:#EXT-X-(KEY):(.+))|(?:#EXT-X-(START):(.+))|(?:#EXT-X-(ENDLIST))|(?:#EXT-X-(DISCONTINUITY-SEQ)UENCE:(\d+))|(?:#EXT-X-(DIS)CONTINUITY))|(?:#EXT-X-(VERSION):(\d+))|(?:#EXT-X-(MAP):(.+))|(?:(#)([^:]*):(.*))|(?:(#)(.*))(?:.*)\r?\n?/,p=/\.(mp4|m4s|m4v|m4a)$/i,g=function(){function M3U8Parser(){}return M3U8Parser.findGroup=function(e,t){if(!e)return null;for(var r=null,n=0;n<e.length;n++){var i=e[n];i.id===t&&(r=i)}return r},M3U8Parser.convertAVC1ToAVCOTI=function(e){var t,r=e.split(".");return r.length>2?(t=r.shift()+".",t+=parseInt(r.shift()).toString(16),t+=("000"+parseInt(r.shift()).toString(16)).substr(-4)):t=e,t},M3U8Parser.resolve=function(e,t){return n.buildAbsoluteURL(t,e,{alwaysNormalize:!0})},M3U8Parser.parseMasterPlaylist=function(e,t){var r,n=[];function setCodecs(e,t){["video","audio"].forEach((function(r){var n=e.filter((function(e){return l.isCodecType(e,r)}));if(n.length){var i=n.filter((function(e){return 0===e.lastIndexOf("avc1",0)||0===e.lastIndexOf("mp4a",0)}));t[r+"Codec"]=i.length>0?i[0]:n[0],e=e.filter((function(e){return-1===n.indexOf(e)}))}})),t.unknownCodecs=e}for(c.lastIndex=0;null!=(r=c.exec(e));){var i={},a=i.attrs=new s.default(r[1]);i.url=M3U8Parser.resolve(r[2],t);var o=a.decimalResolution("RESOLUTION");o&&(i.width=o.width,i.height=o.height),i.bitrate=a.decimalInteger("AVERAGE-BANDWIDTH")||a.decimalInteger("BANDWIDTH"),i.name=a.NAME,setCodecs([].concat((a.CODECS||"").split(/[ ,]+/)),i),i.videoCodec&&-1!==i.videoCodec.indexOf("avc1")&&(i.videoCodec=M3U8Parser.convertAVC1ToAVCOTI(i.videoCodec)),n.push(i)}return n},M3U8Parser.parseMasterPlaylistMedia=function(e,t,r,n){var i;void 0===n&&(n=[]);var a=[],o=0;for(f.lastIndex=0;null!==(i=f.exec(e));){var u={},l=new s.default(i[1]);if(l.TYPE===r){if(u.groupId=l["GROUP-ID"],u.name=l.NAME,u.type=r,u.default="YES"===l.DEFAULT,u.autoselect="YES"===l.AUTOSELECT,u.forced="YES"===l.FORCED,l.URI&&(u.url=M3U8Parser.resolve(l.URI,t)),u.lang=l.LANGUAGE,u.name||(u.name=u.lang),n.length){var c=M3U8Parser.findGroup(n,u.groupId);u.audioCodec=c?c.codec:n[0].codec}u.id=o++,a.push(u)}}return a},M3U8Parser.parseLevelPlaylist=function(t,r,n,l,c){var f,g,m=0,v=0,y=new a.default(r),_=new o.default,b=0,x=null,w=new i.default,k=null;for(d.lastIndex=0;null!==(f=d.exec(t));){var S=f[1];if(S){w.duration=parseFloat(S);var E=(" "+f[2]).slice(1);w.title=E||null,w.tagList.push(E?["INF",S,E]:["INF",S])}else if(f[3]){if(e.isFinite(w.duration)){var C=m++;w.type=l,w.start=v,w.levelkey=_,w.sn=C,w.level=n,w.cc=b,w.urlId=c,w.baseurl=r,w.relurl=(" "+f[3]).slice(1),assignProgramDateTime(w,x),y.fragments.push(w),x=w,v+=w.duration,w=new i.default}}else if(f[4]){if(w.rawByteRange=(" "+f[4]).slice(1),x){var T=x.byteRangeEndOffset;T&&(w.lastByteRangeEndOffset=T)}}else if(f[5])w.rawProgramDateTime=(" "+f[5]).slice(1),w.tagList.push(["PROGRAM-DATE-TIME",w.rawProgramDateTime]),null===k&&(k=y.fragments.length);else{for(f=f[0].match(h),g=1;g<f.length&&void 0===f[g];g++);var O=(" "+f[g+1]).slice(1),A=(" "+f[g+2]).slice(1);switch(f[g]){case"#":w.tagList.push(A?[O,A]:[O]);break;case"PLAYLIST-TYPE":y.type=O.toUpperCase();break;case"MEDIA-SEQUENCE":m=y.startSN=parseInt(O);break;case"TARGETDURATION":y.targetduration=parseFloat(O);break;case"VERSION":y.version=parseInt(O);break;case"EXTM3U":break;case"ENDLIST":y.live=!1;break;case"DIS":b++,w.tagList.push(["DIS"]);break;case"DISCONTINUITY-SEQ":b=parseInt(O);break;case"KEY":var R=O,D=new s.default(R),P=D.enumeratedString("METHOD"),j=D.URI,M=D.hexadecimalInteger("IV");P&&(_=new o.default,j&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(P)>=0&&(_.method=P,_.baseuri=r,_.reluri=j,_.key=null,_.iv=M));break;case"START":var F=O,I=new s.default(F).decimalFloatingPoint("TIME-OFFSET");e.isFinite(I)&&(y.startTimeOffset=I);break;case"MAP":var L=new s.default(O);w.relurl=L.URI,w.rawByteRange=L.BYTERANGE,w.baseurl=r,w.level=n,w.type=l,w.sn="initSegment",y.initSegment=w,(w=new i.default).rawProgramDateTime=y.initSegment.rawProgramDateTime;break;default:u.logger.warn("line parsed but not handled: "+f)}}}return(w=x)&&!w.relurl&&(y.fragments.pop(),v-=w.duration),y.totalduration=v,y.averagetargetduration=v/y.fragments.length,y.endSN=m-1,y.startCC=y.fragments[0]?y.fragments[0].cc:0,y.endCC=b,!y.initSegment&&y.fragments.length&&y.fragments.every((function(e){return p.test(e.relurl)}))&&(u.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),(w=new i.default).relurl=y.fragments[0].relurl,w.baseurl=r,w.level=n,w.type=l,w.sn="initSegment",y.initSegment=w,y.needSidxRanges=!0),k&&function backfillProgramDateTimes(e,t){for(var r=e[t],n=t-1;n>=0;n--){var i=e[n];i.programDateTime=r.programDateTime-1e3*i.duration,r=i}}(y.fragments,k),y},M3U8Parser}();function assignProgramDateTime(t,r){t.rawProgramDateTime?t.programDateTime=Date.parse(t.rawProgramDateTime):r&&r.programDateTime&&(t.programDateTime=r.endProgramDateTime),e.isFinite(t.programDateTime)||(t.programDateTime=null,t.rawProgramDateTime=null)}t.default=g}).call(this,r("./src/polyfills/number.js").Number)},"./src/loader/playlist-loader.js":function srcLoaderPlaylistLoaderJs(e,t,r){"use strict";(function(e){var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function __(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(__.prototype=r.prototype,new __)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=r("./src/events.js"),a=r("./src/event-handler.js"),o=r("./src/errors.js"),s=r("./src/utils/logger.js"),u=r("./src/demux/mp4demuxer.js"),l=r("./src/loader/m3u8-parser.js"),c=window.performance,f={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},d={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"},h=function(t){function PlaylistLoader(e){var r=t.call(this,e,i.default.MANIFEST_LOADING,i.default.LEVEL_LOADING,i.default.AUDIO_TRACK_LOADING,i.default.SUBTITLE_TRACK_LOADING)||this;return r.loaders={},r}return n(PlaylistLoader,t),Object.defineProperty(PlaylistLoader,"ContextType",{get:function get(){return f},enumerable:!0,configurable:!0}),Object.defineProperty(PlaylistLoader,"LevelType",{get:function get(){return d},enumerable:!0,configurable:!0}),PlaylistLoader.canHaveQualityLevels=function(e){return e!==f.AUDIO_TRACK&&e!==f.SUBTITLE_TRACK},PlaylistLoader.mapContextToLevelType=function(e){switch(e.type){case f.AUDIO_TRACK:return d.AUDIO;case f.SUBTITLE_TRACK:return d.SUBTITLE;default:return d.MAIN}},PlaylistLoader.getResponseUrl=function(e,t){var r=e.url;return void 0!==r&&0!==r.indexOf("data:")||(r=t.url),r},PlaylistLoader.prototype.createInternalLoader=function(e){var t=this.hls.config,r=t.pLoader,n=t.loader,i=new(r||n)(t);return e.loader=i,this.loaders[e.type]=i,i},PlaylistLoader.prototype.getInternalLoader=function(e){return this.loaders[e.type]},PlaylistLoader.prototype.resetInternalLoader=function(e){this.loaders[e]&&delete this.loaders[e]},PlaylistLoader.prototype.destroyInternalLoaders=function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}},PlaylistLoader.prototype.destroy=function(){this.destroyInternalLoaders(),t.prototype.destroy.call(this)},PlaylistLoader.prototype.onManifestLoading=function(e){this.load(e.url,{type:f.MANIFEST,level:0,id:null})},PlaylistLoader.prototype.onLevelLoading=function(e){this.load(e.url,{type:f.LEVEL,level:e.level,id:e.id})},PlaylistLoader.prototype.onAudioTrackLoading=function(e){this.load(e.url,{type:f.AUDIO_TRACK,level:null,id:e.id})},PlaylistLoader.prototype.onSubtitleTrackLoading=function(e){this.load(e.url,{type:f.SUBTITLE_TRACK,level:null,id:e.id})},PlaylistLoader.prototype.load=function(e,t){var r=this.hls.config;s.logger.debug("Loading playlist of type "+t.type+", level: "+t.level+", id: "+t.id);var n,i,a,o,u=this.getInternalLoader(t);if(u){var l=u.context;if(l&&l.url===e)return s.logger.trace("playlist request ongoing"),!1;s.logger.warn("aborting previous loader for type: "+t.type),u.abort()}switch(t.type){case f.MANIFEST:n=r.manifestLoadingMaxRetry,i=r.manifestLoadingTimeOut,a=r.manifestLoadingRetryDelay,o=r.manifestLoadingMaxRetryTimeout;break;case f.LEVEL:n=0,i=r.levelLoadingTimeOut;break;default:n=r.levelLoadingMaxRetry,i=r.levelLoadingTimeOut,a=r.levelLoadingRetryDelay,o=r.levelLoadingMaxRetryTimeout}u=this.createInternalLoader(t),t.url=e,t.responseType=t.responseType||"";var c={timeout:i,maxRetry:n,retryDelay:a,maxRetryDelay:o},d={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};return s.logger.debug("Calling internal loader delegate for URL: "+e),u.load(t,c,d),!0},PlaylistLoader.prototype.loadsuccess=function(e,t,r,n){if(void 0===n&&(n=null),r.isSidxRequest)return this._handleSidxRequest(e,r),void this._handlePlaylistLoaded(e,t,r,n);this.resetInternalLoader(r.type);var i=e.data;t.tload=c.now(),0===i.indexOf("#EXTM3U")?i.indexOf("#EXTINF:")>0||i.indexOf("#EXT-X-TARGETDURATION:")>0?this._handleTrackOrLevelPlaylist(e,t,r,n):this._handleMasterPlaylist(e,t,r,n):this._handleManifestParsingError(e,r,"no EXTM3U delimiter",n)},PlaylistLoader.prototype.loaderror=function(e,t,r){void 0===r&&(r=null),this._handleNetworkError(t,r,!1,e)},PlaylistLoader.prototype.loadtimeout=function(e,t,r){void 0===r&&(r=null),this._handleNetworkError(t,r,!0)},PlaylistLoader.prototype._handleMasterPlaylist=function(e,t,r,n){var a=this.hls,o=e.data,u=PlaylistLoader.getResponseUrl(e,r),c=l.default.parseMasterPlaylist(o,u);if(c.length){var f=c.map((function(e){return{id:e.attrs.AUDIO,codec:e.audioCodec}})),d=l.default.parseMasterPlaylistMedia(o,u,"AUDIO",f),h=l.default.parseMasterPlaylistMedia(o,u,"SUBTITLES");if(d.length){var p=!1;d.forEach((function(e){e.url||(p=!0)})),!1===p&&c[0].audioCodec&&!c[0].attrs.AUDIO&&(s.logger.log("audio codec signaled in quality level, but no embedded audio track signaled, create one"),d.unshift({type:"main",name:"main"}))}a.trigger(i.default.MANIFEST_LOADED,{levels:c,audioTracks:d,subtitles:h,url:u,stats:t,networkDetails:n})}else this._handleManifestParsingError(e,r,"no level found in manifest",n)},PlaylistLoader.prototype._handleTrackOrLevelPlaylist=function(t,r,n,a){var o=this.hls,s=n.id,u=n.level,d=n.type,h=PlaylistLoader.getResponseUrl(t,n),p=e.isFinite(s)?s:0,g=e.isFinite(u)?u:p,m=PlaylistLoader.mapContextToLevelType(n),v=l.default.parseLevelPlaylist(t.data,h,g,m,p);if(v.tload=r.tload,d===f.MANIFEST){var y={url:h,details:v};o.trigger(i.default.MANIFEST_LOADED,{levels:[y],audioTracks:[],url:h,stats:r,networkDetails:a})}if(r.tparsed=c.now(),v.needSidxRanges){var _=v.initSegment.url;this.load(_,{isSidxRequest:!0,type:d,level:u,levelDetails:v,id:s,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer"})}else n.levelDetails=v,this._handlePlaylistLoaded(t,r,n,a)},PlaylistLoader.prototype._handleSidxRequest=function(e,t){var r=u.default.parseSegmentIndex(new Uint8Array(e.data));if(r){var n=r.references,i=t.levelDetails;n.forEach((function(e,t){var r=e.info,n=i.fragments[t];0===n.byteRange.length&&(n.rawByteRange=String(1+r.end-r.start)+"@"+String(r.start))})),i.initSegment.rawByteRange=String(r.moovEndOffset)+"@0"}},PlaylistLoader.prototype._handleManifestParsingError=function(e,t,r,n){this.hls.trigger(i.default.ERROR,{type:o.ErrorTypes.NETWORK_ERROR,details:o.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:e.url,reason:r,networkDetails:n})},PlaylistLoader.prototype._handleNetworkError=function(e,t,r,n){var a,u;void 0===r&&(r=!1),void 0===n&&(n=null),s.logger.info("A network error occured while loading a "+e.type+"-type playlist");var l=this.getInternalLoader(e);switch(e.type){case f.MANIFEST:a=r?o.ErrorDetails.MANIFEST_LOAD_TIMEOUT:o.ErrorDetails.MANIFEST_LOAD_ERROR,u=!0;break;case f.LEVEL:a=r?o.ErrorDetails.LEVEL_LOAD_TIMEOUT:o.ErrorDetails.LEVEL_LOAD_ERROR,u=!1;break;case f.AUDIO_TRACK:a=r?o.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:o.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,u=!1;break;default:u=!1}l&&(l.abort(),this.resetInternalLoader(e.type));var c={type:o.ErrorTypes.NETWORK_ERROR,details:a,fatal:u,url:l.url,loader:l,context:e,networkDetails:t};n&&(c.response=n),this.hls.trigger(i.default.ERROR,c)},PlaylistLoader.prototype._handlePlaylistLoaded=function(e,t,r,n){var a=r.type,o=r.level,s=r.id,u=r.levelDetails;if(u.targetduration)if(PlaylistLoader.canHaveQualityLevels(r.type))this.hls.trigger(i.default.LEVEL_LOADED,{details:u,level:o||0,id:s||0,stats:t,networkDetails:n});else switch(a){case f.AUDIO_TRACK:this.hls.trigger(i.default.AUDIO_TRACK_LOADED,{details:u,id:s,stats:t,networkDetails:n});break;case f.SUBTITLE_TRACK:this.hls.trigger(i.default.SUBTITLE_TRACK_LOADED,{details:u,id:s,stats:t,networkDetails:n})}else this._handleManifestParsingError(e,r,"invalid target duration",n)},PlaylistLoader}(a.default);t.default=h}).call(this,r("./src/polyfills/number.js").Number)},"./src/observer.js":function srcObserverJs(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function __(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(__.prototype=r.prototype,new __)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function Observer(){return null!==e&&e.apply(this,arguments)||this}return n(Observer,e),Observer.prototype.trigger=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this.emit.apply(this,[e,e].concat(t))},Observer}(r("./node_modules/eventemitter3/index.js").EventEmitter);t.Observer=i},"./src/polyfills/number.js":function srcPolyfillsNumberJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("./src/utils/get-self-scope.js").getSelfScope().Number;t.Number=n,n.isFinite=n.isFinite||function(e){return"number"===typeof e&&isFinite(e)}},"./src/remux/aac-helper.js":function srcRemuxAacHelperJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function AAC(){}return AAC.getSilentFrame=function(e,t){switch(e){case"mp4a.40.2":if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null},AAC}();t.default=n},"./src/remux/mp4-generator.js":function srcRemuxMp4GeneratorJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Math.pow(2,32)-1,i=function(){function MP4(){}return MP4.init=function(){var e;for(e in MP4.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]},MP4.types)MP4.types.hasOwnProperty(e)&&(MP4.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);var t=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),r=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);MP4.HDLR_TYPES={video:t,audio:r};var n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),i=new Uint8Array([0,0,0,0,0,0,0,0]);MP4.STTS=MP4.STSC=MP4.STCO=i,MP4.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),MP4.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),MP4.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),MP4.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var a=new Uint8Array([105,115,111,109]),o=new Uint8Array([97,118,99,49]),s=new Uint8Array([0,0,0,1]);MP4.FTYP=MP4.box(MP4.types.ftyp,a,s,a,o),MP4.DINF=MP4.box(MP4.types.dinf,MP4.box(MP4.types.dref,n))},MP4.box=function(e){for(var t,r=Array.prototype.slice.call(arguments,1),n=8,i=r.length,a=i;i--;)n+=r[i].byteLength;for((t=new Uint8Array(n))[0]=n>>24&255,t[1]=n>>16&255,t[2]=n>>8&255,t[3]=255&n,t.set(e,4),i=0,n=8;i<a;i++)t.set(r[i],n),n+=r[i].byteLength;return t},MP4.hdlr=function(e){return MP4.box(MP4.types.hdlr,MP4.HDLR_TYPES[e])},MP4.mdat=function(e){return MP4.box(MP4.types.mdat,e)},MP4.mdhd=function(e,t){t*=e;var r=Math.floor(t/(n+1)),i=Math.floor(t%(n+1));return MP4.box(MP4.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,r>>24,r>>16&255,r>>8&255,255&r,i>>24,i>>16&255,i>>8&255,255&i,85,196,0,0]))},MP4.mdia=function(e){return MP4.box(MP4.types.mdia,MP4.mdhd(e.timescale,e.duration),MP4.hdlr(e.type),MP4.minf(e))},MP4.mfhd=function(e){return MP4.box(MP4.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e]))},MP4.minf=function(e){return"audio"===e.type?MP4.box(MP4.types.minf,MP4.box(MP4.types.smhd,MP4.SMHD),MP4.DINF,MP4.stbl(e)):MP4.box(MP4.types.minf,MP4.box(MP4.types.vmhd,MP4.VMHD),MP4.DINF,MP4.stbl(e))},MP4.moof=function(e,t,r){return MP4.box(MP4.types.moof,MP4.mfhd(e),MP4.traf(r,t))},MP4.moov=function(e){for(var t=e.length,r=[];t--;)r[t]=MP4.trak(e[t]);return MP4.box.apply(null,[MP4.types.moov,MP4.mvhd(e[0].timescale,e[0].duration)].concat(r).concat(MP4.mvex(e)))},MP4.mvex=function(e){for(var t=e.length,r=[];t--;)r[t]=MP4.trex(e[t]);return MP4.box.apply(null,[MP4.types.mvex].concat(r))},MP4.mvhd=function(e,t){t*=e;var r=Math.floor(t/(n+1)),i=Math.floor(t%(n+1)),a=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,r>>24,r>>16&255,r>>8&255,255&r,i>>24,i>>16&255,i>>8&255,255&i,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return MP4.box(MP4.types.mvhd,a)},MP4.sdtp=function(e){var t,r,n=e.samples||[],i=new Uint8Array(4+n.length);for(r=0;r<n.length;r++)t=n[r].flags,i[r+4]=t.dependsOn<<4|t.isDependedOn<<2|t.hasRedundancy;return MP4.box(MP4.types.sdtp,i)},MP4.stbl=function(e){return MP4.box(MP4.types.stbl,MP4.stsd(e),MP4.box(MP4.types.stts,MP4.STTS),MP4.box(MP4.types.stsc,MP4.STSC),MP4.box(MP4.types.stsz,MP4.STSZ),MP4.box(MP4.types.stco,MP4.STCO))},MP4.avc1=function(e){var t,r,n,i=[],a=[];for(t=0;t<e.sps.length;t++)n=(r=e.sps[t]).byteLength,i.push(n>>>8&255),i.push(255&n),i=i.concat(Array.prototype.slice.call(r));for(t=0;t<e.pps.length;t++)n=(r=e.pps[t]).byteLength,a.push(n>>>8&255),a.push(255&n),a=a.concat(Array.prototype.slice.call(r));var o=MP4.box(MP4.types.avcC,new Uint8Array([1,i[3],i[4],i[5],255,224|e.sps.length].concat(i).concat([e.pps.length]).concat(a))),s=e.width,u=e.height,l=e.pixelRatio[0],c=e.pixelRatio[1];return MP4.box(MP4.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,s>>8&255,255&s,u>>8&255,255&u,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,MP4.box(MP4.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),MP4.box(MP4.types.pasp,new Uint8Array([l>>24,l>>16&255,l>>8&255,255&l,c>>24,c>>16&255,c>>8&255,255&c])))},MP4.esds=function(e){var t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))},MP4.mp4a=function(e){var t=e.samplerate;return MP4.box(MP4.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,t>>8&255,255&t,0,0]),MP4.box(MP4.types.esds,MP4.esds(e)))},MP4.mp3=function(e){var t=e.samplerate;return MP4.box(MP4.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,t>>8&255,255&t,0,0]))},MP4.stsd=function(e){return"audio"===e.type?e.isAAC||"mp3"!==e.codec?MP4.box(MP4.types.stsd,MP4.STSD,MP4.mp4a(e)):MP4.box(MP4.types.stsd,MP4.STSD,MP4.mp3(e)):MP4.box(MP4.types.stsd,MP4.STSD,MP4.avc1(e))},MP4.tkhd=function(e){var t=e.id,r=e.duration*e.timescale,i=e.width,a=e.height,o=Math.floor(r/(n+1)),s=Math.floor(r%(n+1));return MP4.box(MP4.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,0,0,0,0,o>>24,o>>16&255,o>>8&255,255&o,s>>24,s>>16&255,s>>8&255,255&s,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,i>>8&255,255&i,0,0,a>>8&255,255&a,0,0]))},MP4.traf=function(e,t){var r=MP4.sdtp(e),i=e.id,a=Math.floor(t/(n+1)),o=Math.floor(t%(n+1));return MP4.box(MP4.types.traf,MP4.box(MP4.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i])),MP4.box(MP4.types.tfdt,new Uint8Array([1,0,0,0,a>>24,a>>16&255,a>>8&255,255&a,o>>24,o>>16&255,o>>8&255,255&o])),MP4.trun(e,r.length+16+20+8+16+8+8),r)},MP4.trak=function(e){return e.duration=e.duration||4294967295,MP4.box(MP4.types.trak,MP4.tkhd(e),MP4.mdia(e))},MP4.trex=function(e){var t=e.id;return MP4.box(MP4.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},MP4.trun=function(e,t){var r,n,i,a,o,s,u=e.samples||[],l=u.length,c=12+16*l,f=new Uint8Array(c);for(t+=8+c,f.set([0,0,15,1,l>>>24&255,l>>>16&255,l>>>8&255,255&l,t>>>24&255,t>>>16&255,t>>>8&255,255&t],0),r=0;r<l;r++)i=(n=u[r]).duration,a=n.size,o=n.flags,s=n.cts,f.set([i>>>24&255,i>>>16&255,i>>>8&255,255&i,a>>>24&255,a>>>16&255,a>>>8&255,255&a,o.isLeading<<2|o.dependsOn,o.isDependedOn<<6|o.hasRedundancy<<4|o.paddingValue<<1|o.isNonSync,61440&o.degradPrio,15&o.degradPrio,s>>>24&255,s>>>16&255,s>>>8&255,255&s],12+16*r);return MP4.box(MP4.types.trun,f)},MP4.initSegment=function(e){MP4.types||MP4.init();var t,r=MP4.moov(e);return(t=new Uint8Array(MP4.FTYP.byteLength+r.byteLength)).set(MP4.FTYP),t.set(r,MP4.FTYP.byteLength),t},MP4}();t.default=i},"./src/remux/mp4-remuxer.js":function srcRemuxMp4RemuxerJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("./src/remux/aac-helper.js"),i=r("./src/remux/mp4-generator.js"),a=r("./src/events.js"),o=r("./src/errors.js"),s=r("./src/utils/logger.js"),u=function(){function MP4Remuxer(e,t,r,n){this.observer=e,this.config=t,this.typeSupported=r;var i=navigator.userAgent;this.isSafari=n&&n.indexOf("Apple")>-1&&i&&!i.match("CriOS"),this.ISGenerated=!1}return MP4Remuxer.prototype.destroy=function(){},MP4Remuxer.prototype.resetTimeStamp=function(e){this._initPTS=this._initDTS=e},MP4Remuxer.prototype.resetInitSegment=function(){this.ISGenerated=!1},MP4Remuxer.prototype.remux=function(e,t,r,n,i,o,u){if(this.ISGenerated||this.generateIS(e,t,i),this.ISGenerated){var l=e.samples.length,c=t.samples.length,f=i,d=i;if(l&&c){var h=(e.samples[0].pts-t.samples[0].pts)/t.inputTimeScale;f+=Math.max(0,h),d+=Math.max(0,-h)}if(l){e.timescale||(s.logger.warn("regenerate InitSegment as audio detected"),this.generateIS(e,t,i));var p=this.remuxAudio(e,f,o,u);if(c){var g=void 0;p&&(g=p.endPTS-p.startPTS),t.timescale||(s.logger.warn("regenerate InitSegment as video detected"),this.generateIS(e,t,i)),this.remuxVideo(t,d,o,g,u)}}else if(c){var m=this.remuxVideo(t,d,o,0,u);m&&e.codec&&this.remuxEmptyAudio(e,f,o,m)}}r.samples.length&&this.remuxID3(r,i),n.samples.length&&this.remuxText(n,i),this.observer.trigger(a.default.FRAG_PARSED)},MP4Remuxer.prototype.generateIS=function(e,t,r){var n,u,l=this.observer,c=e.samples,f=t.samples,d=this.typeSupported,h="audio/mp4",p={},g={tracks:p},m=void 0===this._initPTS;if(m&&(n=u=1/0),e.config&&c.length&&(e.timescale=e.samplerate,s.logger.log("audio sampling rate : "+e.samplerate),e.isAAC||(d.mpeg?(h="audio/mpeg",e.codec=""):d.mp3&&(e.codec="mp3")),p.audio={container:h,codec:e.codec,initSegment:!e.isAAC&&d.mpeg?new Uint8Array:i.default.initSegment([e]),metadata:{channelCount:e.channelCount}},m&&(n=u=c[0].pts-e.inputTimeScale*r)),t.sps&&t.pps&&f.length){var v=t.inputTimeScale;t.timescale=v,p.video={container:"video/mp4",codec:t.codec,initSegment:i.default.initSegment([t]),metadata:{width:t.width,height:t.height}},m&&(n=Math.min(n,f[0].pts-v*r),u=Math.min(u,f[0].dts-v*r),this.observer.trigger(a.default.INIT_PTS_FOUND,{initPTS:n}))}Object.keys(p).length?(l.trigger(a.default.FRAG_PARSING_INIT_SEGMENT,g),this.ISGenerated=!0,m&&(this.config.disablePtsDtsCorrectionInMp4Remux?(this._initPTS=0,this._initDTS=0):(this._initPTS=n,this._initDTS=u))):l.trigger(a.default.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"no audio/video samples found"})},MP4Remuxer.prototype.remuxVideo=function(e,t,r,n,u){var l,c,f,d,h,p,g,m=8,v=e.timescale,y=e.samples,_=[],b=y.length,x=this._PTSNormalize,w=this._initPTS,k=this.nextAvcDts,S=this.isSafari;if(0!==b){S&&(r|=y.length&&k&&(u&&Math.abs(t-k/v)<.1||Math.abs(y[0].pts-k-w)<v/5)),r||(k=t*v),y.forEach((function(e){e.pts=x(e.pts-w,k),e.dts=x(e.dts-w,k)})),y.sort((function(e,t){var r=e.dts-t.dts,n=e.pts-t.pts;return r||n||e.id-t.id}));var E=y.reduce((function(e,t){return Math.max(Math.min(e,t.pts-t.dts),-18e3)}),0);if(E<0){s.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Math.round(E/90)+" ms to overcome this issue");for(var C=0;C<y.length;C++)y[C].dts+=E}var T=y[0];h=Math.max(T.dts,0),d=Math.max(T.pts,0);var O=Math.round((h-k)/90);r&&O&&(O>1?s.logger.log("AVC:"+O+" ms hole between fragments detected,filling it"):O<-1&&s.logger.log("AVC:"+-O+" ms overlapping between fragments detected"),h=k,y[0].dts=h,d=Math.max(d-O,k),y[0].pts=d,s.logger.log("Video/PTS/DTS adjusted: "+Math.round(d/90)+"/"+Math.round(h/90)+",delta:"+O+" ms")),T=y[y.length-1],g=Math.max(T.dts,0),p=Math.max(T.pts,0,g),S&&(l=Math.round((g-h)/(y.length-1)));var A=0,R=0;for(C=0;C<b;C++){for(var D=y[C],P=D.units,j=P.length,M=0,F=0;F<j;F++)M+=P[F].data.length;R+=M,A+=j,D.length=M,D.dts=S?h+C*l:Math.max(D.dts,h),D.pts=Math.max(D.pts,D.dts)}var I=R+4*A+8;try{c=new Uint8Array(I)}catch(Z){return void this.observer.trigger(a.default.ERROR,{type:o.ErrorTypes.MUX_ERROR,details:o.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:I,reason:"fail allocating video mdat "+I})}var L=new DataView(c.buffer);L.setUint32(0,I),c.set(i.default.types.mdat,4);for(C=0;C<b;C++){var N=y[C],B=N.units,U=0,z=void 0;for(F=0,j=B.length;F<j;F++){var q=B[F],W=q.data,G=q.data.byteLength;L.setUint32(m,G),m+=4,c.set(W,m),m+=G,U+=4+G}if(S)z=Math.max(0,l*Math.round((N.pts-N.dts)/l));else{if(C<b-1)l=y[C+1].dts-N.dts;else{var H=this.config,V=N.dts-y[C>0?C-1:C].dts;if(H.stretchShortVideoTrack){var Y=H.maxBufferHole,$=Math.floor(Y*v),X=(n?d+n*v:this.nextAudioPts)-N.pts;X>$?((l=X-V)<0&&(l=V),s.logger.log("It is approximately "+X/90+" ms to the next segment; using duration "+l/90+" ms for the last video frame.")):l=V}else l=V}z=Math.round(N.pts-N.dts)}_.push({size:U,duration:l,cts:z,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:N.key?2:1,isNonSync:N.key?0:1}})}this.nextAvcDts=g+l;var K=e.dropped;if(e.len=0,e.nbNalu=0,e.dropped=0,_.length&&navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var J=_[0].flags;J.dependsOn=2,J.isNonSync=0}e.samples=_,f=i.default.moof(e.sequenceNumber++,h,e),e.samples=[];var Q={data1:f,data2:c,startPTS:d/v,endPTS:(p+l)/v,startDTS:h/v,endDTS:this.nextAvcDts/v,type:"video",hasAudio:!1,hasVideo:!0,nb:_.length,dropped:K};return this.observer.trigger(a.default.FRAG_PARSING_DATA,Q),Q}},MP4Remuxer.prototype.remuxAudio=function(e,t,r,u){var l,c,f,d,h,p,g,m=e.inputTimeScale,v=e.timescale,y=m/v,_=(e.isAAC?1024:1152)*y,b=this._PTSNormalize,x=this._initPTS,w=!e.isAAC&&this.typeSupported.mpeg,k=e.samples,S=[],E=this.nextAudioPts;if(r|=k.length&&E&&(u&&Math.abs(t-E/m)<.1||Math.abs(k[0].pts-E-x)<20*_),k.forEach((function(e){e.pts=e.dts=b(e.pts-x,t*m)})),0!==(k=k.filter((function(e){return e.pts>=0}))).length){if(r||(E=u?t*m:k[0].pts),e.isAAC)for(var C=this.config.maxAudioFramesDrift,T=0,O=E;T<k.length;){var A,R=k[T];A=(N=R.pts)-O;var D=Math.abs(1e3*A/m);if(A<=-C*_)s.logger.warn("Dropping 1 audio frame @ "+(O/m).toFixed(3)+"s due to "+Math.round(D)+" ms overlap."),k.splice(T,1),e.len-=R.unit.length;else if(A>=C*_&&D<1e4&&O){var P=Math.round(A/_);s.logger.warn("Injecting "+P+" audio frame @ "+(O/m).toFixed(3)+"s due to "+Math.round(1e3*A/m)+" ms gap.");for(var j=0;j<P;j++){var M=Math.max(O,0);(f=n.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount))||(s.logger.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),f=R.unit.subarray()),k.splice(T,0,{unit:f,pts:M,dts:M}),e.len+=f.length,O+=_,T++}R.pts=R.dts=O,O+=_,T++}else Math.abs(A),R.pts=R.dts=O,O+=_,T++}j=0;for(var F=k.length;j<F;j++){var I=k[j],L=I.unit,N=I.pts;if(void 0!==g)c.duration=Math.round((N-g)/y);else{var B=Math.round(1e3*(N-E)/m),U=0;if(r&&e.isAAC&&B){if(B>0&&B<1e4)U=Math.round((N-E)/_),s.logger.log(B+" ms hole between AAC samples detected,filling it"),U>0&&((f=n.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount))||(f=L.subarray()),e.len+=U*f.length);else if(B<-12){s.logger.log("drop overlapping AAC sample, expected/parsed/delta:"+(E/m).toFixed(3)+"s/"+(N/m).toFixed(3)+"s/"+-B+"ms"),e.len-=L.byteLength;continue}N=E}if(p=N,!(e.len>0))return;var z=w?e.len:e.len+8;l=w?0:8;try{d=new Uint8Array(z)}catch($){return void this.observer.trigger(a.default.ERROR,{type:o.ErrorTypes.MUX_ERROR,details:o.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:z,reason:"fail allocating audio mdat "+z})}w||(new DataView(d.buffer).setUint32(0,z),d.set(i.default.types.mdat,4));for(T=0;T<U;T++)(f=n.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount))||(s.logger.log("Unable to get silent frame for given audio codec; duplicating this frame instead."),f=L.subarray()),d.set(f,l),l+=f.byteLength,c={size:f.byteLength,cts:0,duration:1024,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},S.push(c)}d.set(L,l);var q=L.byteLength;l+=q,c={size:q,cts:0,duration:0,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},S.push(c),g=N}var W=0,G=S.length;if(G>=2&&(W=S[G-2].duration,c.duration=W),G){this.nextAudioPts=E=g+y*W,e.len=0,e.samples=S,h=w?new Uint8Array:i.default.moof(e.sequenceNumber++,p/y,e),e.samples=[];var H=p/m,V=E/m,Y={data1:h,data2:d,startPTS:H,endPTS:V,startDTS:H,endDTS:V,type:"audio",hasAudio:!0,hasVideo:!1,nb:G};return this.observer.trigger(a.default.FRAG_PARSING_DATA,Y),Y}return null}},MP4Remuxer.prototype.remuxEmptyAudio=function(e,t,r,i){var a=e.inputTimeScale,o=a/(e.samplerate?e.samplerate:a),u=this.nextAudioPts,l=(void 0!==u?u:i.startDTS*a)+this._initDTS,c=i.endDTS*a+this._initDTS,f=1024*o,d=Math.ceil((c-l)/f),h=n.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(s.logger.warn("remux empty Audio"),h){for(var p=[],g=0;g<d;g++){var m=l+g*f;p.push({unit:h,pts:m,dts:m}),e.len+=h.length}e.samples=p,this.remuxAudio(e,t,r)}else s.logger.trace("Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!")},MP4Remuxer.prototype.remuxID3=function(e){var t,r=e.samples.length,n=e.inputTimeScale,i=this._initPTS,o=this._initDTS;if(r){for(var s=0;s<r;s++)(t=e.samples[s]).pts=(t.pts-i)/n,t.dts=(t.dts-o)/n;this.observer.trigger(a.default.FRAG_PARSING_METADATA,{samples:e.samples})}e.samples=[]},MP4Remuxer.prototype.remuxText=function(e){e.samples.sort((function(e,t){return e.pts-t.pts}));var t,r=e.samples.length,n=e.inputTimeScale,i=this._initPTS;if(r){for(var o=0;o<r;o++)(t=e.samples[o]).pts=(t.pts-i)/n;this.observer.trigger(a.default.FRAG_PARSING_USERDATA,{samples:e.samples})}e.samples=[]},MP4Remuxer.prototype._PTSNormalize=function(e,t){return e},MP4Remuxer}();t.default=u},"./src/remux/passthrough-remuxer.js":function srcRemuxPassthroughRemuxerJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("./src/events.js"),i=function(){function PassThroughRemuxer(e){this.observer=e}return PassThroughRemuxer.prototype.destroy=function(){},PassThroughRemuxer.prototype.resetTimeStamp=function(){},PassThroughRemuxer.prototype.resetInitSegment=function(){},PassThroughRemuxer.prototype.remux=function(e,t,r,i,a,o,s,u){var l=this.observer,c="";e&&(c+="audio"),t&&(c+="video"),l.trigger(n.default.FRAG_PARSING_DATA,{data1:u,startPTS:a,startDTS:a,type:c,hasAudio:!!e,hasVideo:!!t,nb:1,dropped:0}),l.trigger(n.default.FRAG_PARSED)},PassThroughRemuxer}();t.default=i},"./src/task-loop.js":function srcTaskLoopJs(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function __(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(__.prototype=r.prototype,new __)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function TaskLoop(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var i=e.apply(this,[t].concat(r))||this;return i._tickInterval=null,i._tickTimer=null,i._tickCallCount=0,i._boundTick=i.tick.bind(i),i}return n(TaskLoop,e),TaskLoop.prototype.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},TaskLoop.prototype.hasInterval=function(){return!!this._tickInterval},TaskLoop.prototype.hasNextTick=function(){return!!this._tickTimer},TaskLoop.prototype.setInterval=function(e){return!this._tickInterval&&(this._tickInterval=setInterval(this._boundTick,e),!0)},TaskLoop.prototype.clearInterval=function(){return!!this._tickInterval&&(clearInterval(this._tickInterval),this._tickInterval=null,!0)},TaskLoop.prototype.clearNextTick=function(){return!!this._tickTimer&&(clearTimeout(this._tickTimer),this._tickTimer=null,!0)},TaskLoop.prototype.tick=function(){this._tickCallCount++,1===this._tickCallCount&&(this.doTick(),this._tickCallCount>1&&(this.clearNextTick(),this._tickTimer=setTimeout(this._boundTick,0)),this._tickCallCount=0)},TaskLoop.prototype.doTick=function(){},TaskLoop}(r("./src/event-handler.js").default);t.default=i},"./src/utils/attr-list.js":function srcUtilsAttrListJs(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var r=/^(\d+)x(\d+)$/,n=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,i=function(){function AttrList(e){for(var t in"string"===typeof e&&(e=AttrList.parseAttrList(e)),e)e.hasOwnProperty(t)&&(this[t]=e[t])}return AttrList.prototype.decimalInteger=function(t){var r=parseInt(this[t],10);return r>e.MAX_SAFE_INTEGER?1/0:r},AttrList.prototype.hexadecimalInteger=function(e){if(this[e]){var t=(this[e]||"0x").slice(2);t=(1&t.length?"0":"")+t;for(var r=new Uint8Array(t.length/2),n=0;n<t.length/2;n++)r[n]=parseInt(t.slice(2*n,2*n+2),16);return r}return null},AttrList.prototype.hexadecimalIntegerAsNumber=function(t){var r=parseInt(this[t],16);return r>e.MAX_SAFE_INTEGER?1/0:r},AttrList.prototype.decimalFloatingPoint=function(e){return parseFloat(this[e])},AttrList.prototype.enumeratedString=function(e){return this[e]},AttrList.prototype.decimalResolution=function(e){var t=r.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}},AttrList.parseAttrList=function(e){var t,r={};for(n.lastIndex=0;null!==(t=n.exec(e));){var i=t[2];0===i.indexOf('"')&&i.lastIndexOf('"')===i.length-1&&(i=i.slice(1,-1)),r[t[1]]=i}return r},AttrList}();t.default=i}).call(this,r("./src/polyfills/number.js").Number)},"./src/utils/binary-search.js":function srcUtilsBinarySearchJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={search:function search(e,t){for(var r=0,n=e.length-1,i=null,a=null;r<=n;){var o=t(a=e[i=(r+n)/2|0]);if(o>0)r=i+1;else{if(!(o<0))return a;n=i-1}}return null}}},"./src/utils/buffer-helper.js":function srcUtilsBufferHelperJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function BufferHelper(){}return BufferHelper.isBuffered=function(e,t){try{if(e)for(var r=e.buffered,n=0;n<r.length;n++)if(t>=r.start(n)&&t<=r.end(n))return!0}catch(i){}return!1},BufferHelper.bufferInfo=function(e,t,r){try{if(e){var n=e.buffered,i=[],a=void 0;for(a=0;a<n.length;a++)i.push({start:n.start(a),end:n.end(a)});return this.bufferedInfo(i,t,r)}}catch(o){}return{len:0,start:t,end:t,nextStart:void 0}},BufferHelper.bufferedInfo=function(e,t,r){var n,i,a,o,s,u=[];for(e.sort((function(e,t){var r=e.start-t.start;return r||t.end-e.end})),s=0;s<e.length;s++){var l=u.length;if(l){var c=u[l-1].end;e[s].start-c<r?e[s].end>c&&(u[l-1].end=e[s].end):u.push(e[s])}else u.push(e[s])}for(s=0,n=0,i=a=t;s<u.length;s++){var f=u[s].start,d=u[s].end;if(t+r>=f&&t<d)i=f,n=(a=d)-t;else if(t+r<f){o=f;break}}return{len:n,start:i,end:a,nextStart:o}},BufferHelper}();t.BufferHelper=n},"./src/utils/cea-608-parser.js":function srcUtilsCea608ParserJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},i=function getCharForByte(e){var t=e;return n.hasOwnProperty(e)&&(t=n[e]),String.fromCharCode(t)},a=15,o=100,s={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},u={17:2,18:4,21:6,22:8,23:10,19:13,20:15},l={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},c={25:2,26:4,29:6,30:8,31:10,27:13,28:15},f=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],d={verboseFilter:{DATA:3,DEBUG:3,INFO:2,WARNING:2,TEXT:1,ERROR:0},time:null,verboseLevel:0,setTime:function setTime(e){this.time=e},log:function log(e,t){this.verboseFilter[e];this.verboseLevel}},h=function numArrayToHexArray(e){for(var t=[],r=0;r<e.length;r++)t.push(e[r].toString(16));return t},p=function(){function PenState(e,t,r,n,i){this.foreground=e||"white",this.underline=t||!1,this.italics=r||!1,this.background=n||"black",this.flash=i||!1}return PenState.prototype.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},PenState.prototype.setStyles=function(e){for(var t=["foreground","underline","italics","background","flash"],r=0;r<t.length;r++){var n=t[r];e.hasOwnProperty(n)&&(this[n]=e[n])}},PenState.prototype.isDefault=function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash},PenState.prototype.equals=function(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash},PenState.prototype.copy=function(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash},PenState.prototype.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},PenState}(),g=function(){function StyledUnicodeChar(e,t,r,n,i,a){this.uchar=e||" ",this.penState=new p(t,r,n,i,a)}return StyledUnicodeChar.prototype.reset=function(){this.uchar=" ",this.penState.reset()},StyledUnicodeChar.prototype.setChar=function(e,t){this.uchar=e,this.penState.copy(t)},StyledUnicodeChar.prototype.setPenState=function(e){this.penState.copy(e)},StyledUnicodeChar.prototype.equals=function(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)},StyledUnicodeChar.prototype.copy=function(e){this.uchar=e.uchar,this.penState.copy(e.penState)},StyledUnicodeChar.prototype.isEmpty=function(){return" "===this.uchar&&this.penState.isDefault()},StyledUnicodeChar}(),m=function(){function Row(){this.chars=[];for(var e=0;e<o;e++)this.chars.push(new g);this.pos=0,this.currPenState=new p}return Row.prototype.equals=function(e){for(var t=!0,r=0;r<o;r++)if(!this.chars[r].equals(e.chars[r])){t=!1;break}return t},Row.prototype.copy=function(e){for(var t=0;t<o;t++)this.chars[t].copy(e.chars[t])},Row.prototype.isEmpty=function(){for(var e=!0,t=0;t<o;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e},Row.prototype.setCursor=function(e){this.pos!==e&&(this.pos=e),this.pos<0?(d.log("ERROR","Negative cursor position "+this.pos),this.pos=0):this.pos>o&&(d.log("ERROR","Too large cursor position "+this.pos),this.pos=o)},Row.prototype.moveCursor=function(e){var t=this.pos+e;if(e>1)for(var r=this.pos+1;r<t+1;r++)this.chars[r].setPenState(this.currPenState);this.setCursor(t)},Row.prototype.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},Row.prototype.insertChar=function(e){e>=144&&this.backSpace();var t=i(e);this.pos>=o?d.log("ERROR","Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1))},Row.prototype.clearFromPos=function(e){var t;for(t=e;t<o;t++)this.chars[t].reset()},Row.prototype.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},Row.prototype.clearToEndOfRow=function(){this.clearFromPos(this.pos)},Row.prototype.getTextString=function(){for(var e=[],t=!0,r=0;r<o;r++){var n=this.chars[r].uchar;" "!==n&&(t=!1),e.push(n)}return t?"":e.join("")},Row.prototype.setPenStyles=function(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)},Row}(),v=function(){function CaptionScreen(){this.rows=[];for(var e=0;e<a;e++)this.rows.push(new m);this.currRow=a-1,this.nrRollUpRows=null,this.reset()}return CaptionScreen.prototype.reset=function(){for(var e=0;e<a;e++)this.rows[e].clear();this.currRow=a-1},CaptionScreen.prototype.equals=function(e){for(var t=!0,r=0;r<a;r++)if(!this.rows[r].equals(e.rows[r])){t=!1;break}return t},CaptionScreen.prototype.copy=function(e){for(var t=0;t<a;t++)this.rows[t].copy(e.rows[t])},CaptionScreen.prototype.isEmpty=function(){for(var e=!0,t=0;t<a;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e},CaptionScreen.prototype.backSpace=function(){this.rows[this.currRow].backSpace()},CaptionScreen.prototype.clearToEndOfRow=function(){this.rows[this.currRow].clearToEndOfRow()},CaptionScreen.prototype.insertChar=function(e){this.rows[this.currRow].insertChar(e)},CaptionScreen.prototype.setPen=function(e){this.rows[this.currRow].setPenStyles(e)},CaptionScreen.prototype.moveCursor=function(e){this.rows[this.currRow].moveCursor(e)},CaptionScreen.prototype.setCursor=function(e){d.log("INFO","setCursor: "+e),this.rows[this.currRow].setCursor(e)},CaptionScreen.prototype.setPAC=function(e){d.log("INFO","pacData = "+JSON.stringify(e));var t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(var r=0;r<a;r++)this.rows[r].clear();var n=this.currRow+1-this.nrRollUpRows,i=this.lastOutputScreen;if(i){var o=i.rows[n].cueStartTime;if(o&&o<d.time)for(r=0;r<this.nrRollUpRows;r++)this.rows[t-this.nrRollUpRows+r+1].copy(i.rows[n+r])}}this.currRow=t;var s=this.rows[this.currRow];if(null!==e.indent){var u=e.indent,l=Math.max(u-1,0);s.setCursor(e.indent),e.color=s.chars[l].penState.foreground}var c={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(c)},CaptionScreen.prototype.setBkgData=function(e){d.log("INFO","bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)},CaptionScreen.prototype.setRollUpRows=function(e){this.nrRollUpRows=e},CaptionScreen.prototype.rollUp=function(){if(null!==this.nrRollUpRows){d.log("TEXT",this.getDisplayText());var e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),d.log("INFO","Rolling up")}else d.log("DEBUG","roll_up but nrRollUpRows not set yet")},CaptionScreen.prototype.getDisplayText=function(e){e=e||!1;for(var t=[],r="",n=-1,i=0;i<a;i++){var o=this.rows[i].getTextString();o&&(n=i+1,e?t.push("Row "+n+": '"+o+"'"):t.push(o.trim()))}return t.length>0&&(r=e?"["+t.join(" | ")+"]":t.join("\n")),r},CaptionScreen.prototype.getTextAndFormat=function(){return this.rows},CaptionScreen}(),y=function(){function Cea608Channel(e,t){this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new v,this.nonDisplayedMemory=new v,this.lastOutputScreen=new v,this.currRollUpRow=this.displayedMemory.rows[a-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}return Cea608Channel.prototype.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[a-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null},Cea608Channel.prototype.getHandler=function(){return this.outputFilter},Cea608Channel.prototype.setHandler=function(e){this.outputFilter=e},Cea608Channel.prototype.setPAC=function(e){this.writeScreen.setPAC(e)},Cea608Channel.prototype.setBkgData=function(e){this.writeScreen.setBkgData(e)},Cea608Channel.prototype.setMode=function(e){e!==this.mode&&(this.mode=e,d.log("INFO","MODE="+e),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)},Cea608Channel.prototype.insertChars=function(e){for(var t=0;t<e.length;t++)this.writeScreen.insertChar(e[t]);var r=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";d.log("INFO",r+": "+this.writeScreen.getDisplayText(!0)),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(d.log("TEXT","DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},Cea608Channel.prototype.ccRCL=function(){d.log("INFO","RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},Cea608Channel.prototype.ccBS=function(){d.log("INFO","BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())},Cea608Channel.prototype.ccAOF=function(){},Cea608Channel.prototype.ccAON=function(){},Cea608Channel.prototype.ccDER=function(){d.log("INFO","DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},Cea608Channel.prototype.ccRU=function(e){d.log("INFO","RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)},Cea608Channel.prototype.ccFON=function(){d.log("INFO","FON - Flash On"),this.writeScreen.setPen({flash:!0})},Cea608Channel.prototype.ccRDC=function(){d.log("INFO","RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},Cea608Channel.prototype.ccTR=function(){d.log("INFO","TR"),this.setMode("MODE_TEXT")},Cea608Channel.prototype.ccRTD=function(){d.log("INFO","RTD"),this.setMode("MODE_TEXT")},Cea608Channel.prototype.ccEDM=function(){d.log("INFO","EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},Cea608Channel.prototype.ccCR=function(){d.log("CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},Cea608Channel.prototype.ccENM=function(){d.log("INFO","ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},Cea608Channel.prototype.ccEOC=function(){if(d.log("INFO","EOC - End Of Caption"),"MODE_POP-ON"===this.mode){var e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,d.log("TEXT","DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},Cea608Channel.prototype.ccTO=function(e){d.log("INFO","TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)},Cea608Channel.prototype.ccMIDROW=function(e){var t={flash:!1};if(t.underline=e%2===1,t.italics=e>=46,t.italics)t.foreground="white";else{var r=Math.floor(e/2)-16;t.foreground=["white","green","blue","cyan","red","yellow","magenta"][r]}d.log("INFO","MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)},Cea608Channel.prototype.outputDataUpdate=function(e){void 0===e&&(e=!1);var t=d.time;null!==t&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),!0===e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue()),this.cueStartTime=this.displayedMemory.isEmpty()?null:t):this.cueStartTime=t,this.lastOutputScreen.copy(this.displayedMemory))},Cea608Channel.prototype.cueSplitAtTime=function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))},Cea608Channel}(),_=function(){function Cea608Parser(e,t,r){this.field=e||1,this.outputs=[t,r],this.channels=[new y(1,t),new y(2,r)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.bufferedData=[],this.startTime=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}}return Cea608Parser.prototype.getHandler=function(e){return this.channels[e].getHandler()},Cea608Parser.prototype.setHandler=function(e,t){this.channels[e].setHandler(t)},Cea608Parser.prototype.addData=function(e,t){var r,n,i,a=!1;this.lastTime=e,d.setTime(e);for(var o=0;o<t.length;o+=2)if(n=127&t[o],i=127&t[o+1],0!==n||0!==i){if(d.log("DATA","["+h([t[o],t[o+1]])+"] -> ("+h([n,i])+")"),(r=this.parseCmd(n,i))||(r=this.parseMidrow(n,i)),r||(r=this.parsePAC(n,i)),r||(r=this.parseBackgroundAttributes(n,i)),!r)if(a=this.parseChars(n,i))if(this.currChNr&&this.currChNr>=0)this.channels[this.currChNr-1].insertChars(a);else d.log("WARNING","No channel found yet. TEXT-MODE?");r?this.dataCounters.cmd+=2:a?this.dataCounters.char+=2:(this.dataCounters.other+=2,d.log("WARNING","Couldn't parse cleaned data "+h([n,i])+" orig: "+h([t[o],t[o+1]])))}else this.dataCounters.padding+=2},Cea608Parser.prototype.parseCmd=function(e,t){var r=null;if(!((20===e||28===e)&&t>=32&&t<=47)&&!((23===e||31===e)&&t>=33&&t<=35))return!1;if(e===this.lastCmdA&&t===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,d.log("DEBUG","Repeated command ("+h([e,t])+") is dropped"),!0;r=20===e||23===e?1:2;var n=this.channels[r-1];return 20===e||28===e?32===t?n.ccRCL():33===t?n.ccBS():34===t?n.ccAOF():35===t?n.ccAON():36===t?n.ccDER():37===t?n.ccRU(2):38===t?n.ccRU(3):39===t?n.ccRU(4):40===t?n.ccFON():41===t?n.ccRDC():42===t?n.ccTR():43===t?n.ccRTD():44===t?n.ccEDM():45===t?n.ccCR():46===t?n.ccENM():47===t&&n.ccEOC():n.ccTO(t-32),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=r,!0},Cea608Parser.prototype.parseMidrow=function(e,t){var r=null;return(17===e||25===e)&&t>=32&&t<=47&&((r=17===e?1:2)!==this.currChNr?(d.log("ERROR","Mismatch channel in midrow parsing"),!1):(this.channels[r-1].ccMIDROW(t),d.log("DEBUG","MIDROW ("+h([e,t])+")"),!0))},Cea608Parser.prototype.parsePAC=function(e,t){var r,n=null;if(!((e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127)&&!((16===e||24===e)&&t>=64&&t<=95))return!1;if(e===this.lastCmdA&&t===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,!0;r=e<=23?1:2,n=t>=64&&t<=95?1===r?s[e]:l[e]:1===r?u[e]:c[e];var i=this.interpretPAC(n,t);return this.channels[r-1].setPAC(i),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=r,!0},Cea608Parser.prototype.interpretPAC=function(e,t){var r=t,n={color:null,italics:!1,indent:null,underline:!1,row:e};return r=t>95?t-96:t-64,n.underline=1===(1&r),r<=13?n.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(r/2)]:r<=15?(n.italics=!0,n.color="white"):n.indent=4*Math.floor((r-16)/2),n},Cea608Parser.prototype.parseChars=function(e,t){var r=null,n=null,a=null;if(e>=25?(r=2,a=e-8):(r=1,a=e),a>=17&&a<=19){var o=t;o=17===a?t+80:18===a?t+112:t+144,d.log("INFO","Special char '"+i(o)+"' in channel "+r),n=[o]}else e>=32&&e<=127&&(n=0===t?[e]:[e,t]);if(n){var s=h(n);d.log("DEBUG","Char codes = "+s.join(",")),this.lastCmdA=null,this.lastCmdB=null}return n},Cea608Parser.prototype.parseBackgroundAttributes=function(e,t){var r,n,i;return((16===e||24===e)&&t>=32&&t<=47||(23===e||31===e)&&t>=45&&t<=47)&&(r={},16===e||24===e?(n=Math.floor((t-32)/2),r.background=f[n],t%2===1&&(r.background=r.background+"_semi")):45===t?r.background="transparent":(r.foreground="black",47===t&&(r.underline=!0)),i=e<24?1:2,this.channels[i-1].setBkgData(r),this.lastCmdA=null,this.lastCmdB=null,!0)},Cea608Parser.prototype.reset=function(){for(var e=0;e<this.channels.length;e++)this.channels[e]&&this.channels[e].reset();this.lastCmdA=null,this.lastCmdB=null},Cea608Parser.prototype.cueSplitAtTime=function(e){for(var t=0;t<this.channels.length;t++)this.channels[t]&&this.channels[t].cueSplitAtTime(e)},Cea608Parser}();t.default=_},"./src/utils/codecs.js":function srcUtilsCodecsJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0}};t.isCodecType=function isCodecType(e,t){var r=n[t];return!!r&&!0===r[e.slice(0,4)]},t.isCodecSupportedInMp4=function isCodecSupportedInMp4(e,t){return window.MediaSource.isTypeSupported((t||"video")+'/mp4;codecs="'+e+'"')}},"./src/utils/cues.js":function srcUtilsCuesJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("./src/utils/vttparser.js");t.newCue=function newCue(e,t,r,i){for(var a,o,s,u,l,c=window.VTTCue||window.TextTrackCue,f=0;f<i.rows.length;f++)if(s=!0,u=0,l="",!(a=i.rows[f]).isEmpty()){for(var d=0;d<a.chars.length;d++)a.chars[d].uchar.match(/\s/)&&s?u++:(l+=a.chars[d].uchar,s=!1);a.cueStartTime=t,t===r&&(r+=1e-4),o=new c(t,r,n.fixLineBreaks(l.trim())),u>=16?u--:u++,navigator.userAgent.match(/Firefox\//)?o.line=f+1:o.line=f>7?f-2:f+1,o.align="left",o.position=Math.max(0,Math.min(100,u/32*100+(navigator.userAgent.match(/Firefox\//)?50:0))),e.addCue(o)}}},"./src/utils/discontinuities.js":function srcUtilsDiscontinuitiesJs(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r("./src/utils/binary-search.js"),i=r("./src/utils/logger.js");function findFirstFragWithCC(e,t){for(var r=null,n=0;n<e.length;n+=1){var i=e[n];if(i&&i.cc===t){r=i;break}}return r}function shouldAlignOnDiscontinuities(e,t,r){var n=!1;return t&&t.details&&r&&(r.endCC>r.startCC||e&&e.cc<r.startCC)&&(n=!0),n}function findDiscontinuousReferenceFrag(e,t){var r=e.fragments,n=t.fragments;if(n.length&&r.length){var a=findFirstFragWithCC(r,n[0].cc);if(a&&(!a||a.startPTS))return a;i.logger.log("No frag in previous level to align on")}else i.logger.log("No fragments to align")}function adjustPts(e,t){t.fragments.forEach((function(t){if(t){var r=t.start+e;t.start=t.startPTS=r,t.endPTS=r+t.duration}})),t.PTSKnown=!0}function alignDiscontinuities(e,t,r){if(shouldAlignOnDiscontinuities(e,r,t)){var n=findDiscontinuousReferenceFrag(r.details,t);n&&(i.logger.log("Adjusting PTS using last level due to CC increase within current level"),adjustPts(n.start,t))}}function alignPDT(t,r){if(r&&r.fragments.length){if(!t.hasProgramDateTime||!r.hasProgramDateTime)return;var n=r.fragments[0].programDateTime,a=(t.fragments[0].programDateTime-n)/1e3+r.fragments[0].start;e.isFinite(a)&&(i.logger.log("adjusting PTS using programDateTime delta, sliding:"+a.toFixed(3)),adjustPts(a,t))}}t.findFirstFragWithCC=findFirstFragWithCC,t.findFragWithCC=function findFragWithCC(e,t){return n.default.search(e,(function(e){return e.cc<t?1:e.cc>t?-1:0}))},t.shouldAlignOnDiscontinuities=shouldAlignOnDiscontinuities,t.findDiscontinuousReferenceFrag=findDiscontinuousReferenceFrag,t.adjustPts=adjustPts,t.alignStream=function alignStream(e,t,r){alignDiscontinuities(e,r,t),!r.PTSKnown&&t&&alignPDT(r,t.details)},t.alignDiscontinuities=alignDiscontinuities,t.alignPDT=alignPDT}).call(this,r("./src/polyfills/number.js").Number)},"./src/utils/ewma-bandwidth-estimator.js":function srcUtilsEwmaBandwidthEstimatorJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("./src/utils/ewma.js"),i=function(){function EwmaBandWidthEstimator(e,t,r,i){this.hls=e,this.defaultEstimate_=i,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new n.default(t),this.fast_=new n.default(r)}return EwmaBandWidthEstimator.prototype.sample=function(e,t){var r=8e3*t/(e=Math.max(e,this.minDelayMs_)),n=e/1e3;this.fast_.sample(n,r),this.slow_.sample(n,r)},EwmaBandWidthEstimator.prototype.canEstimate=function(){var e=this.fast_;return e&&e.getTotalWeight()>=this.minWeight_},EwmaBandWidthEstimator.prototype.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},EwmaBandWidthEstimator.prototype.destroy=function(){},EwmaBandWidthEstimator}();t.default=i},"./src/utils/ewma.js":function srcUtilsEwmaJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function EWMA(e){this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=0,this.totalWeight_=0}return EWMA.prototype.sample=function(e,t){var r=Math.pow(this.alpha_,e);this.estimate_=t*(1-r)+r*this.estimate_,this.totalWeight_+=e},EWMA.prototype.getTotalWeight=function(){return this.totalWeight_},EWMA.prototype.getEstimate=function(){if(this.alpha_){var e=1-Math.pow(this.alpha_,this.totalWeight_);return this.estimate_/e}return this.estimate_},EWMA}();t.default=n},"./src/utils/get-self-scope.js":function srcUtilsGetSelfScopeJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSelfScope=function getSelfScope(){return"undefined"===typeof window?self:window}},"./src/utils/logger.js":function srcUtilsLoggerJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("./src/utils/get-self-scope.js");function noop(){}var i={trace:noop,debug:noop,log:noop,warn:noop,info:noop,error:noop},a=i;function formatMsg(e,t){return t="["+e+"] > "+t}var o=n.getSelfScope();function exportLoggerFunctions(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];t.forEach((function(t){a[t]=e[t]?e[t].bind(e):function consolePrintFn(e){var t=o.console[e];return t?function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];r[0]&&(r[0]=formatMsg(e,r[0])),t.apply(o.console,r)}:noop}(t)}))}t.enableLogs=function(e){if(!0===e||"object"===typeof e){exportLoggerFunctions(e,"debug","log","info","warn","error");try{a.log()}catch(t){a=i}}else a=i},t.logger=a},"./src/utils/mediakeys-helper.js":function srcUtilsMediakeysHelperJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="undefined"!==typeof window&&window.navigator&&window.navigator.requestMediaKeySystemAccess?window.navigator.requestMediaKeySystemAccess.bind(window.navigator):null;t.requestMediaKeySystemAccess=n},"./src/utils/mediasource-helper.js":function srcUtilsMediasourceHelperJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMediaSource=function getMediaSource(){if("undefined"!==typeof window)return window.MediaSource||window.WebKitMediaSource}},"./src/utils/output-filter.js":function srcUtilsOutputFilterJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function OutputFilter(e,t){this.timelineController=e,this.trackName=t,this.startTime=null,this.endTime=null,this.screen=null}return OutputFilter.prototype.dispatchCue=function(){null!==this.startTime&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen),this.startTime=null)},OutputFilter.prototype.newCue=function(e,t,r){(null===this.startTime||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=r,this.timelineController.createCaptionsTrack(this.trackName)},OutputFilter}();t.default=n},"./src/utils/texttrack-utils.js":function srcUtilsTexttrackUtilsJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sendAddTrackEvent=function sendAddTrackEvent(e,t){var r=null;try{r=new window.Event("addtrack")}catch(n){(r=document.createEvent("Event")).initEvent("addtrack",!1,!1)}r.track=e,t.dispatchEvent(r)},t.clearCurrentCues=function clearCurrentCues(e){if(e&&e.cues)for(;e.cues.length>0;)e.removeCue(e.cues[0])}},"./src/utils/time-ranges.js":function srcUtilsTimeRangesJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={toString:function toString(e){for(var t="",r=e.length,n=0;n<r;n++)t+="["+e.start(n).toFixed(3)+","+e.end(n).toFixed(3)+"]";return t}}},"./src/utils/vttcue.js":function srcUtilsVttcueJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){if("undefined"!==typeof window&&window.VTTCue)return window.VTTCue;var e="auto",t={"":!0,lr:!0,rl:!0},r={start:!0,middle:!0,end:!0,left:!0,right:!0};function findAlignSetting(e){return"string"===typeof e&&(!!r[e.toLowerCase()]&&e.toLowerCase())}function extend(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}function VTTCue(r,n,i){var a=this,o=function(){if("undefined"!==typeof navigator)return/MSIE\s8\.0/.test(navigator.userAgent)}(),s={};o?a=document.createElement("custom"):s.enumerable=!0,a.hasBeenReset=!1;var u="",l=!1,c=r,f=n,d=i,h=null,p="",g=!0,m="auto",v="start",y=50,_="middle",b=50,x="middle";if(Object.defineProperty(a,"id",extend({},s,{get:function get(){return u},set:function set(e){u=""+e}})),Object.defineProperty(a,"pauseOnExit",extend({},s,{get:function get(){return l},set:function set(e){l=!!e}})),Object.defineProperty(a,"startTime",extend({},s,{get:function get(){return c},set:function set(e){if("number"!==typeof e)throw new TypeError("Start time must be set to a number.");c=e,this.hasBeenReset=!0}})),Object.defineProperty(a,"endTime",extend({},s,{get:function get(){return f},set:function set(e){if("number"!==typeof e)throw new TypeError("End time must be set to a number.");f=e,this.hasBeenReset=!0}})),Object.defineProperty(a,"text",extend({},s,{get:function get(){return d},set:function set(e){d=""+e,this.hasBeenReset=!0}})),Object.defineProperty(a,"region",extend({},s,{get:function get(){return h},set:function set(e){h=e,this.hasBeenReset=!0}})),Object.defineProperty(a,"vertical",extend({},s,{get:function get(){return p},set:function set(e){var r=function findDirectionSetting(e){return"string"===typeof e&&(!!t[e.toLowerCase()]&&e.toLowerCase())}(e);if(!1===r)throw new SyntaxError("An invalid or illegal string was specified.");p=r,this.hasBeenReset=!0}})),Object.defineProperty(a,"snapToLines",extend({},s,{get:function get(){return g},set:function set(e){g=!!e,this.hasBeenReset=!0}})),Object.defineProperty(a,"line",extend({},s,{get:function get(){return m},set:function set(t){if("number"!==typeof t&&t!==e)throw new SyntaxError("An invalid number or illegal string was specified.");m=t,this.hasBeenReset=!0}})),Object.defineProperty(a,"lineAlign",extend({},s,{get:function get(){return v},set:function set(e){var t=findAlignSetting(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");v=t,this.hasBeenReset=!0}})),Object.defineProperty(a,"position",extend({},s,{get:function get(){return y},set:function set(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");y=e,this.hasBeenReset=!0}})),Object.defineProperty(a,"positionAlign",extend({},s,{get:function get(){return _},set:function set(e){var t=findAlignSetting(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");_=t,this.hasBeenReset=!0}})),Object.defineProperty(a,"size",extend({},s,{get:function get(){return b},set:function set(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");b=e,this.hasBeenReset=!0}})),Object.defineProperty(a,"align",extend({},s,{get:function get(){return x},set:function set(e){var t=findAlignSetting(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");x=t,this.hasBeenReset=!0}})),a.displayState=void 0,o)return a}return VTTCue.prototype.getCueAsHTML=function(){return window.WebVTT.convertCueToDOMTree(window,this.text)},VTTCue}()},"./src/utils/vttparser.js":function srcUtilsVttparserJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("./src/utils/vttcue.js"),i=function StringDecoder(){return{decode:function decode(e){if(!e)return"";if("string"!==typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}};function VTTParser(){this.window=window,this.state="INITIAL",this.buffer="",this.decoder=new i,this.regionList=[]}function Settings(){this.values=Object.create(null)}function parseOptions(e,t,r,n){var i=n?e.split(n):[e];for(var a in i)if("string"===typeof i[a]){var o=i[a].split(r);if(2===o.length)t(o[0],o[1])}}Settings.prototype={set:function set(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function get(e,t,r){return r?this.has(e)?this.values[e]:t[r]:this.has(e)?this.values[e]:t},has:function has(e){return e in this.values},alt:function alt(e,t,r){for(var n=0;n<r.length;++n)if(t===r[n]){this.set(e,t);break}},integer:function integer(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))},percent:function percent(e,t){return!!(t.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(t=parseFloat(t))>=0&&t<=100)&&(this.set(e,t),!0)}};var a=new n.default(0,0,0),o="middle"===a.align?"middle":"center";function parseCue(e,t,r){var n=e;function consumeTimeStamp(){var t=function parseTimeStamp(e){function computeSeconds(e,t,r,n){return 3600*(0|e)+60*(0|t)+(0|r)+(0|n)/1e3}var t=e.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return t?t[3]?computeSeconds(t[1],t[2],t[3].replace(":",""),t[4]):t[1]>59?computeSeconds(t[1],t[2],0,t[4]):computeSeconds(0,t[1],t[2],t[4]):null}(e);if(null===t)throw new Error("Malformed timestamp: "+n);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function skipWhitespace(){e=e.replace(/^\s+/,"")}if(skipWhitespace(),t.startTime=consumeTimeStamp(),skipWhitespace(),"--\x3e"!==e.substr(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);e=e.substr(3),skipWhitespace(),t.endTime=consumeTimeStamp(),skipWhitespace(),function consumeCueSettings(e,t){var n=new Settings;parseOptions(e,(function(e,t){switch(e){case"region":for(var i=r.length-1;i>=0;i--)if(r[i].id===t){n.set(e,r[i].region);break}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":var a=t.split(","),s=a[0];n.integer(e,s),n.percent(e,s)&&n.set("snapToLines",!1),n.alt(e,s,["auto"]),2===a.length&&n.alt("lineAlign",a[1],["start",o,"end"]);break;case"position":a=t.split(","),n.percent(e,a[0]),2===a.length&&n.alt("positionAlign",a[1],["start",o,"end","line-left","line-right","auto"]);break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start",o,"end","left","right"])}}),/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical","");var i=n.get("line","auto");"auto"===i&&-1===a.line&&(i=-1),t.line=i,t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100),t.align=n.get("align",o);var s=n.get("position","auto");"auto"===s&&50===a.position&&(s="start"===t.align||"left"===t.align?0:"end"===t.align||"right"===t.align?100:50),t.position=s}(e,t)}function fixLineBreaks(e){return e.replace(/<br(?: \/)?>/gi,"\n")}t.fixLineBreaks=fixLineBreaks,VTTParser.prototype={parse:function parse(e){var t=this;function collectNextLine(){var e=t.buffer,r=0;for(e=fixLineBreaks(e);r<e.length&&"\r"!==e[r]&&"\n"!==e[r];)++r;var n=e.substr(0,r);return"\r"===e[r]&&++r,"\n"===e[r]&&++r,t.buffer=e.substr(r),n}e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));try{var r=void 0;if("INITIAL"===t.state){if(!/\r\n|\n/.test(t.buffer))return this;var i=(r=collectNextLine()).match(/^(\xef\xbb\xbf)?WEBVTT([ \t].*)?$/);if(!i||!i[0])throw new Error("Malformed WebVTT signature.");t.state="HEADER"}for(var a=!1;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(a?a=!1:r=collectNextLine(),t.state){case"HEADER":/:/.test(r)?parseOptions(r,(function(e,t){}),/:/):r||(t.state="ID");continue;case"NOTE":r||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(r)){t.state="NOTE";break}if(!r)continue;if(t.cue=new n.default(0,0,""),t.state="CUE",-1===r.indexOf("--\x3e")){t.cue.id=r;continue}case"CUE":try{parseCue(r,t.cue,t.regionList)}catch(s){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":var o=-1!==r.indexOf("--\x3e");if(!r||o&&(a=!0)){t.oncue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}t.cue.text&&(t.cue.text+="\n"),t.cue.text+=r;continue;case"BADCUE":r||(t.state="ID");continue}}}catch(s){"CUETEXT"===t.state&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state="INITIAL"===t.state?"BADWEBVTT":"BADCUE"}return this},flush:function flush(){try{if(this.buffer+=this.decoder.decode(),(this.cue||"HEADER"===this.state)&&(this.buffer+="\n\n",this.parse()),"INITIAL"===this.state)throw new Error("Malformed WebVTT signature.")}catch(e){throw e}return this.onflush&&this.onflush(),this}},t.default=VTTParser},"./src/utils/webvtt-parser.js":function srcUtilsWebvttParserJs(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r("./src/utils/vttparser.js"),i=r("./src/demux/id3.js"),a=function startsWith(e,t,r){return e.substr(r||0,t.length)===t},o=function hash(e){for(var hash=5381,t=e.length;t;)hash=33*hash^e.charCodeAt(--t);return(hash>>>0).toString()},s={parse:function parse(t,r,s,u,l,c){var f,d=i.utf8ArrayToStr(new Uint8Array(t)).trim().replace(/\r\n|\n\r|\n|\r/g,"\n").split("\n"),h="00:00.000",p=0,g=0,m=0,v=[],y=!0,_=new n.default;_.oncue=function(e){var t=s[u],r=s.ccOffset;t&&t.new&&(void 0!==g?r=s.ccOffset=t.start:function calculateOffset(e,t,r){var n=e[t],i=e[n.prevCC];if(!i||!i.new&&n.new)return e.ccOffset=e.presentationOffset=n.start,void(n.new=!1);for(;i&&i.new;)e.ccOffset+=n.start-i.start,n.new=!1,i=e[(n=i).prevCC];e.presentationOffset=r}(s,u,m)),m&&(r=m-s.presentationOffset),e.startTime+=r-g,e.endTime+=r-g,e.id=o(e.startTime.toString())+o(e.endTime.toString())+o(e.text),e.text=decodeURIComponent(encodeURIComponent(e.text)),e.endTime>0&&v.push(e)},_.onparsingerror=function(e){f=e},_.onflush=function(){f&&c?c(f):l(v)},d.forEach((function(t){if(y){if(a(t,"X-TIMESTAMP-MAP=")){y=!1,t.substr(16).split(",").forEach((function(e){a(e,"LOCAL:")?h=e.substr(6):a(e,"MPEGTS:")&&(p=parseInt(e.substr(7)))}));try{r+(9e4*s[u].start||0)<0&&(r+=8589934592),p-=r,g=function cueString2millis(t){var r=parseInt(t.substr(-3)),n=parseInt(t.substr(-6,2)),i=parseInt(t.substr(-9,2)),a=t.length>9?parseInt(t.substr(0,t.indexOf(":"))):0;return e.isFinite(r)&&e.isFinite(n)&&e.isFinite(i)&&e.isFinite(a)?(r+=1e3*n,r+=6e4*i,r+=36e5*a):-1}(h)/1e3,m=p/9e4,-1===g&&(f=new Error("Malformed X-TIMESTAMP-MAP: "+t))}catch(n){f=new Error("Malformed X-TIMESTAMP-MAP: "+t)}return}""===t&&(y=!1)}_.parse(t+"\n")})),_.flush()}};t.default=s}).call(this,r("./src/polyfills/number.js").Number)},"./src/utils/xhr-loader.js":function srcUtilsXhrLoaderJs(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("./src/utils/logger.js"),i=window.performance,a=window.XMLHttpRequest,o=function(){function XhrLoader(e){e&&e.xhrSetup&&(this.xhrSetup=e.xhrSetup)}return XhrLoader.prototype.destroy=function(){this.abort(),this.loader=null},XhrLoader.prototype.abort=function(){var e=this.loader;e&&4!==e.readyState&&(this.stats.aborted=!0,e.abort()),window.clearTimeout(this.requestTimeout),this.requestTimeout=null,window.clearTimeout(this.retryTimeout),this.retryTimeout=null},XhrLoader.prototype.load=function(e,t,r){this.context=e,this.config=t,this.callbacks=r,this.stats={trequest:i.now(),retry:0},this.retryDelay=t.retryDelay,this.loadInternal()},XhrLoader.prototype.loadInternal=function(){var e,t=this.context;e=this.loader=new a;var r=this.stats;r.tfirst=0,r.loaded=0;var n=this.xhrSetup;try{if(n)try{n(e,t.url)}catch(i){e.open("GET",t.url,!0),n(e,t.url)}e.readyState||e.open("GET",t.url,!0)}catch(i){return void this.callbacks.onError({code:e.status,text:i.message},t,e)}t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),this.config.timeout),e.send()},XhrLoader.prototype.readystatechange=function(e){var t=e.currentTarget,r=t.readyState,a=this.stats,o=this.context,s=this.config;if(!a.aborted&&r>=2)if(window.clearTimeout(this.requestTimeout),0===a.tfirst&&(a.tfirst=Math.max(i.now(),a.trequest)),4===r){var u=t.status;if(u>=200&&u<300){a.tload=Math.max(a.tfirst,i.now());var l=void 0,c=void 0;c="arraybuffer"===o.responseType?(l=t.response).byteLength:(l=t.responseText).length,a.loaded=a.total=c;var f={url:t.responseURL,data:l};this.callbacks.onSuccess(f,a,o,t)}else a.retry>=s.maxRetry||u>=400&&u<499?(n.logger.error(u+" while loading "+o.url),this.callbacks.onError({code:u,text:t.statusText},o,t)):(n.logger.warn(u+" while loading "+o.url+", retrying in "+this.retryDelay+"..."),this.destroy(),this.retryTimeout=window.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,s.maxRetryDelay),a.retry++)}else this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),s.timeout)},XhrLoader.prototype.loadtimeout=function(){n.logger.warn("timeout while loading "+this.context.url),this.callbacks.onTimeout(this.stats,this.context,null)},XhrLoader.prototype.loadprogress=function(e){var t=e.currentTarget,r=this.stats;r.loaded=e.loaded,e.lengthComputable&&(r.total=e.total);var n=this.callbacks.onProgress;n&&n(r,this.context,null,t)},XhrLoader}();t.default=o}}).default}))},function(e,t,r){"use strict";var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function toObject(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function shouldUseNative(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(i){return!1}}()?Object.assign:function(e,t){for(var r,o,s=toObject(e),u=1;u<arguments.length;u++){for(var l in r=Object(arguments[u]))i.call(r,l)&&(s[l]=r[l]);if(n){o=n(r);for(var c=0;c<o.length;c++)a.call(r,o[c])&&(s[o[c]]=r[o[c]])}}return s}},function(e,t,r){e.exports={default:r(264),__esModule:!0}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},function(e,t){var r=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++r+n).toString(36))}},function(e,t,r){var n=r(35).f,i=r(44),a=r(23)("toStringTag");e.exports=function(e,t,r){e&&!i(e=r?e:e.prototype,a)&&n(e,a,{configurable:!0,value:t})}},function(e,t,r){r(272);for(var n=r(22),i=r(43),a=r(48),o=r(23)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),u=0;u<s.length;u++){var l=s[u],c=n[l],f=c&&c.prototype;f&&!f[o]&&i(f,o,l),a[l]=a.Array}},function(e,t,r){"use strict";var n=r(300);e.exports=Function.prototype.bind||n},function(e,t,r){"use strict";var n=Object.getOwnPropertyDescriptor?function(){return Object.getOwnPropertyDescriptor(arguments,"callee").get}():function(){throw new TypeError},i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator,a=Object.getPrototypeOf||function(e){return e.__proto__},o=void 0,s="undefined"===typeof Uint8Array?void 0:a(Uint8Array),u={"$ %Array%":Array,"$ %ArrayBuffer%":"undefined"===typeof ArrayBuffer?void 0:ArrayBuffer,"$ %ArrayBufferPrototype%":"undefined"===typeof ArrayBuffer?void 0:ArrayBuffer.prototype,"$ %ArrayIteratorPrototype%":i?a([][Symbol.iterator]()):void 0,"$ %ArrayPrototype%":Array.prototype,"$ %ArrayProto_entries%":Array.prototype.entries,"$ %ArrayProto_forEach%":Array.prototype.forEach,"$ %ArrayProto_keys%":Array.prototype.keys,"$ %ArrayProto_values%":Array.prototype.values,"$ %AsyncFromSyncIteratorPrototype%":void 0,"$ %AsyncFunction%":void 0,"$ %AsyncFunctionPrototype%":void 0,"$ %AsyncGenerator%":void 0,"$ %AsyncGeneratorFunction%":void 0,"$ %AsyncGeneratorPrototype%":void 0,"$ %AsyncIteratorPrototype%":o&&i&&Symbol.asyncIterator?o[Symbol.asyncIterator]():void 0,"$ %Atomics%":"undefined"===typeof Atomics?void 0:Atomics,"$ %Boolean%":Boolean,"$ %BooleanPrototype%":Boolean.prototype,"$ %DataView%":"undefined"===typeof DataView?void 0:DataView,"$ %DataViewPrototype%":"undefined"===typeof DataView?void 0:DataView.prototype,"$ %Date%":Date,"$ %DatePrototype%":Date.prototype,"$ %decodeURI%":decodeURI,"$ %decodeURIComponent%":decodeURIComponent,"$ %encodeURI%":encodeURI,"$ %encodeURIComponent%":encodeURIComponent,"$ %Error%":Error,"$ %ErrorPrototype%":Error.prototype,"$ %eval%":eval,"$ %EvalError%":EvalError,"$ %EvalErrorPrototype%":EvalError.prototype,"$ %Float32Array%":"undefined"===typeof Float32Array?void 0:Float32Array,"$ %Float32ArrayPrototype%":"undefined"===typeof Float32Array?void 0:Float32Array.prototype,"$ %Float64Array%":"undefined"===typeof Float64Array?void 0:Float64Array,"$ %Float64ArrayPrototype%":"undefined"===typeof Float64Array?void 0:Float64Array.prototype,"$ %Function%":Function,"$ %FunctionPrototype%":Function.prototype,"$ %Generator%":void 0,"$ %GeneratorFunction%":void 0,"$ %GeneratorPrototype%":void 0,"$ %Int8Array%":"undefined"===typeof Int8Array?void 0:Int8Array,"$ %Int8ArrayPrototype%":"undefined"===typeof Int8Array?void 0:Int8Array.prototype,"$ %Int16Array%":"undefined"===typeof Int16Array?void 0:Int16Array,"$ %Int16ArrayPrototype%":"undefined"===typeof Int16Array?void 0:Int8Array.prototype,"$ %Int32Array%":"undefined"===typeof Int32Array?void 0:Int32Array,"$ %Int32ArrayPrototype%":"undefined"===typeof Int32Array?void 0:Int32Array.prototype,"$ %isFinite%":isFinite,"$ %isNaN%":isNaN,"$ %IteratorPrototype%":i?a(a([][Symbol.iterator]())):void 0,"$ %JSON%":JSON,"$ %JSONParse%":JSON.parse,"$ %Map%":"undefined"===typeof Map?void 0:Map,"$ %MapIteratorPrototype%":"undefined"!==typeof Map&&i?a((new Map)[Symbol.iterator]()):void 0,"$ %MapPrototype%":"undefined"===typeof Map?void 0:Map.prototype,"$ %Math%":Math,"$ %Number%":Number,"$ %NumberPrototype%":Number.prototype,"$ %Object%":Object,"$ %ObjectPrototype%":Object.prototype,"$ %ObjProto_toString%":Object.prototype.toString,"$ %ObjProto_valueOf%":Object.prototype.valueOf,"$ %parseFloat%":parseFloat,"$ %parseInt%":parseInt,"$ %Promise%":"undefined"===typeof Promise?void 0:Promise,"$ %PromisePrototype%":"undefined"===typeof Promise?void 0:Promise.prototype,"$ %PromiseProto_then%":"undefined"===typeof Promise?void 0:Promise.prototype.then,"$ %Promise_all%":"undefined"===typeof Promise?void 0:Promise.all,"$ %Promise_reject%":"undefined"===typeof Promise?void 0:Promise.reject,"$ %Promise_resolve%":"undefined"===typeof Promise?void 0:Promise.resolve,"$ %Proxy%":"undefined"===typeof Proxy?void 0:Proxy,"$ %RangeError%":RangeError,"$ %RangeErrorPrototype%":RangeError.prototype,"$ %ReferenceError%":ReferenceError,"$ %ReferenceErrorPrototype%":ReferenceError.prototype,"$ %Reflect%":"undefined"===typeof Reflect?void 0:Reflect,"$ %RegExp%":RegExp,"$ %RegExpPrototype%":RegExp.prototype,"$ %Set%":"undefined"===typeof Set?void 0:Set,"$ %SetIteratorPrototype%":"undefined"!==typeof Set&&i?a((new Set)[Symbol.iterator]()):void 0,"$ %SetPrototype%":"undefined"===typeof Set?void 0:Set.prototype,"$ %SharedArrayBuffer%":"undefined"===typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"$ %SharedArrayBufferPrototype%":"undefined"===typeof SharedArrayBuffer?void 0:SharedArrayBuffer.prototype,"$ %String%":String,"$ %StringIteratorPrototype%":i?a(""[Symbol.iterator]()):void 0,"$ %StringPrototype%":String.prototype,"$ %Symbol%":i?Symbol:void 0,"$ %SymbolPrototype%":i?Symbol.prototype:void 0,"$ %SyntaxError%":SyntaxError,"$ %SyntaxErrorPrototype%":SyntaxError.prototype,"$ %ThrowTypeError%":n,"$ %TypedArray%":s,"$ %TypedArrayPrototype%":s?s.prototype:void 0,"$ %TypeError%":TypeError,"$ %TypeErrorPrototype%":TypeError.prototype,"$ %Uint8Array%":"undefined"===typeof Uint8Array?void 0:Uint8Array,"$ %Uint8ArrayPrototype%":"undefined"===typeof Uint8Array?void 0:Uint8Array.prototype,"$ %Uint8ClampedArray%":"undefined"===typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"$ %Uint8ClampedArrayPrototype%":"undefined"===typeof Uint8ClampedArray?void 0:Uint8ClampedArray.prototype,"$ %Uint16Array%":"undefined"===typeof Uint16Array?void 0:Uint16Array,"$ %Uint16ArrayPrototype%":"undefined"===typeof Uint16Array?void 0:Uint16Array.prototype,"$ %Uint32Array%":"undefined"===typeof Uint32Array?void 0:Uint32Array,"$ %Uint32ArrayPrototype%":"undefined"===typeof Uint32Array?void 0:Uint32Array.prototype,"$ %URIError%":URIError,"$ %URIErrorPrototype%":URIError.prototype,"$ %WeakMap%":"undefined"===typeof WeakMap?void 0:WeakMap,"$ %WeakMapPrototype%":"undefined"===typeof WeakMap?void 0:WeakMap.prototype,"$ %WeakSet%":"undefined"===typeof WeakSet?void 0:WeakSet,"$ %WeakSetPrototype%":"undefined"===typeof WeakSet?void 0:WeakSet.prototype};e.exports=function GetIntrinsic(e,t){if(arguments.length>1&&"boolean"!==typeof t)throw new TypeError('"allowMissing" argument must be a boolean');var r="$ "+e;if(!(r in u))throw new SyntaxError("intrinsic "+e+" does not exist!");if("undefined"===typeof u[r]&&!t)throw new TypeError("intrinsic "+e+" exists, but is not available. Please file an issue!");return u[r]}},function(e,t){e.exports=function extend(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var i in n)r.call(n,i)&&(e[i]=n[i])}return e};var r=Object.prototype.hasOwnProperty},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return function handle(r,n,i){if(r)return 0===r.statusCode&&(r=new Error("There was an unexpected server error, please try again later.")),t(r);e(n)}}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function get(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function get(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";e.exports=1e-4},function(e,t,r){(function(n){t.log=function log(){var e;return"object"===typeof console&&console.log&&(e=console).log.apply(e,arguments)},t.formatArgs=function formatArgs(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;var r="color: "+this.color;t.splice(1,0,r,"color: inherit");var n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(n++,"%c"===e&&(i=n))})),t.splice(i,0,r)},t.save=function save(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(r){}},t.load=function load(){var e;try{e=t.storage.getItem("debug")}catch(r){}!e&&"undefined"!==typeof n&&"env"in n&&(e=Object({NODE_ENV:"production",PUBLIC_URL:"/cabana",REACT_APP_VIDEO_CDN:"https://cabana-video.azureedge.net"}).DEBUG);return e},t.useColors=function useColors(){if("undefined"!==typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!==typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!==typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function localstorage(){try{return localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=r(522)(t),e.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}).call(this,r(45))},function(e,t){t.encode=function(e){var t="";for(var r in e)e.hasOwnProperty(r)&&(t.length&&(t+="&"),t+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return t},t.decode=function(e){for(var t={},r=e.split("&"),n=0,i=r.length;n<i;n++){var a=r[n].split("=");t[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return t}},function(e,t){e.exports=function(e,t){var r=function fn(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t,r){(function(n){t.log=function log(){var e;return"object"===typeof console&&console.log&&(e=console).log.apply(e,arguments)},t.formatArgs=function formatArgs(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;var r="color: "+this.color;t.splice(1,0,r,"color: inherit");var n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(n++,"%c"===e&&(i=n))})),t.splice(i,0,r)},t.save=function save(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(r){}},t.load=function load(){var e;try{e=t.storage.getItem("debug")}catch(r){}!e&&"undefined"!==typeof n&&"env"in n&&(e=Object({NODE_ENV:"production",PUBLIC_URL:"/cabana",REACT_APP_VIDEO_CDN:"https://cabana-video.azureedge.net"}).DEBUG);return e},t.useColors=function useColors(){if("undefined"!==typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!==typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!==typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function localstorage(){try{return localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=r(541)(t),e.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}).call(this,r(45))},function(e,t,r){"use strict";function _arrayWithHoles(e){if(Array.isArray(e))return e}r.d(t,"a",(function(){return _arrayWithHoles}))},function(e,t,r){"use strict";function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}r.d(t,"a",(function(){return _nonIterableRest}))},function(e,t,r){"use strict";function _iterableToArray(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}r.d(t,"a",(function(){return _iterableToArray}))},function(e,t,r){var n=r(401);function wrap(e,t){return function(r,i){return n(r),function handler(e,t){return function(){return e(t)}}(t,e(r,i))}}e.exports={timeout:wrap(setTimeout,clearTimeout),interval:wrap(setInterval,clearInterval)}},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return json}));var n=r(0);function json(t,r){var i=r&&r.property?Object(n.t)(r.property):n.x;return Object(n.F)(t)&&!function isBuffer(t){return!("function"!==typeof e||!Object(n.D)(e.isBuffer))&&e.isBuffer(t)}(t)?function parseJSON(e,t){return t&&t.copy?JSON.parse(JSON.stringify(e)):e}(i(t)):i(JSON.parse(t))}json.responseType="json"}).call(this,r(21).Buffer)},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return json}));var n=r(0);function json(t,r){var i=r&&r.property?Object(n.t)(r.property):n.x;return Object(n.F)(t)&&!function isBuffer(t){return!("function"!==typeof e||!Object(n.D)(e.isBuffer))&&e.isBuffer(t)}(t)?function parseJSON(e,t){return t&&t.copy?JSON.parse(JSON.stringify(e)):e}(i(t)):i(JSON.parse(t))}json.responseType="json"}).call(this,r(21).Buffer)},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return json}));var n=r(0);function json(t,r){var i=r&&r.property?Object(n.t)(r.property):n.x;return Object(n.F)(t)&&!function isBuffer(t){return!("function"!==typeof e||!Object(n.D)(e.isBuffer))&&e.isBuffer(t)}(t)?function parseJSON(e,t){return t&&t.copy?JSON.parse(JSON.stringify(e)):e}(i(t)):i(JSON.parse(t))}json.responseType="json"}).call(this,r(21).Buffer)},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return json}));var n=r(0);function json(t,r){var i=r&&r.property?Object(n.t)(r.property):n.x;return Object(n.F)(t)&&!function isBuffer(t){return!("function"!==typeof e||!Object(n.D)(e.isBuffer))&&e.isBuffer(t)}(t)?function parseJSON(e,t){return t&&t.copy?JSON.parse(JSON.stringify(e)):e}(i(t)):i(JSON.parse(t))}json.responseType="json"}).call(this,r(21).Buffer)},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return json}));var n=r(0);function json(t,r){var i=r&&r.property?Object(n.t)(r.property):n.x;return Object(n.F)(t)&&!function isBuffer(t){return!("function"!==typeof e||!Object(n.D)(e.isBuffer))&&e.isBuffer(t)}(t)?function parseJSON(e,t){return t&&t.copy?JSON.parse(JSON.stringify(e)):e}(i(t)):i(JSON.parse(t))}json.responseType="json"}).call(this,r(21).Buffer)},,function(e,t,r){"use strict";function _extends(){return(_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var n=r(1),i=r(16),a=r.n(i),o=r(233),s=["client","offset","scroll","bounds","margin"];function getTypes(e){var t=[];return s.forEach((function(r){e[r]&&t.push(r)})),t}function getContentRect(e,t){var r={};if(t.indexOf("client")>-1&&(r.client={top:e.clientTop,left:e.clientLeft,width:e.clientWidth,height:e.clientHeight}),t.indexOf("offset")>-1&&(r.offset={top:e.offsetTop,left:e.offsetLeft,width:e.offsetWidth,height:e.offsetHeight}),t.indexOf("scroll")>-1&&(r.scroll={top:e.scrollTop,left:e.scrollLeft,width:e.scrollWidth,height:e.scrollHeight}),t.indexOf("bounds")>-1){var n=e.getBoundingClientRect();r.bounds={top:n.top,right:n.right,bottom:n.bottom,left:n.left,width:n.width,height:n.height}}if(t.indexOf("margin")>-1){var i=getComputedStyle(e);r.margin={top:i?parseInt(i.marginTop):0,right:i?parseInt(i.marginRight):0,bottom:i?parseInt(i.marginBottom):0,left:i?parseInt(i.marginLeft):0}}return r}var u=function withContentRect(e){return function(t){var r,i;return i=r=function(r){function WithContentRect(){for(var t,n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return(t=r.call.apply(r,[this].concat(i))||this).state={contentRect:{entry:{},client:{},offset:{},scroll:{},bounds:{},margin:{}}},t._animationFrameID=null,t._resizeObserver=null,t._node=null,t.measure=function(r){var n=getContentRect(t._node,e||getTypes(t.props));r&&(n.entry=r[0].contentRect),t._animationFrameID=window.requestAnimationFrame((function(){null!==t._resizeObserver&&(t.setState({contentRect:n}),"function"===typeof t.props.onResize&&t.props.onResize(n))}))},t._handleRef=function(e){null!==t._resizeObserver&&null!==t._node&&t._resizeObserver.unobserve(t._node),t._node=e,null!==t._resizeObserver&&null!==t._node&&t._resizeObserver.observe(t._node);var r=t.props.innerRef;r&&("function"===typeof r?r(t._node):r.current=t._node)},t}!function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(WithContentRect,r);var i=WithContentRect.prototype;return i.componentDidMount=function componentDidMount(){this._resizeObserver=new o.a(this.measure),null!==this._node&&(this._resizeObserver.observe(this._node),"function"===typeof this.props.onResize&&this.props.onResize(getContentRect(this._node,e||getTypes(this.props))))},i.componentWillUnmount=function componentWillUnmount(){null!==this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null),window.cancelAnimationFrame(this._animationFrameID)},i.render=function render(){var e=this.props,r=(e.innerRef,e.onResize,function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,["innerRef","onResize"]));return Object(n.createElement)(t,_extends({},r,{measureRef:this._handleRef,measure:this.measure,contentRect:this.state.contentRect}))},WithContentRect}(n.Component),r.propTypes={client:a.a.bool,offset:a.a.bool,scroll:a.a.bool,bounds:a.a.bool,margin:a.a.bool,innerRef:a.a.oneOfType([a.a.object,a.a.func]),onResize:a.a.func},i}}()((function(e){var t=e.measure,r=e.measureRef,n=e.contentRect;return(0,e.children)({measure:t,measureRef:r,contentRect:n})}));u.displayName="Measure",u.propTypes.children=a.a.func;t.a=u},,function(e,t,r){"use strict";var n=/("(?:[^\\"]|\\.)*")|[:,]/g;e.exports=function stringify(e,t){var r,i,a;return t=t||{},r=JSON.stringify([1],void 0,void 0===t.indent?2:t.indent).slice(2,-3),i=""===r?1/0:void 0===t.maxLength?80:t.maxLength,a=t.replacer,function _stringify(e,t,o){var s,u,l,c,f,d,h,p,g,m,v,y;if(e&&"function"===typeof e.toJSON&&(e=e.toJSON()),void 0===(v=JSON.stringify(e,a)))return v;if(h=i-t.length-o,v.length<=h&&(g=v.replace(n,(function(e,t){return t||e+" "}))).length<=h)return g;if(null!=a&&(e=JSON.parse(v),a=void 0),"object"===typeof e&&null!==e){if(p=t+r,l=[],u=0,Array.isArray(e))for(m="[",s="]",h=e.length;u<h;u++)l.push(_stringify(e[u],p,u===h-1?0:1)||"null");else for(m="{",s="}",h=(d=Object.keys(e)).length;u<h;u++)c=d[u],f=JSON.stringify(c)+": ",void 0!==(y=_stringify(e[c],p,f.length+(u===h-1?0:1)))&&l.push(f+y);if(l.length>0)return[m,r+l.join(",\n"+p),s].join("\n"+t)}return v}(e,"",0)}},function(e,t,r){"use strict";e.exports=function(e,t){t||(t={}),"function"===typeof t&&(t={cmp:t});var r,n="boolean"===typeof t.cycles&&t.cycles,i=t.cmp&&(r=t.cmp,function(e){return function(t,n){var i={key:t,value:e[t]},a={key:n,value:e[n]};return r(i,a)}}),a=[];return function stringify(e){if(e&&e.toJSON&&"function"===typeof e.toJSON&&(e=e.toJSON()),void 0!==e){if("number"==typeof e)return isFinite(e)?""+e:"null";if("object"!==typeof e)return JSON.stringify(e);var t,r;if(Array.isArray(e)){for(r="[",t=0;t<e.length;t++)t&&(r+=","),r+=stringify(e[t])||"null";return r+"]"}if(null===e)return"null";if(-1!==a.indexOf(e)){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var o=a.push(e)-1,s=Object.keys(e).sort(i&&i(e));for(r="",t=0;t<s.length;t++){var u=s[t],l=stringify(e[u]);l&&(r&&(r+=","),r+=JSON.stringify(u)+":"+l)}return a.splice(o,1),"{"+r+"}"}}(e)}},,,function(e,t){var r=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:r)(e)}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,r){var n=r(38),i=r(22).document,a=n(i)&&n(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},function(e,t,r){var n=r(38);e.exports=function(e,t){if(!n(e))return e;var r,i;if(t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;if("function"==typeof(r=e.valueOf)&&!n(i=r.call(e)))return i;if(!t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t,r){var n=r(30),i=r(267),a=r(108),o=r(106)("IE_PROTO"),s=function Empty(){},u=function createDict(){var e,t=r(101)("iframe"),n=a.length;for(t.style.display="none",r(145).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),u=e.F;n--;)delete u.prototype[a[n]];return u()};e.exports=Object.create||function create(e,t){var r;return null!==e?(s.prototype=n(e),r=new s,s.prototype=null,r[o]=e):r=u(),void 0===t?r:i(r,t)}},function(e,t,r){var n=r(144),i=r(108);e.exports=Object.keys||function keys(e){return n(e,i)}},function(e,t,r){var n=r(99),i=Math.min;e.exports=function(e){return e>0?i(n(e),9007199254740991):0}},function(e,t,r){var n=r(107)("keys"),i=r(70);e.exports=function(e){return n[e]||(n[e]=i(e))}},function(e,t,r){var n=r(20),i=r(22),a=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(e.exports=function(e,t){return a[e]||(a[e]=void 0!==t?t:{})})("versions",[]).push({version:n.version,mode:r(55)?"pure":"global",copyright:"\xa9 2019 Denis Pushkarev (zloirock.ru)"})},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,r){var n=r(100);e.exports=function(e){return Object(n(e))}},function(e,t,r){var n=r(57),i=r(23)("toStringTag"),a="Arguments"==n(function(){return arguments}());e.exports=function(e){var t,r,o;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function tryGet(e,t){try{return e[t]}catch(r){}}(t=Object(e),i))?r:a?n(t):"Object"==(o=n(t))&&"function"==typeof t.callee?"Arguments":o}},function(e,t,r){var n=r(110),i=r(23)("iterator"),a=r(48);e.exports=r(20).getIteratorMethod=function(e){if(void 0!=e)return e[i]||e["@@iterator"]||a[n(e)]}},function(e,t,r){"use strict";var n=r(68);function PromiseCapability(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n})),this.resolve=n(t),this.reject=n(r)}e.exports.f=function(e){return new PromiseCapability(e)}},function(e,t,r){"use strict";var n,i=Object.prototype.hasOwnProperty;function decode(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return null}}t.stringify=function querystringify(e,t){t=t||"";var r,a,o=[];for(a in"string"!==typeof t&&(t="?"),e)if(i.call(e,a)){if((r=e[a])||null!==r&&r!==n&&!isNaN(r)||(r=""),a=encodeURIComponent(a),r=encodeURIComponent(r),null===a||null===r)continue;o.push(a+"="+r)}return o.length?t+o.join("&"):""},t.parse=function querystring(e){for(var t,r=/([^=?&]+)=?([^&]*)/g,n={};t=r.exec(e);){var i=decode(t[1]),a=decode(t[2]);null===i||null===a||i in n||(n[i]=a)}return n}},function(e,t,r){var n=r(290),i=r(117),a=r(75),o=r(160),s=r(155),u=r(316),l=r(161),c=r(319),f=r(320),d=r(321);e.exports=function Client(e){return e=a(p,e=e||{}),Request.configure=function configure(t){o(e,t)},Request.config=e,function httpMethods(e){return h.forEach((function createMethod(t){e[t]=function(r,n,i){return"function"===typeof n&&(i=n,n={}),n.method=t,e(r,n,i)}})),e}(Request);function Request(t,r,h){t=t||"",s(r)&&(h=r,r={}),function setQuery(e){var t=e.query;if(!t)return;e.query=("string"===typeof t?String:d)(t)}(r=a(e.options,r)),function setToken(t){if(!t.token&&!e.token)return;t.headers=t.headers||{};var r=t.authorization||e.authorization||"Authorization",n=t.token||e.token;(t.jwt||e.jwt)&&(n="Bearer "+n);t.headers[r]=n,delete t.token}(r);var p=i(e.baseUrl,t);return n(p,r,function responseHandler(t,r){return function handleResponse(n,i,a){if(n)return t(n,null,a);if(l(a.statusCode))return function createError(e,t,r){var n=u(t.statusCode);if(!e)return r(n);if(e){if(Array.isArray(e)&&(e=e[0]),f(e))return r(o(n,e));c(e,(function(e,t){if(e)return r(e);r(o(n,t))}))}}(i,a,(function(e){t(e,null,a)}));var d=r.parse||e.parse;i=s(d)?d(i,a):i,t(null,i,a)}}(h,{url:p,method:r.method}))}};var h=["get","post","put","patch","head","delete"],p={baseUrl:"http://localhost:8000",jwt:!1,token:null,options:{}}},function(e,t,r){"use strict";var n=r(73);e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},function(e,t,r){"use strict";var n=Function.prototype.toString,i=/^\s*class\b/,a=function isES6ClassFunction(e){try{var t=n.call(e);return i.test(t)}catch(r){return!1}},o=Object.prototype.toString,s="function"===typeof Symbol&&"symbol"===typeof Symbol.toStringTag;e.exports=function isCallable(e){if(!e)return!1;if("function"!==typeof e&&"object"!==typeof e)return!1;if("function"===typeof e&&!e.prototype)return!0;if(s)return function tryFunctionToStr(e){try{return!a(e)&&(n.call(e),!0)}catch(t){return!1}}(e);if(a(e))return!1;var t=o.call(e);return"[object Function]"===t||"[object GeneratorFunction]"===t}},function(e,t,r){var n,i,a;a=function(){function normalize(e,t){return e=(e=(e=(e=e.replace(/:\//g,"://")).replace(/([^:\s])\/+/g,"$1/")).replace(/\/(\?|&|#[^!])/g,"$1")).replace(/(\?.+)\?/g,"$1&")}return function(){var e=arguments;"object"===typeof arguments[0]&&(e=arguments[0],arguments[1]);var t=[].slice.call(e,0).join("/");return normalize(t)}},e.exports?e.exports=a():void 0===(i="function"===typeof(n=a)?n.call(t,r,t,e):n)||(e.exports=i)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.COMMA_URL_ROOT="https://api.commadotai.com/",t.ATHENA_URL_ROOT="https://athena.comma.ai/";var n=t.VIDEO_HOST=Object({NODE_ENV:"production",PUBLIC_URL:"/cabana",REACT_APP_VIDEO_CDN:"https://cabana-video.azureedge.net"}).COMMA_VIDEO_CDN;n||(t.VIDEO_HOST=n="https://my-comma-video.azureedge.net")},function(e,t,r){(function(t){var n=r(165),i="undefined"!==typeof window?window:"undefined"!==typeof t?t:"undefined"!==typeof self?self:{};function isUndefined(e){return void 0===e}function isPlainObject(e){return"[object Object]"===Object.prototype.toString.call(e)}function isString(e){return"[object String]"===Object.prototype.toString.call(e)}function isArray(e){return"[object Array]"===Object.prototype.toString.call(e)}function supportsFetch(){if(!("fetch"in i))return!1;try{return new Headers,new Request(""),new Response,!0}catch(e){return!1}}function each(e,t){var r,n;if(isUndefined(e.length))for(r in e)hasKey(e,r)&&t.call(null,r,e[r]);else if(n=e.length)for(r=0;r<n;r++)t.call(null,r,e[r])}function truncate(e,t){if("number"!==typeof t)throw new Error("2nd argument to `truncate` function should be a number");return"string"!==typeof e||0===t?e:e.length<=t?e:e.substr(0,t)+"\u2026"}function hasKey(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function joinRegExp(e){for(var t,r=[],n=0,i=e.length;n<i;n++)isString(t=e[n])?r.push(t.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")):t&&t.source&&r.push(t.source);return new RegExp(r.join("|"),"i")}function htmlElementAsString(e){var t,r,n,i,a,o=[];if(!e||!e.tagName)return"";if(o.push(e.tagName.toLowerCase()),e.id&&o.push("#"+e.id),(t=e.className)&&isString(t))for(r=t.split(/\s+/),a=0;a<r.length;a++)o.push("."+r[a]);var s=["type","name","title","alt"];for(a=0;a<s.length;a++)n=s[a],(i=e.getAttribute(n))&&o.push("["+n+'="'+i+'"]');return o.join("")}function isOnlyOneTruthy(e,t){return!!(!!e^!!t)}function isSameStacktrace(e,t){if(isOnlyOneTruthy(e,t))return!1;var r,n,i=e.frames,a=t.frames;if(void 0===i||void 0===a)return!1;if(i.length!==a.length)return!1;for(var o=0;o<i.length;o++)if(r=i[o],n=a[o],r.filename!==n.filename||r.lineno!==n.lineno||r.colno!==n.colno||r.function!==n.function)return!1;return!0}var a=3,o=51200,s=40;function jsonSize(e){return function utf8Length(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(e))}function serializeValue(e){if("string"===typeof e){return truncate(e,40)}if("number"===typeof e||"boolean"===typeof e||"undefined"===typeof e)return e;var t=Object.prototype.toString.call(e);return"[object Object]"===t?"[Object]":"[object Array]"===t?"[Array]":"[object Function]"===t?e.name?"[Function: "+e.name+"]":"[Function]":e}e.exports={isObject:function isObject(e){return"object"===typeof e&&null!==e},isError:function isError(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return e instanceof Error}},isErrorEvent:function isErrorEvent(e){return"[object ErrorEvent]"===Object.prototype.toString.call(e)},isDOMError:function isDOMError(e){return"[object DOMError]"===Object.prototype.toString.call(e)},isDOMException:function isDOMException(e){return"[object DOMException]"===Object.prototype.toString.call(e)},isUndefined:isUndefined,isFunction:function isFunction(e){return"function"===typeof e},isPlainObject:isPlainObject,isString:isString,isArray:isArray,isEmptyObject:function isEmptyObject(e){if(!isPlainObject(e))return!1;for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},supportsErrorEvent:function supportsErrorEvent(){try{return new ErrorEvent(""),!0}catch(e){return!1}},supportsDOMError:function supportsDOMError(){try{return new DOMError(""),!0}catch(e){return!1}},supportsDOMException:function supportsDOMException(){try{return new DOMException(""),!0}catch(e){return!1}},supportsFetch:supportsFetch,supportsReferrerPolicy:function supportsReferrerPolicy(){if(!supportsFetch())return!1;try{return new Request("pickleRick",{referrerPolicy:"origin"}),!0}catch(e){return!1}},supportsPromiseRejectionEvent:function supportsPromiseRejectionEvent(){return"function"===typeof PromiseRejectionEvent},wrappedCallback:function wrappedCallback(e){return function dataCallback(t,r){var n=e(t)||t;return r&&r(n)||n}},each:each,objectMerge:function objectMerge(e,t){return t?(each(t,(function(t,r){e[t]=r})),e):e},truncate:truncate,objectFrozen:function objectFrozen(e){return!!Object.isFrozen&&Object.isFrozen(e)},hasKey:hasKey,joinRegExp:joinRegExp,urlencode:function urlencode(e){var t=[];return each(e,(function(e,r){t.push(encodeURIComponent(e)+"="+encodeURIComponent(r))})),t.join("&")},uuid4:function uuid4(){var e=i.crypto||i.msCrypto;if(!isUndefined(e)&&e.getRandomValues){var t=new Uint16Array(8);e.getRandomValues(t),t[3]=4095&t[3]|16384,t[4]=16383&t[4]|32768;var r=function pad(e){for(var t=e.toString(16);t.length<4;)t="0"+t;return t};return r(t[0])+r(t[1])+r(t[2])+r(t[3])+r(t[4])+r(t[5])+r(t[6])+r(t[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},htmlTreeAsString:function htmlTreeAsString(e){for(var t,r=[],n=0,i=0,a=" > ".length;e&&n++<5&&!("html"===(t=htmlElementAsString(e))||n>1&&i+r.length*a+t.length>=80);)r.push(t),i+=t.length,e=e.parentNode;return r.reverse().join(" > ")},htmlElementAsString:htmlElementAsString,isSameException:function isSameException(e,t){return!isOnlyOneTruthy(e,t)&&(e=e.values[0],t=t.values[0],e.type===t.type&&e.value===t.value&&(!function isBothUndefined(e,t){return isUndefined(e)&&isUndefined(t)}(e.stacktrace,t.stacktrace)&&isSameStacktrace(e.stacktrace,t.stacktrace)))},isSameStacktrace:isSameStacktrace,parseUrl:function parseUrl(e){if("string"!==typeof e)return{};var t=e.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/),r=t[6]||"",n=t[8]||"";return{protocol:t[2],host:t[4],path:t[5],relative:t[5]+r+n}},fill:function fill(e,t,r,n){if(null!=e){var i=e[t];e[t]=r(i),e[t].__raven__=!0,e[t].__orig__=i,n&&n.push([e,t,i])}},safeJoin:function safeJoin(e,t){if(!isArray(e))return"";for(var r=[],n=0;n<e.length;n++)try{r.push(String(e[n]))}catch(i){r.push("[value cannot be serialized]")}return r.join(t)},serializeException:function serializeException(e,t,r){if(!isPlainObject(e))return e;r="number"!==typeof(t="number"!==typeof t?a:t)?o:r;var i=function serializeObject(e,t){return 0===t?serializeValue(e):isPlainObject(e)?Object.keys(e).reduce((function(r,n){return r[n]=serializeObject(e[n],t-1),r}),{}):Array.isArray(e)?e.map((function(e){return serializeObject(e,t-1)})):serializeValue(e)}(e,t);return jsonSize(n(i))>r?serializeException(e,t-1):i},serializeKeysForMessage:function serializeKeysForMessage(e,t){if("number"===typeof e||"string"===typeof e)return e.toString();if(!Array.isArray(e))return"";if(0===(e=e.filter((function(e){return"string"===typeof e}))).length)return"[object has no keys]";if(t="number"!==typeof t?s:t,e[0].length>=t)return e[0];for(var r=e.length;r>0;r--){var n=e.slice(0,r).join(", ");if(!(n.length>t))return r===e.length?n:n+"\u2026"}return""},sanitize:function sanitize(e,t){if(!isArray(t)||isArray(t)&&0===t.length)return e;var r,i=joinRegExp(t),a="********";try{r=JSON.parse(n(e))}catch(o){return e}return function sanitizeWorker(e){return isArray(e)?e.map((function(e){return sanitizeWorker(e)})):isPlainObject(e)?Object.keys(e).reduce((function(t,r){return i.test(r)?t[r]=a:t[r]=sanitizeWorker(e[r]),t}),{}):e}(r)}}}).call(this,r(18))},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,r){(function(t){(function(){var r,n,i,a,o,s;"undefined"!==typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:"undefined"!==typeof t&&null!==t&&t.hrtime?(e.exports=function(){return(r()-o)/1e6},n=t.hrtime,a=(r=function getNanoSeconds(){var e;return 1e9*(e=n())[0]+e[1]})(),s=1e9*t.uptime(),o=a-s):Date.now?(e.exports=function(){return Date.now()-i},i=Date.now()):(e.exports=function(){return(new Date).getTime()-i},i=(new Date).getTime())}).call(this)}).call(this,r(45))},function(e,t,r){t.f=r(23)},function(e,t,r){var n=r(22),i=r(20),a=r(55),o=r(122),s=r(35).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=a?{}:n.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:o.f(e)})}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,r){"use strict";var n=r(40);e.exports=function sumNthPowerDeviations(e,t){var r,i,a=n(e),o=0;if(2===t)for(i=0;i<e.length;i++)o+=(r=e[i]-a)*r;else for(i=0;i<e.length;i++)o+=Math.pow(e[i]-a,t);return o}},function(e,t,r){"use strict";var n=r(127),i=r(422);function quantileSelect(e,t,r,n){t%1===0?i(e,t,r,n):(t=Math.floor(t),i(e,t,r,n),i(e,t+1,t+1,n))}function compare(e,t){return e-t}function quantileIndex(e,t){var r=e*t;return 1===t?e-1:0===t?0:r%1!==0?Math.ceil(r)-1:e%2===0?r-.5:r}e.exports=function quantile(e,t){var r=e.slice();if(Array.isArray(t)){!function multiQuantileSelect(e,t){for(var r=[0],n=0;n<t.length;n++)r.push(quantileIndex(e.length,t[n]));r.push(e.length-1),r.sort(compare);var i=[0,r.length-1];for(;i.length;){var a=Math.ceil(i.pop()),o=Math.floor(i.pop());if(!(a-o<=1)){var s=Math.floor((o+a)/2);quantileSelect(e,r[s],r[o],r[a]),i.push(o,s,s,a)}}}(r,t);for(var i=[],a=0;a<t.length;a++)i[a]=n(r,t[a]);return i}return quantileSelect(r,quantileIndex(r.length,t),0,r.length-1),n(r,t)}},function(e,t,r){"use strict";e.exports=function quantileSorted(e,t){var r=e.length*t;if(0===e.length)throw new Error("quantile requires at least one data point.");if(t<0||t>1)throw new Error("quantiles must be between 0 and 1");return 1===t?e[e.length-1]:0===t?e[0]:r%1!==0?e[Math.ceil(r)-1]:e.length%2===0?(e[r-1]+e[r])/2:e[r]}},function(e,t,r){"use strict";var n=r(125);e.exports=function sampleVariance(e){if(e.length<2)throw new Error("sampleVariance requires at least two data points");return n(e,2)/(e.length-1)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var i=_interopRequireDefault(r(460)),a=_interopRequireDefault(r(465)),o=_interopRequireDefault(r(192)),s=r(130),u=(0,i.default)(a.default);t.defaultSelectorHandlers=[function pseudoSelectors(e,t,r){return":"!==e[0]?null:r(t+e)},function mediaQueries(e,t,r){return"@"!==e[0]?null:e+"{"+r(t)+"}"}];t.generateCSS=function generateCSS(e,t,r,n,i){for(var a=new o.default,s=0;s<t.length;s++)a.addStyleType(t[s]);var u=new o.default,l="";return a.forEach((function(t,a){r.some((function(o){var s=o(a,e,(function(e){return generateCSS(e,[t],r,n,i)}));if(null!=s)return l+=s,!0}))||u.set(a,t,!0)})),c(e,u,n,i,r)+l};var l=function transformRule(e,t,r){return(0,s.kebabifyStyleName)(e)+":"+r(e,t)+";"},c=function generateCSSRuleset(e,t,r,i,a){!function runStringHandlers(e,t,r){if(t)for(var n=Object.keys(t),i=0;i<n.length;i++){var a=n[i];e.has(a)&&e.set(a,t[a](e.get(a),r),!1)}}(t,r,a);var o=n({},t.elements),c=u(t.elements),f=Object.keys(c);if(f.length!==t.keyOrder.length)for(var d=0;d<f.length;d++)if(!o.hasOwnProperty(f[d])){var h=void 0;if((h="W"===f[d][0]?f[d][6].toLowerCase()+f[d].slice(7):"o"===f[d][1]?f[d][3].toLowerCase()+f[d].slice(4):f[d][2].toLowerCase()+f[d].slice(3))&&o.hasOwnProperty(h)){var p=t.keyOrder.indexOf(h);t.keyOrder.splice(p,0,f[d])}else t.keyOrder.unshift(f[d])}var g=!1===i?s.stringifyValue:s.stringifyAndImportantifyValue,m=[];for(d=0;d<t.keyOrder.length;d++){var v=t.keyOrder[d],y=c[v];if(Array.isArray(y))for(var _=0;_<y.length;_++)m.push(l(v,y[_],g));else m.push(l(v,y,g))}return m.length?e+"{"+m.join("")+"}":""};t.generateCSSRuleset=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function sliceIterator(e,t){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(u){i=!0,a=u}finally{try{!n&&s.return&&s.return()}finally{if(i)throw a}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();var i=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(480));t.mapObj=function mapObj(e,t){for(var r=Object.keys(e),i={},a=0;a<r.length;a+=1){var o=t([r[a],e[r[a]]]),s=n(o,2),u=s[0],l=s[1];i[u]=l}return i};var a=/([A-Z])/g,o=function UPPERCASE_RE_TO_KEBAB(e){return"-"+e.toLowerCase()};t.kebabifyStyleName=function kebabifyStyleName(e){var t=e.replace(a,o);return"m"===t[0]&&"s"===t[1]&&"-"===t[2]?"-"+t:t};var s={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridColumn:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};var u=["Webkit","ms","Moz","O"];Object.keys(s).forEach((function(e){u.forEach((function(t){s[function prefixKey(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}(t,e)]=s[e]}))}));var l=function stringifyValue(e,t){return"number"===typeof t?s[e]?""+t:t+"px":""+t};t.stringifyValue=l;t.stringifyAndImportantifyValue=function stringifyAndImportantifyValue(e,t){return f(l(e,t))};var c=function hashString(e){return(0,i.default)(e).toString(36)};t.hashString=c;t.hashObject=function hashObject(e){return c(JSON.stringify(e))};var f=function importantify(e){return"!"===e[e.length-10]&&" !important"===e.slice(-11)?e:e+" !important"}},function(e,t,r){var n=r(527)("socket.io-parser"),i=r(51),a=r(529),o=r(207),s=r(208);function Encoder(){}t.protocol=4,t.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],t.CONNECT=0,t.DISCONNECT=1,t.EVENT=2,t.ACK=3,t.ERROR=4,t.BINARY_EVENT=5,t.BINARY_ACK=6,t.Encoder=Encoder,t.Decoder=Decoder;var u=t.ERROR+'"encode error"';function encodeAsString(e){var r=""+e.type;if(t.BINARY_EVENT!==e.type&&t.BINARY_ACK!==e.type||(r+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(r+=e.nsp+","),null!=e.id&&(r+=e.id),null!=e.data){var i=function tryStringify(e){try{return JSON.stringify(e)}catch(t){return!1}}(e.data);if(!1===i)return u;r+=i}return n("encoded %j as %s",e,r),r}function Decoder(){this.reconstructor=null}function BinaryReconstructor(e){this.reconPack=e,this.buffers=[]}function error(e){return{type:t.ERROR,data:"parser error: "+e}}Encoder.prototype.encode=function(e,r){(n("encoding packet %j",e),t.BINARY_EVENT===e.type||t.BINARY_ACK===e.type)?function encodeAsBinary(e,t){a.removeBlobs(e,(function writeEncoding(e){var r=a.deconstructPacket(e),n=encodeAsString(r.packet),i=r.buffers;i.unshift(n),t(i)}))}(e,r):r([encodeAsString(e)])},i(Decoder.prototype),Decoder.prototype.add=function(e){var r;if("string"===typeof e)r=function decodeString(e){var r=0,i={type:Number(e.charAt(0))};if(null==t.types[i.type])return error("unknown packet type "+i.type);if(t.BINARY_EVENT===i.type||t.BINARY_ACK===i.type){for(var a="";"-"!==e.charAt(++r)&&(a+=e.charAt(r),r!=e.length););if(a!=Number(a)||"-"!==e.charAt(r))throw new Error("Illegal attachments");i.attachments=Number(a)}if("/"===e.charAt(r+1))for(i.nsp="";++r;){if(","===(u=e.charAt(r)))break;if(i.nsp+=u,r===e.length)break}else i.nsp="/";var s=e.charAt(r+1);if(""!==s&&Number(s)==s){for(i.id="";++r;){var u;if(null==(u=e.charAt(r))||Number(u)!=u){--r;break}if(i.id+=e.charAt(r),r===e.length)break}i.id=Number(i.id)}if(e.charAt(++r)){var l=function tryParse(e){try{return JSON.parse(e)}catch(t){return!1}}(e.substr(r));if(!(!1!==l&&(i.type===t.ERROR||o(l))))return error("invalid payload");i.data=l}return n("decoded %s as %j",e,i),i}(e),t.BINARY_EVENT===r.type||t.BINARY_ACK===r.type?(this.reconstructor=new BinaryReconstructor(r),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",r)):this.emit("decoded",r);else{if(!s(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(r=this.reconstructor.takeBinaryData(e))&&(this.reconstructor=null,this.emit("decoded",r))}},Decoder.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},BinaryReconstructor.prototype.takeBinaryData=function(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){var t=a.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null},BinaryReconstructor.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},function(e,t,r){var n=r(532);e.exports=function(e){var t=e.xdomain,r=e.xscheme,i=e.enablesXDR;try{if("undefined"!==typeof XMLHttpRequest&&(!t||n))return new XMLHttpRequest}catch(a){}try{if("undefined"!==typeof XDomainRequest&&!r&&i)return new XDomainRequest}catch(a){}if(!t)try{return new(self[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(a){}}},function(e,t,r){var n=r(52),i=r(51);function Transport(e){this.path=e.path,this.hostname=e.hostname,this.port=e.port,this.secure=e.secure,this.query=e.query,this.timestampParam=e.timestampParam,this.timestampRequests=e.timestampRequests,this.readyState="",this.agent=e.agent||!1,this.socket=e.socket,this.enablesXDR=e.enablesXDR,this.withCredentials=e.withCredentials,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.forceNode=e.forceNode,this.isReactNative=e.isReactNative,this.extraHeaders=e.extraHeaders,this.localAddress=e.localAddress}e.exports=Transport,i(Transport.prototype),Transport.prototype.onError=function(e,t){var r=new Error(e);return r.type="TransportError",r.description=t,this.emit("error",r),this},Transport.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},Transport.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},Transport.prototype.send=function(e){if("open"!==this.readyState)throw new Error("Transport not open");this.write(e)},Transport.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},Transport.prototype.onData=function(e){var t=n.decodePacket(e,this.socket.binaryType);this.onPacket(t)},Transport.prototype.onPacket=function(e){this.emit("packet",e)},Transport.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},,,,,function(e,t,r){(function(r){var n;t=e.exports=SemVer,n="object"===typeof r&&Object({NODE_ENV:"production",PUBLIC_URL:"/cabana",REACT_APP_VIDEO_CDN:"https://cabana-video.azureedge.net"})&&Object({NODE_ENV:"production",PUBLIC_URL:"/cabana",REACT_APP_VIDEO_CDN:"https://cabana-video.azureedge.net"}).NODE_DEBUG&&/\bsemver\b/i.test(Object({NODE_ENV:"production",PUBLIC_URL:"/cabana",REACT_APP_VIDEO_CDN:"https://cabana-video.azureedge.net"}).NODE_DEBUG)?function debug(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function debug(){},t.SEMVER_SPEC_VERSION="2.0.0";var i=256,a=Number.MAX_SAFE_INTEGER||9007199254740991,o=t.re=[],s=t.src=[],u=t.tokens={},l=0;function tok(e){u[e]=l++}tok("NUMERICIDENTIFIER"),s[u.NUMERICIDENTIFIER]="0|[1-9]\\d*",tok("NUMERICIDENTIFIERLOOSE"),s[u.NUMERICIDENTIFIERLOOSE]="[0-9]+",tok("NONNUMERICIDENTIFIER"),s[u.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-][a-zA-Z0-9-]*",tok("MAINVERSION"),s[u.MAINVERSION]="("+s[u.NUMERICIDENTIFIER]+")\\.("+s[u.NUMERICIDENTIFIER]+")\\.("+s[u.NUMERICIDENTIFIER]+")",tok("MAINVERSIONLOOSE"),s[u.MAINVERSIONLOOSE]="("+s[u.NUMERICIDENTIFIERLOOSE]+")\\.("+s[u.NUMERICIDENTIFIERLOOSE]+")\\.("+s[u.NUMERICIDENTIFIERLOOSE]+")",tok("PRERELEASEIDENTIFIER"),s[u.PRERELEASEIDENTIFIER]="(?:"+s[u.NUMERICIDENTIFIER]+"|"+s[u.NONNUMERICIDENTIFIER]+")",tok("PRERELEASEIDENTIFIERLOOSE"),s[u.PRERELEASEIDENTIFIERLOOSE]="(?:"+s[u.NUMERICIDENTIFIERLOOSE]+"|"+s[u.NONNUMERICIDENTIFIER]+")",tok("PRERELEASE"),s[u.PRERELEASE]="(?:-("+s[u.PRERELEASEIDENTIFIER]+"(?:\\."+s[u.PRERELEASEIDENTIFIER]+")*))",tok("PRERELEASELOOSE"),s[u.PRERELEASELOOSE]="(?:-?("+s[u.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+s[u.PRERELEASEIDENTIFIERLOOSE]+")*))",tok("BUILDIDENTIFIER"),s[u.BUILDIDENTIFIER]="[0-9A-Za-z-]+",tok("BUILD"),s[u.BUILD]="(?:\\+("+s[u.BUILDIDENTIFIER]+"(?:\\."+s[u.BUILDIDENTIFIER]+")*))",tok("FULL"),tok("FULLPLAIN"),s[u.FULLPLAIN]="v?"+s[u.MAINVERSION]+s[u.PRERELEASE]+"?"+s[u.BUILD]+"?",s[u.FULL]="^"+s[u.FULLPLAIN]+"$",tok("LOOSEPLAIN"),s[u.LOOSEPLAIN]="[v=\\s]*"+s[u.MAINVERSIONLOOSE]+s[u.PRERELEASELOOSE]+"?"+s[u.BUILD]+"?",tok("LOOSE"),s[u.LOOSE]="^"+s[u.LOOSEPLAIN]+"$",tok("GTLT"),s[u.GTLT]="((?:<|>)?=?)",tok("XRANGEIDENTIFIERLOOSE"),s[u.XRANGEIDENTIFIERLOOSE]=s[u.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",tok("XRANGEIDENTIFIER"),s[u.XRANGEIDENTIFIER]=s[u.NUMERICIDENTIFIER]+"|x|X|\\*",tok("XRANGEPLAIN"),s[u.XRANGEPLAIN]="[v=\\s]*("+s[u.XRANGEIDENTIFIER]+")(?:\\.("+s[u.XRANGEIDENTIFIER]+")(?:\\.("+s[u.XRANGEIDENTIFIER]+")(?:"+s[u.PRERELEASE]+")?"+s[u.BUILD]+"?)?)?",tok("XRANGEPLAINLOOSE"),s[u.XRANGEPLAINLOOSE]="[v=\\s]*("+s[u.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+s[u.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+s[u.XRANGEIDENTIFIERLOOSE]+")(?:"+s[u.PRERELEASELOOSE]+")?"+s[u.BUILD]+"?)?)?",tok("XRANGE"),s[u.XRANGE]="^"+s[u.GTLT]+"\\s*"+s[u.XRANGEPLAIN]+"$",tok("XRANGELOOSE"),s[u.XRANGELOOSE]="^"+s[u.GTLT]+"\\s*"+s[u.XRANGEPLAINLOOSE]+"$",tok("COERCE"),s[u.COERCE]="(^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])",tok("COERCERTL"),o[u.COERCERTL]=new RegExp(s[u.COERCE],"g"),tok("LONETILDE"),s[u.LONETILDE]="(?:~>?)",tok("TILDETRIM"),s[u.TILDETRIM]="(\\s*)"+s[u.LONETILDE]+"\\s+",o[u.TILDETRIM]=new RegExp(s[u.TILDETRIM],"g");tok("TILDE"),s[u.TILDE]="^"+s[u.LONETILDE]+s[u.XRANGEPLAIN]+"$",tok("TILDELOOSE"),s[u.TILDELOOSE]="^"+s[u.LONETILDE]+s[u.XRANGEPLAINLOOSE]+"$",tok("LONECARET"),s[u.LONECARET]="(?:\\^)",tok("CARETTRIM"),s[u.CARETTRIM]="(\\s*)"+s[u.LONECARET]+"\\s+",o[u.CARETTRIM]=new RegExp(s[u.CARETTRIM],"g");tok("CARET"),s[u.CARET]="^"+s[u.LONECARET]+s[u.XRANGEPLAIN]+"$",tok("CARETLOOSE"),s[u.CARETLOOSE]="^"+s[u.LONECARET]+s[u.XRANGEPLAINLOOSE]+"$",tok("COMPARATORLOOSE"),s[u.COMPARATORLOOSE]="^"+s[u.GTLT]+"\\s*("+s[u.LOOSEPLAIN]+")$|^$",tok("COMPARATOR"),s[u.COMPARATOR]="^"+s[u.GTLT]+"\\s*("+s[u.FULLPLAIN]+")$|^$",tok("COMPARATORTRIM"),s[u.COMPARATORTRIM]="(\\s*)"+s[u.GTLT]+"\\s*("+s[u.LOOSEPLAIN]+"|"+s[u.XRANGEPLAIN]+")",o[u.COMPARATORTRIM]=new RegExp(s[u.COMPARATORTRIM],"g");tok("HYPHENRANGE"),s[u.HYPHENRANGE]="^\\s*("+s[u.XRANGEPLAIN]+")\\s+-\\s+("+s[u.XRANGEPLAIN]+")\\s*$",tok("HYPHENRANGELOOSE"),s[u.HYPHENRANGELOOSE]="^\\s*("+s[u.XRANGEPLAINLOOSE]+")\\s+-\\s+("+s[u.XRANGEPLAINLOOSE]+")\\s*$",tok("STAR"),s[u.STAR]="(<|>)?=?\\s*\\*";for(var c=0;c<l;c++)n(c,s[c]),o[c]||(o[c]=new RegExp(s[c]));function parse(e,t){if(t&&"object"===typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof SemVer)return e;if("string"!==typeof e)return null;if(e.length>i)return null;if(!(t.loose?o[u.LOOSE]:o[u.FULL]).test(e))return null;try{return new SemVer(e,t)}catch(r){return null}}function SemVer(e,t){if(t&&"object"===typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof SemVer){if(e.loose===t.loose)return e;e=e.version}else if("string"!==typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>i)throw new TypeError("version is longer than "+i+" characters");if(!(this instanceof SemVer))return new SemVer(e,t);n("SemVer",e,t),this.options=t,this.loose=!!t.loose;var r=e.trim().match(t.loose?o[u.LOOSE]:o[u.FULL]);if(!r)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>a||this.major<0)throw new TypeError("Invalid major version");if(this.minor>a||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>a||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t<a)return t}return e})):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}t.parse=parse,t.valid=function valid(e,t){var r=parse(e,t);return r?r.version:null},t.clean=function clean(e,t){var r=parse(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null},t.SemVer=SemVer,SemVer.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},SemVer.prototype.toString=function(){return this.version},SemVer.prototype.compare=function(e){return n("SemVer.compare",this.version,this.options,e),e instanceof SemVer||(e=new SemVer(e,this.options)),this.compareMain(e)||this.comparePre(e)},SemVer.prototype.compareMain=function(e){return e instanceof SemVer||(e=new SemVer(e,this.options)),compareIdentifiers(this.major,e.major)||compareIdentifiers(this.minor,e.minor)||compareIdentifiers(this.patch,e.patch)},SemVer.prototype.comparePre=function(e){if(e instanceof SemVer||(e=new SemVer(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;var t=0;do{var r=this.prerelease[t],i=e.prerelease[t];if(n("prerelease compare",t,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 compareIdentifiers(r,i)}while(++t)},SemVer.prototype.compareBuild=function(e){e instanceof SemVer||(e=new SemVer(e,this.options));var t=0;do{var r=this.build[t],i=e.build[t];if(n("prerelease compare",t,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 compareIdentifiers(r,i)}while(++t)},SemVer.prototype.inc=function(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);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)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=function inc(e,t,r,n){"string"===typeof r&&(n=r,r=void 0);try{return new SemVer(e,r).inc(t,n).version}catch(i){return null}},t.diff=function diff(e,t){if(eq(e,t))return null;var r=parse(e),n=parse(t),i="";if(r.prerelease.length||n.prerelease.length){i="pre";var a="prerelease"}for(var o in r)if(("major"===o||"minor"===o||"patch"===o)&&r[o]!==n[o])return i+o;return a},t.compareIdentifiers=compareIdentifiers;var f=/^[0-9]+$/;function compareIdentifiers(e,t){var r=f.test(e),n=f.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1}function compare(e,t,r){return new SemVer(e,r).compare(new SemVer(t,r))}function gt(e,t,r){return compare(e,t,r)>0}function lt(e,t,r){return compare(e,t,r)<0}function eq(e,t,r){return 0===compare(e,t,r)}function neq(e,t,r){return 0!==compare(e,t,r)}function gte(e,t,r){return compare(e,t,r)>=0}function lte(e,t,r){return compare(e,t,r)<=0}function cmp(e,t,r,n){switch(t){case"===":return"object"===typeof e&&(e=e.version),"object"===typeof r&&(r=r.version),e===r;case"!==":return"object"===typeof e&&(e=e.version),"object"===typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return eq(e,r,n);case"!=":return neq(e,r,n);case">":return gt(e,r,n);case">=":return gte(e,r,n);case"<":return lt(e,r,n);case"<=":return lte(e,r,n);default:throw new TypeError("Invalid operator: "+t)}}function Comparator(e,t){if(t&&"object"===typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof Comparator){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof Comparator))return new Comparator(e,t);n("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===d?this.value="":this.value=this.operator+this.semver.version,n("comp",this)}t.rcompareIdentifiers=function rcompareIdentifiers(e,t){return compareIdentifiers(t,e)},t.major=function major(e,t){return new SemVer(e,t).major},t.minor=function minor(e,t){return new SemVer(e,t).minor},t.patch=function patch(e,t){return new SemVer(e,t).patch},t.compare=compare,t.compareLoose=function compareLoose(e,t){return compare(e,t,!0)},t.compareBuild=function compareBuild(e,t,r){var n=new SemVer(e,r),i=new SemVer(t,r);return n.compare(i)||n.compareBuild(i)},t.rcompare=function rcompare(e,t,r){return compare(t,e,r)},t.sort=function sort(e,r){return e.sort((function(e,n){return t.compareBuild(e,n,r)}))},t.rsort=function rsort(e,r){return e.sort((function(e,n){return t.compareBuild(n,e,r)}))},t.gt=gt,t.lt=lt,t.eq=eq,t.neq=neq,t.gte=gte,t.lte=lte,t.cmp=cmp,t.Comparator=Comparator;var d={};function Range(e,t){if(t&&"object"===typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof Range)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new Range(e.raw,t);if(e instanceof Comparator)return new Range(e.value,t);if(!(this instanceof Range))return new Range(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function isSatisfiable(e,t){for(var r=!0,n=e.slice(),i=n.pop();r&&n.length;)r=n.every((function(e){return i.intersects(e,t)})),i=n.pop();return r}function isX(e){return!e||"x"===e.toLowerCase()||"*"===e}function hyphenReplace(e,t,r,n,i,a,o,s,u,l,c,f,d){return((t=isX(r)?"":isX(n)?">="+r+".0.0":isX(i)?">="+r+"."+n+".0":">="+t)+" "+(s=isX(u)?"":isX(l)?"<"+(+u+1)+".0.0":isX(c)?"<"+u+"."+(+l+1)+".0":f?"<="+u+"."+l+"."+c+"-"+f:"<="+s)).trim()}function testSet(e,t,r){for(var i=0;i<e.length;i++)if(!e[i].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(i=0;i<e.length;i++)if(n(e[i].semver),e[i].semver!==d&&e[i].semver.prerelease.length>0){var a=e[i].semver;if(a.major===t.major&&a.minor===t.minor&&a.patch===t.patch)return!0}return!1}return!0}function satisfies(e,t,r){try{t=new Range(t,r)}catch(n){return!1}return t.test(e)}function outside(e,t,r,n){var i,a,o,s,u;switch(e=new SemVer(e,n),t=new Range(t,n),r){case">":i=gt,a=lte,o=lt,s=">",u=">=";break;case"<":i=lt,a=gte,o=gt,s="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(satisfies(e,t,n))return!1;for(var l=0;l<t.set.length;++l){var c=t.set[l],f=null,h=null;if(c.forEach((function(e){e.semver===d&&(e=new Comparator(">=0.0.0")),f=f||e,h=h||e,i(e.semver,f.semver,n)?f=e:o(e.semver,h.semver,n)&&(h=e)})),f.operator===s||f.operator===u)return!1;if((!h.operator||h.operator===s)&&a(e,h.semver))return!1;if(h.operator===u&&o(e,h.semver))return!1}return!0}Comparator.prototype.parse=function(e){var t=this.options.loose?o[u.COMPARATORLOOSE]:o[u.COMPARATOR],r=e.match(t);if(!r)throw new TypeError("Invalid comparator: "+e);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new SemVer(r[2],this.options.loose):this.semver=d},Comparator.prototype.toString=function(){return this.value},Comparator.prototype.test=function(e){if(n("Comparator.test",e,this.options.loose),this.semver===d||e===d)return!0;if("string"===typeof e)try{e=new SemVer(e,this.options)}catch(t){return!1}return cmp(e,this.operator,this.semver,this.options)},Comparator.prototype.intersects=function(e,t){if(!(e instanceof Comparator))throw new TypeError("a Comparator is required");var r;if(t&&"object"===typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||(r=new Range(e.value,t),satisfies(this.value,r,t));if(""===e.operator)return""===e.value||(r=new Range(this.value,t),satisfies(e.semver,r,t));var n=(">="===this.operator||">"===this.operator)&&(">="===e.operator||">"===e.operator),i=("<="===this.operator||"<"===this.operator)&&("<="===e.operator||"<"===e.operator),a=this.semver.version===e.semver.version,o=(">="===this.operator||"<="===this.operator)&&(">="===e.operator||"<="===e.operator),s=cmp(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),u=cmp(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return n||i||a&&o||s||u},t.Range=Range,Range.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},Range.prototype.toString=function(){return this.range},Range.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var r=t?o[u.HYPHENRANGELOOSE]:o[u.HYPHENRANGE];e=e.replace(r,hyphenReplace),n("hyphen replace",e),e=e.replace(o[u.COMPARATORTRIM],"$1$2$3"),n("comparator trim",e,o[u.COMPARATORTRIM]),e=(e=(e=e.replace(o[u.TILDETRIM],"$1~")).replace(o[u.CARETTRIM],"$1^")).split(/\s+/).join(" ");var i=t?o[u.COMPARATORLOOSE]:o[u.COMPARATOR],a=e.split(" ").map((function(e){return function parseComparator(e,t){return n("comp",e,t),e=function replaceCarets(e,t){return e.trim().split(/\s+/).map((function(e){return function replaceCaret(e,t){n("caret",e,t);var r=t.loose?o[u.CARETLOOSE]:o[u.CARET];return e.replace(r,(function(t,r,i,a,o){var s;return n("caret",e,t,r,i,a,o),isX(r)?s="":isX(i)?s=">="+r+".0.0 <"+(+r+1)+".0.0":isX(a)?s="0"===r?">="+r+"."+i+".0 <"+r+"."+(+i+1)+".0":">="+r+"."+i+".0 <"+(+r+1)+".0.0":o?(n("replaceCaret pr",o),s="0"===r?"0"===i?">="+r+"."+i+"."+a+"-"+o+" <"+r+"."+i+"."+(+a+1):">="+r+"."+i+"."+a+"-"+o+" <"+r+"."+(+i+1)+".0":">="+r+"."+i+"."+a+"-"+o+" <"+(+r+1)+".0.0"):(n("no pr"),s="0"===r?"0"===i?">="+r+"."+i+"."+a+" <"+r+"."+i+"."+(+a+1):">="+r+"."+i+"."+a+" <"+r+"."+(+i+1)+".0":">="+r+"."+i+"."+a+" <"+(+r+1)+".0.0"),n("caret return",s),s}))}(e,t)})).join(" ")}(e,t),n("caret",e),e=function replaceTildes(e,t){return e.trim().split(/\s+/).map((function(e){return function replaceTilde(e,t){var r=t.loose?o[u.TILDELOOSE]:o[u.TILDE];return e.replace(r,(function(t,r,i,a,o){var s;return n("tilde",e,t,r,i,a,o),isX(r)?s="":isX(i)?s=">="+r+".0.0 <"+(+r+1)+".0.0":isX(a)?s=">="+r+"."+i+".0 <"+r+"."+(+i+1)+".0":o?(n("replaceTilde pr",o),s=">="+r+"."+i+"."+a+"-"+o+" <"+r+"."+(+i+1)+".0"):s=">="+r+"."+i+"."+a+" <"+r+"."+(+i+1)+".0",n("tilde return",s),s}))}(e,t)})).join(" ")}(e,t),n("tildes",e),e=function replaceXRanges(e,t){return n("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function replaceXRange(e,t){e=e.trim();var r=t.loose?o[u.XRANGELOOSE]:o[u.XRANGE];return e.replace(r,(function(r,i,a,o,s,u){n("xRange",e,r,i,a,o,s,u);var l=isX(a),c=l||isX(o),f=c||isX(s),d=f;return"="===i&&d&&(i=""),u=t.includePrerelease?"-0":"",l?r=">"===i||"<"===i?"<0.0.0-0":"*":i&&d?(c&&(o=0),s=0,">"===i?(i=">=",c?(a=+a+1,o=0,s=0):(o=+o+1,s=0)):"<="===i&&(i="<",c?a=+a+1:o=+o+1),r=i+a+"."+o+"."+s+u):c?r=">="+a+".0.0"+u+" <"+(+a+1)+".0.0"+u:f&&(r=">="+a+"."+o+".0"+u+" <"+a+"."+(+o+1)+".0"+u),n("xRange return",r),r}))}(e,t)})).join(" ")}(e,t),n("xrange",e),e=function replaceStars(e,t){return n("replaceStars",e,t),e.trim().replace(o[u.STAR],"")}(e,t),n("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(a=a.filter((function(e){return!!e.match(i)}))),a=a.map((function(e){return new Comparator(e,this.options)}),this)},Range.prototype.intersects=function(e,t){if(!(e instanceof Range))throw new TypeError("a Range is required");return this.set.some((function(r){return isSatisfiable(r,t)&&e.set.some((function(e){return isSatisfiable(e,t)&&r.every((function(r){return e.every((function(e){return r.intersects(e,t)}))}))}))}))},t.toComparators=function toComparators(e,t){return new Range(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},Range.prototype.test=function(e){if(!e)return!1;if("string"===typeof e)try{e=new SemVer(e,this.options)}catch(r){return!1}for(var t=0;t<this.set.length;t++)if(testSet(this.set[t],e,this.options))return!0;return!1},t.satisfies=satisfies,t.maxSatisfying=function maxSatisfying(e,t,r){var n=null,i=null;try{var a=new Range(t,r)}catch(o){return null}return e.forEach((function(e){a.test(e)&&(n&&-1!==i.compare(e)||(i=new SemVer(n=e,r)))})),n},t.minSatisfying=function minSatisfying(e,t,r){var n=null,i=null;try{var a=new Range(t,r)}catch(o){return null}return e.forEach((function(e){a.test(e)&&(n&&1!==i.compare(e)||(i=new SemVer(n=e,r)))})),n},t.minVersion=function minVersion(e,t){e=new Range(e,t);var r=new SemVer("0.0.0");if(e.test(r))return r;if(r=new SemVer("0.0.0-0"),e.test(r))return r;r=null;for(var n=0;n<e.set.length;++n){e.set[n].forEach((function(e){var t=new SemVer(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":r&&!gt(r,t)||(r=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}))}if(r&&e.test(r))return r;return null},t.validRange=function validRange(e,t){try{return new Range(e,t).range||"*"}catch(r){return null}},t.ltr=function ltr(e,t,r){return outside(e,t,"<",r)},t.gtr=function gtr(e,t,r){return outside(e,t,">",r)},t.outside=outside,t.prerelease=function prerelease(e,t){var r=parse(e,t);return r&&r.prerelease.length?r.prerelease:null},t.intersects=function intersects(e,t,r){return e=new Range(e,r),t=new Range(t,r),e.intersects(t)},t.coerce=function coerce(e,t){if(e instanceof SemVer)return e;"number"===typeof e&&(e=String(e));if("string"!==typeof e)return null;var r=null;if((t=t||{}).rtl){for(var n;(n=o[u.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&n.index+n[0].length===r.index+r[0].length||(r=n),o[u.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;o[u.COERCERTL].lastIndex=-1}else r=e.match(o[u.COERCE]);if(null===r)return null;return parse(r[2]+"."+(r[3]||"0")+"."+(r[4]||"0"),t)}}).call(this,r(45))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function default_1(e){var t=/\/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t[0],version:t[1]}}},function(e,t){},function(e,t,r){"use strict";var n=r(55),i=r(29),a=r(143),o=r(43),s=r(48),u=r(266),l=r(71),c=r(271),f=r(23)("iterator"),d=!([].keys&&"next"in[].keys()),h=function returnThis(){return this};e.exports=function(e,t,r,p,g,m,v){u(r,t,p);var y,_,b,x=function getMethod(e){if(!d&&e in E)return E[e];switch(e){case"keys":return function keys(){return new r(this,e)};case"values":return function values(){return new r(this,e)}}return function entries(){return new r(this,e)}},w=t+" Iterator",k="values"==g,S=!1,E=e.prototype,C=E[f]||E["@@iterator"]||g&&E[g],T=C||x(g),O=g?k?x("entries"):T:void 0,A="Array"==t&&E.entries||C;if(A&&(b=c(A.call(new e)))!==Object.prototype&&b.next&&(l(b,w,!0),n||"function"==typeof b[f]||o(b,f,h)),k&&C&&"values"!==C.name&&(S=!0,T=function values(){return C.call(this)}),n&&!v||!d&&!S&&E[f]||o(E,f,T),s[t]=T,s[w]=h,g)if(y={values:k?T:x("values"),keys:m?T:x("keys"),entries:O},v)for(_ in y)_ in E||a(E,_,y[_]);else i(i.P+i.F*(d||S),t,y);return y}},function(e,t,r){e.exports=!r(39)&&!r(69)((function(){return 7!=Object.defineProperty(r(101)("div"),"a",{get:function get(){return 7}}).a}))},function(e,t,r){e.exports=r(43)},function(e,t,r){var n=r(44),i=r(49),a=r(269)(!1),o=r(106)("IE_PROTO");e.exports=function(e,t){var r,s=i(e),u=0,l=[];for(r in s)r!=o&&n(s,r)&&l.push(r);for(;t.length>u;)n(s,r=t[u++])&&(~a(l,r)||l.push(r));return l}},function(e,t,r){var n=r(22).document;e.exports=n&&n.documentElement},function(e,t,r){var n=r(30);e.exports=function(e,t,r,i){try{return i?t(n(r)[0],r[1]):t(r)}catch(o){var a=e.return;throw void 0!==a&&n(a.call(e)),o}}},function(e,t,r){var n=r(48),i=r(23)("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(n.Array===e||a[i]===e)}},function(e,t,r){var n=r(30),i=r(68),a=r(23)("species");e.exports=function(e,t){var r,o=n(e).constructor;return void 0===o||void 0==(r=n(o)[a])?t:i(r)}},function(e,t,r){var n,i,a,o=r(47),s=r(278),u=r(145),l=r(101),c=r(22),f=c.process,d=c.setImmediate,h=c.clearImmediate,p=c.MessageChannel,g=c.Dispatch,m=0,v={},y=function run(){var e=+this;if(v.hasOwnProperty(e)){var t=v[e];delete v[e],t()}},_=function listener(e){y.call(e.data)};d&&h||(d=function setImmediate(e){for(var t=[],r=1;arguments.length>r;)t.push(arguments[r++]);return v[++m]=function(){s("function"==typeof e?e:Function(e),t)},n(m),m},h=function clearImmediate(e){delete v[e]},"process"==r(57)(f)?n=function defer(e){f.nextTick(o(y,e,1))}:g&&g.now?n=function defer(e){g.now(o(y,e,1))}:p?(a=(i=new p).port2,i.port1.onmessage=_,n=o(a.postMessage,a,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(n=function defer(e){c.postMessage(e+"","*")},c.addEventListener("message",_,!1)):n="onreadystatechange"in l("script")?function defer(e){u.appendChild(l("script")).onreadystatechange=function(){u.removeChild(this),y.call(e)}}:function defer(e){setTimeout(o(y,e,1),0)}),e.exports={set:d,clear:h}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(t){return{e:!0,v:t}}}},function(e,t,r){var n=r(30),i=r(38),a=r(112);e.exports=function(e,t){if(n(e),i(t)&&t.constructor===e)return t;var r=a.f(e);return(0,r.resolve)(t),r.promise}},function(e,t,r){var n=r(23)("iterator"),i=!1;try{var a=[7][n]();a.return=function(){i=!0},Array.from(a,(function(){throw 2}))}catch(o){}e.exports=function(e,t){if(!t&&!i)return!1;var r=!1;try{var a=[7],s=a[n]();s.next=function(){return{done:r=!0}},a[n]=function(){return s},e(a)}catch(o){}return r}},function(e,t,r){(function(t){var n,i="undefined"!==typeof t?t:"undefined"!==typeof window?window:{},a=r(285);"undefined"!==typeof document?n=document:(n=i["__GLOBAL_DOCUMENT_CACHE@4"])||(n=i["__GLOBAL_DOCUMENT_CACHE@4"]=a),e.exports=n}).call(this,r(18))},function(e,t,r){"use strict";e.exports=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}},function(e,t){e.exports=function isFunction(e){var t=r.call(e);return"[object Function]"===t||"function"===typeof e&&"[object RegExp]"!==t||"undefined"!==typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)};var r=Object.prototype.toString},function(e,t,r){"use strict";var n=r(301),i="function"===typeof Symbol&&"symbol"===typeof Symbol("foo"),a=Object.prototype.toString,o=Array.prototype.concat,s=Object.defineProperty,u=s&&function arePropertyDescriptorsSupported(){var e={};try{for(var t in s(e,"x",{enumerable:!1,value:e}),e)return!1;return e.x===e}catch(r){return!1}}(),l=function defineProperty(e,t,r,n){(!(t in e)||function isFunction(e){return"function"===typeof e&&"[object Function]"===a.call(e)}(n)&&n())&&(u?s(e,t,{configurable:!0,enumerable:!1,value:r,writable:!0}):e[t]=r)},c=function defineProperties(e,t){var r=arguments.length>2?arguments[2]:{},a=n(t);i&&(a=o.call(a,Object.getOwnPropertySymbols(t)));for(var s=0;s<a.length;s+=1)l(e,a[s],t[a[s]],r[a[s]])};c.supportsDescriptors=!!u,e.exports=c},function(e,t,r){"use strict";var n=Object.prototype.toString;e.exports=function isArguments(e){var t=n.call(e),r="[object Arguments]"===t;return r||(r="[object Array]"!==t&&null!==e&&"object"===typeof e&&"number"===typeof e.length&&e.length>=0&&"[object Function]"===n.call(e.callee)),r}},function(e,t,r){"use strict";var n=r(73),i=r(303),a=n.call(Function.call,String.prototype.replace),o=/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,s=/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;e.exports=function trim(){var e=i.ToString(i.CheckObjectCoercible(this));return a(a(e,o,""),s,"")}},function(e,t,r){"use strict";var n=r(158);e.exports=function getPolyfill(){return String.prototype.trim&&"\u200b"==="\u200b".trim()?String.prototype.trim:n}},function(e,t){e.exports=function extend(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)r.call(n,i)&&(e[i]=n[i])}return e};var r=Object.prototype.hasOwnProperty},function(e,t,r){"use strict";e.exports=function isErrorCode(e){return e<200||e>=400}},function(e,t,r){e.exports={default:r(336),__esModule:!0}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=_interopRequireDefault(r(67));t.default=function ConfigRequestPromise(){var e=(0,i.default)();e.get,e.post,e.patch;return e.get=o(e.get.bind(e)),e.post=o(e.post.bind(e)),e.patch=o(e.patch.bind(e)),e};var i=_interopRequireDefault(r(114)),a=_interopRequireDefault(r(76));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var o=function wrap(e){return function(t,r){return new n.default((function(n,i){e(t,r||{},(0,a.default)(n,i))}))}}},function(e,t,r){"use strict";t.__esModule=!0;var n=_interopRequireDefault(r(356)),i=_interopRequireDefault(r(359));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}t.default=function(){return function(e,t){if(Array.isArray(e))return e;if((0,n.default)(Object(e)))return function sliceIterator(e,t){var r=[],n=!0,a=!1,o=void 0;try{for(var s,u=(0,i.default)(e);!(n=(s=u.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(l){a=!0,o=l}finally{try{!n&&u.return&&u.return()}finally{if(a)throw o}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()},function(e,t){function indexOf(e,t){for(var r=0;r<e.length;++r)if(e[r]===t)return r;return-1}function serializer(e,t){var r=[],n=[];return null==t&&(t=function cycleReplacer(e,t){return r[0]===t?"[Circular ~]":"[Circular ~."+n.slice(0,indexOf(r,t)).join(".")+"]"}),function(i,a){if(r.length>0){var o=indexOf(r,this);~o?r.splice(o+1):r.push(this),~o?n.splice(o,1/0,i):n.push(i),~indexOf(r,a)&&(a=t.call(this,i,a))}else r.push(a);return null==e?a instanceof Error?function stringifyError(e){var t={stack:e.stack,message:e.message,name:e.name};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}(a):a:e.call(this,i,a)}}(e.exports=function stringify(e,t,r,n){return JSON.stringify(e,serializer(t,n),r)}).getSerialize=serializer},function(e,t,r){"use strict";t.__esModule=!0;var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(371));t.default=function(){function defineProperties(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),(0,n.default)(e,i.key,i)}}return function(e,t,r){return t&&defineProperties(e.prototype,t),r&&defineProperties(e,r),e}}()},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.unpackCAN=function unpackCAN(t){if(t.byteLength%i!==0){throw new Error("can-message.unpackCAN: byteLength must be a multiple of "+i)}for(var r=[],a=0;a<t.byteLength;a+=i){var o=t.slice(a,a+i),s=e.from(o),u=s.readInt32LE(0),l=s.readInt32LE(4),c=void 0;c=(u&n)>>>0?u>>>3:u>>>21;var f=l>>>16,d=new e(o.slice(8,8+(15&l))),h={address:c,busTime:f,data:d,bus:15&l>>4};r.push(h)}return r},t.packCAN=function packCAN(t){var i=t.address,a=t.data,o=t.bus;if(a.byteLength>8){throw new Error("can-message.packCAN: byteLength cannot be greater than 8")}i=i>=2048?(i<<3|r|n)>>>0:(i<<21|r)>>>0;var s=e.alloc(16);return s.writeUInt32LE(i),s.writeUInt32LE((a.byteLength|o<<4)>>>0,4),a.copy(s,8),s};var r=t.CAN_TRANSMIT=1,n=t.CAN_EXTENDED=4,i=16}).call(this,r(21).Buffer)},function(e,t,r){"use strict";var n=r(374),i=r(375),a=r(377),o=r(378);e.exports=function WeakmapEvent(){var e=i();return listen.toHash=a(listen),listen.toArray=o(listen),{broadcast:function broadcast(e,t){if(1===arguments.length)throw new Error("WeakmapEvent#broadcast expects arguments (obj, value)");return getEvent(e).broadcast(t,e)},listen:listen};function listen(e,t){if(1===arguments.length)throw new Error("WeakmapEvent#listen expects arguments (obj, listen)");return getEvent(e).listen(t)}function getEvent(t){var r=e(t);return r.event=r.event||n(),r.event}}},function(e,t){function ap(e,t){return function(){var r=[].slice.call(arguments),n=e.slice();return n.push.apply(n,r),t.apply(this,n)}}function pa(e,t){return function(){var r=[].slice.call(arguments);return r.push.apply(r,e),t.apply(this,r)}}function partial(e){return ap([].slice.call(arguments,1),e)}function partialRight(e){return pa([].slice.call(arguments,1),e)}(t=e.exports=ap).pa=pa,t.apa=function apa(e,t,r){return function(){return r.apply(this,e.concat.apply(e,arguments).concat(t))}},t.partial=partial,t.partialRight=partialRight,t.curry=function curry(e){return partial(partial,e)},t.curryRight=function curryRight(e){return partial(partialRight,e)}},function(e,t,r){"use strict";var n=_interopRequireDefault(r(120)),i=_interopRequireDefault(r(379)),a=_interopRequireDefault(r(391));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var o=function(e){function CancelError(e){(0,n.default)(this,CancelError);var t=(0,i.default)(this,(CancelError.__proto__||Object.getPrototypeOf(CancelError)).call(this,e));return t.name="CancelError",t}return(0,a.default)(CancelError,e),CancelError}(Error),s=function createDelay(e){return function(t,r){var n=void 0,i=void 0,a=new Promise((function(a,o){i=o,n=setTimeout((function(){(e?a:o)(r)}),t)}));return a.cancel=function(){n&&(clearTimeout(n),n=null,i(new o("Delay canceled")))},a}};e.exports=s(!0),e.exports.reject=s(!1),e.exports.CancelError=o},function(e,t,r){"use strict";t.__esModule=!0;var n=_interopRequireDefault(r(380)),i=_interopRequireDefault(r(382)),a="function"===typeof i.default&&"symbol"===typeof n.default?function(e){return typeof e}:function(e){return e&&"function"===typeof i.default&&e.constructor===i.default&&e!==i.default.prototype?"symbol":typeof e};function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}t.default="function"===typeof i.default&&"symbol"===a(n.default)?function(e){return"undefined"===typeof e?"undefined":a(e)}:function(e){return e&&"function"===typeof i.default&&e.constructor===i.default&&e!==i.default.prototype?"symbol":"undefined"===typeof e?"undefined":a(e)}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,r){var n=r(144),i=r(108).concat("length","prototype");t.f=Object.getOwnPropertyNames||function getOwnPropertyNames(e){return n(e,i)}},function(e,t,r){var n=r(124),i=r(56),a=r(49),o=r(102),s=r(44),u=r(142),l=Object.getOwnPropertyDescriptor;t.f=r(39)?l:function getOwnPropertyDescriptor(e,t){if(e=a(e),t=o(t,!0),u)try{return l(e,t)}catch(r){}if(s(e,t))return i(!n.f.call(e,t),e[t])}},function(e,t,r){"use strict";var n=r(176);e.exports=function standardDeviation(e){if(1===e.length)return 0;var t=n(e);return Math.sqrt(t)}},function(e,t,r){"use strict";var n=r(125);e.exports=function variance(e){if(0===e.length)throw new Error("variance requires at least one data point");return n(e,2)/e.length}},function(e,t,r){"use strict";e.exports=function sum(e){if(0===e.length)return 0;for(var t,r=e[0],n=0,i=1;i<e.length;i++)t=r+e[i],Math.abs(r)>=Math.abs(e[i])?n+=r-t+e[i]:n+=e[i]-t+r,r=t;return r+n}},function(e,t,r){"use strict";e.exports=function numericSort(e){return e.slice().sort((function(e,t){return e-t}))}},function(e,t,r){"use strict";e.exports=function modeSorted(e){if(0===e.length)throw new Error("mode requires at least one data point");if(1===e.length)return e[0];for(var t=e[0],r=NaN,n=0,i=1,a=1;a<e.length+1;a++)e[a]!==t?(i>n&&(n=i,r=t),i=1,t=e[a]):i++;return r}},function(e,t,r){"use strict";e.exports=function min(e){if(0===e.length)throw new Error("min requires at least one data point");for(var t=e[0],r=1;r<e.length;r++)e[r]<t&&(t=e[r]);return t}},function(e,t,r){"use strict";e.exports=function max(e){if(0===e.length)throw new Error("max requires at least one data point");for(var t=e[0],r=1;r<e.length;r++)e[r]>t&&(t=e[r]);return t}},function(e,t,r){"use strict";var n=r(126);e.exports=function median(e){return+n(e,.5)}},function(e,t,r){"use strict";var n=r(184);e.exports=function shuffle(e,t){var r=e.slice();return n(r.slice(),t)}},function(e,t,r){"use strict";e.exports=function shuffleInPlace(e,t){t=t||Math.random;for(var r,n,i=e.length;i>0;)n=Math.floor(t()*i--),r=e[i],e[i]=e[n],e[n]=r;return e}},function(e,t,r){"use strict";e.exports=function uniqueCountSorted(e){for(var t,r=0,n=0;n<e.length;n++)0!==n&&e[n]===t||(t=e[n],r++);return r}},function(e,t,r){"use strict";var n=r(40);e.exports=function sampleCovariance(e,t){if(e.length!==t.length)throw new Error("sampleCovariance requires samples with equal lengths");if(e.length<2)throw new Error("sampleCovariance requires at least two data points in each sample");for(var r=n(e),i=n(t),a=0,o=0;o<e.length;o++)a+=(e[o]-r)*(t[o]-i);return a/(e.length-1)}},function(e,t,r){"use strict";var n=r(128);e.exports=function sampleStandardDeviation(e){var t=n(e);return Math.sqrt(t)}},function(e,t,r){"use strict";e.exports=function combineMeans(e,t,r,n){return(e*t+r*n)/(t+n)}},function(e,t,r){"use strict";var n=Math.sqrt(2*Math.PI);function cumulativeDistribution(e){for(var t=e,r=e,i=1;i<15;i++)t+=r*=e*e/(2*i+1);return Math.round(1e4*(.5+t/n*Math.exp(-e*e/2)))/1e4}for(var i=[],a=0;a<=3.09;a+=.01)i.push(cumulativeDistribution(a));e.exports=i},function(e,t,r){"use strict";e.exports=function inverseErrorFunction(e){var t=8*(Math.PI-3)/(3*Math.PI*(4-Math.PI)),r=Math.sqrt(Math.sqrt(Math.pow(2/(Math.PI*t)+Math.log(1-e*e)/2,2)-Math.log(1-e*e)/t)-(2/(Math.PI*t)+Math.log(1-e*e)/2));return e>=0?r:-r}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function capitalizeString(e){return e.charAt(0).toUpperCase()+e.slice(1)},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&defineProperties(e.prototype,t),r&&defineProperties(e,r),e}}();var i="undefined"!==typeof Map,a=function(){function OrderedElements(){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,OrderedElements),this.elements={},this.keyOrder=[]}return n(OrderedElements,[{key:"forEach",value:function forEach(e){for(var t=0;t<this.keyOrder.length;t++)e(this.elements[this.keyOrder[t]],this.keyOrder[t])}},{key:"set",value:function set(e,t,r){var n=this;if(this.elements.hasOwnProperty(e)){if(r){var a=this.keyOrder.indexOf(e);this.keyOrder.splice(a,1),this.keyOrder.push(e)}}else this.keyOrder.push(e);if(null!=t){if(i&&t instanceof Map||t instanceof OrderedElements){var o=function(){var i=n.elements.hasOwnProperty(e)?n.elements[e]:new OrderedElements;return t.forEach((function(e,t){i.set(t,e,r)})),n.elements[e]=i,{v:void 0}}();if("object"===typeof o)return o.v}if(Array.isArray(t)||"object"!==typeof t)this.elements[e]=t;else{for(var s=this.elements.hasOwnProperty(e)?this.elements[e]:new OrderedElements,u=Object.keys(t),l=0;l<u.length;l+=1)s.set(u[l],t[u[l]],r);this.elements[e]=s}}else this.elements[e]=t}},{key:"get",value:function get(e){return this.elements[e]}},{key:"has",value:function has(e){return this.elements.hasOwnProperty(e)}},{key:"addStyleType",value:function addStyleType(e){var t=this;if(i&&e instanceof Map||e instanceof OrderedElements)e.forEach((function(e,r){t.set(r,e,!0)}));else for(var r=Object.keys(e),n=0;n<r.length;n++)this.set(r[n],e[r[n]],!0)}}]),OrderedElements}();t.default=a,e.exports=t.default},function(e,t,r){"use strict";var n=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function sliceIterator(e,t){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(u){i=!0,a=u}finally{try{!n&&s.return&&s.return()}finally{if(i)throw a}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},a=r(130),o=r(481),s={create:function create(e){return(0,a.mapObj)(e,(function(e){var t=n(e,2),r=t[0],i=t[1],o=JSON.stringify(i);return[r,{_len:o.length,_name:(0,a.hashString)(o),_definition:i}]}))},rehydrate:function rehydrate(){var e=arguments.length<=0||void 0===arguments[0]?[]:arguments[0];(0,o.addRenderedClassNames)(e)}},u={renderStatic:function renderStatic(e){return(0,o.reset)(),(0,o.startBuffering)(),{html:e(),css:{content:(0,o.flushToString)(),renderedClassNames:(0,o.getRenderedClassNames)()}}}},l={suppressStyleInjection:function suppressStyleInjection(){(0,o.reset)(),(0,o.startBuffering)()},clearBufferAndResumeStyleInjection:function clearBufferAndResumeStyleInjection(){(0,o.reset)()}};e.exports=function makeExports(e,t){return{StyleSheet:i({},s,{extend:function extend(r){var n=r.map((function(e){return e.selectorHandler})).filter((function(e){return e}));return makeExports(e,t.concat(n))}}),StyleSheetServer:u,StyleSheetTestUtils:l,css:function css(){for(var r=arguments.length,n=Array(r),i=0;i<r;i++)n[i]=arguments[i];return(0,o.injectAndGetClassName)(e,n,t)}}}},function(e){e.exports=JSON.parse('{"a":"5.6.0"}')},function(e,t,r){"use strict";e.exports=function bind(e,t){return function wrap(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},function(e,t,r){"use strict";var n=r(25);function encode(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function buildURL(e,t,r){if(!t)return e;var i;if(r)i=r(t);else if(n.isURLSearchParams(t))i=t.toString();else{var a=[];n.forEach(t,(function serialize(e,t){null!==e&&"undefined"!==typeof e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function parseValue(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),a.push(encode(t)+"="+encode(e))})))})),i=a.join("&")}if(i){var o=e.indexOf("#");-1!==o&&(e=e.slice(0,o)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},function(e,t,r){"use strict";e.exports=function isCancel(e){return!(!e||!e.__CANCEL__)}},function(e,t,r){"use strict";(function(t){var n=r(25),i=r(500),a={"Content-Type":"application/x-www-form-urlencoded"};function setContentTypeIfUnset(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var o={adapter:function getDefaultAdapter(){var e;return"undefined"!==typeof t&&"[object process]"===Object.prototype.toString.call(t)?e=r(199):"undefined"!==typeof XMLHttpRequest&&(e=r(199)),e}(),transformRequest:[function transformRequest(e,t){return i(t,"Accept"),i(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e)?e:n.isArrayBufferView(e)?e.buffer:n.isURLSearchParams(e)?(setContentTypeIfUnset(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)?(setContentTypeIfUnset(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function transformResponse(e){if("string"===typeof e)try{e=JSON.parse(e)}catch(t){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function validateStatus(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function forEachMethodNoData(e){o.headers[e]={}})),n.forEach(["post","put","patch"],(function forEachMethodWithData(e){o.headers[e]=n.merge(a)})),e.exports=o}).call(this,r(45))},function(e,t,r){"use strict";var n=r(25),i=r(501),a=r(196),o=r(503),s=r(504),u=r(200);e.exports=function xhrAdapter(e){return new Promise((function dispatchXhrRequest(t,l){var c=e.data,f=e.headers;n.isFormData(c)&&delete f["Content-Type"];var d=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",p=e.auth.password||"";f.Authorization="Basic "+btoa(h+":"+p)}if(d.open(e.method.toUpperCase(),a(e.url,e.params,e.paramsSerializer),!0),d.timeout=e.timeout,d.onreadystatechange=function handleLoad(){if(d&&4===d.readyState&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in d?o(d.getAllResponseHeaders()):null,n={data:e.responseType&&"text"!==e.responseType?d.response:d.responseText,status:d.status,statusText:d.statusText,headers:r,config:e,request:d};i(t,l,n),d=null}},d.onabort=function handleAbort(){d&&(l(u("Request aborted",e,"ECONNABORTED",d)),d=null)},d.onerror=function handleError(){l(u("Network Error",e,null,d)),d=null},d.ontimeout=function handleTimeout(){l(u("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",d)),d=null},n.isStandardBrowserEnv()){var g=r(505),m=(e.withCredentials||s(e.url))&&e.xsrfCookieName?g.read(e.xsrfCookieName):void 0;m&&(f[e.xsrfHeaderName]=m)}if("setRequestHeader"in d&&n.forEach(f,(function setRequestHeader(e,t){"undefined"===typeof c&&"content-type"===t.toLowerCase()?delete f[t]:d.setRequestHeader(t,e)})),e.withCredentials&&(d.withCredentials=!0),e.responseType)try{d.responseType=e.responseType}catch(v){if("json"!==e.responseType)throw v}"function"===typeof e.onDownloadProgress&&d.addEventListener("progress",e.onDownloadProgress),"function"===typeof e.onUploadProgress&&d.upload&&d.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function onCanceled(e){d&&(d.abort(),l(e),d=null)})),void 0===c&&(c=null),d.send(c)}))}},function(e,t,r){"use strict";var n=r(502);e.exports=function createError(e,t,r,i,a){var o=new Error(e);return n(o,t,r,i,a)}},function(e,t,r){"use strict";var n=r(25);e.exports=function mergeConfig(e,t){t=t||{};var r={};return n.forEach(["url","method","params","data"],(function valueFromConfig2(e){"undefined"!==typeof t[e]&&(r[e]=t[e])})),n.forEach(["headers","auth","proxy"],(function mergeDeepProperties(i){n.isObject(t[i])?r[i]=n.deepMerge(e[i],t[i]):"undefined"!==typeof t[i]?r[i]=t[i]:n.isObject(e[i])?r[i]=n.deepMerge(e[i]):"undefined"!==typeof e[i]&&(r[i]=e[i])})),n.forEach(["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"],(function defaultToConfig2(n){"undefined"!==typeof t[n]?r[n]=t[n]:"undefined"!==typeof e[n]&&(r[n]=e[n])})),r}},function(e,t,r){"use strict";function Cancel(e){this.message=e}Cancel.prototype.toString=function toString(){return"Cancel"+(this.message?": "+this.message:"")},Cancel.prototype.__CANCEL__=!0,e.exports=Cancel},function(e,t){var r=1e3,n=60*r,i=60*n,a=24*i,o=365.25*a;function plural(e,t,r){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+r:Math.ceil(e/t)+" "+r+"s"}e.exports=function(e,t){t=t||{};var s=typeof e;if("string"===s&&e.length>0)return function parse(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var s=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return s*o;case"days":case"day":case"d":return s*a;case"hours":case"hour":case"hrs":case"hr":case"h":return s*i;case"minutes":case"minute":case"mins":case"min":case"m":return s*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}(e);if("number"===s&&!1===isNaN(e))return t.long?function fmtLong(e){return plural(e,a,"day")||plural(e,i,"hour")||plural(e,n,"minute")||plural(e,r,"second")||e+" ms"}(e):function fmtShort(e){if(e>=a)return Math.round(e/a)+"d";if(e>=i)return Math.round(e/i)+"h";if(e>=n)return Math.round(e/n)+"m";if(e>=r)return Math.round(e/r)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(module,exports,__webpack_require__){(function(global){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;!function(e,t){module.exports=t(e)}("undefined"!==typeof self?self:"undefined"!==typeof window?window:"undefined"!==typeof global?global:this,(function(global){"use strict";global=global||{};var _Base64=global.Base64,version="2.5.1",buffer;if(module.exports)try{buffer=eval("require('buffer').Buffer")}catch(err){buffer=void 0}var b64chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b64tab=function(e){for(var t={},r=0,n=e.length;r<n;r++)t[e.charAt(r)]=r;return t}(b64chars),fromCharCode=String.fromCharCode,cb_utob=function cb_utob(e){if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?fromCharCode(192|t>>>6)+fromCharCode(128|63&t):fromCharCode(224|t>>>12&15)+fromCharCode(128|t>>>6&63)+fromCharCode(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return fromCharCode(240|t>>>18&7)+fromCharCode(128|t>>>12&63)+fromCharCode(128|t>>>6&63)+fromCharCode(128|63&t)},re_utob=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,utob=function utob(e){return e.replace(re_utob,cb_utob)},cb_encode=function cb_encode(e){var t=[0,2,1][e.length%3],r=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[b64chars.charAt(r>>>18),b64chars.charAt(r>>>12&63),t>=2?"=":b64chars.charAt(r>>>6&63),t>=1?"=":b64chars.charAt(63&r)].join("")},btoa=global.btoa?function(e){return global.btoa(e)}:function(e){return e.replace(/[\s\S]{1,3}/g,cb_encode)},_encode=buffer?buffer.from&&Uint8Array&&buffer.from!==Uint8Array.from?function(e){return(e.constructor===buffer.constructor?e:buffer.from(e)).toString("base64")}:function(e){return(e.constructor===buffer.constructor?e:new buffer(e)).toString("base64")}:function(e){return btoa(utob(e))},encode=function encode(e,t){return t?_encode(String(e)).replace(/[+\/]/g,(function(e){return"+"==e?"-":"_"})).replace(/=/g,""):_encode(String(e))},encodeURI=function encodeURI(e){return encode(e,!0)},re_btou=new RegExp(["[\xc0-\xdf][\x80-\xbf]","[\xe0-\xef][\x80-\xbf]{2}","[\xf0-\xf7][\x80-\xbf]{3}"].join("|"),"g"),cb_btou=function cb_btou(e){switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return fromCharCode(55296+(t>>>10))+fromCharCode(56320+(1023&t));case 3:return fromCharCode((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return fromCharCode((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},btou=function btou(e){return e.replace(re_btou,cb_btou)},cb_decode=function cb_decode(e){var t=e.length,r=t%4,n=(t>0?b64tab[e.charAt(0)]<<18:0)|(t>1?b64tab[e.charAt(1)]<<12:0)|(t>2?b64tab[e.charAt(2)]<<6:0)|(t>3?b64tab[e.charAt(3)]:0),i=[fromCharCode(n>>>16),fromCharCode(n>>>8&255),fromCharCode(255&n)];return i.length-=[0,0,2,1][r],i.join("")},_atob=global.atob?function(e){return global.atob(e)}:function(e){return e.replace(/\S{1,4}/g,cb_decode)},atob=function atob(e){return _atob(String(e).replace(/[^A-Za-z0-9\+\/]/g,""))},_decode=buffer?buffer.from&&Uint8Array&&buffer.from!==Uint8Array.from?function(e){return(e.constructor===buffer.constructor?e:buffer.from(e,"base64")).toString()}:function(e){return(e.constructor===buffer.constructor?e:new buffer(e,"base64")).toString()}:function(e){return btou(_atob(e))},decode=function decode(e){return _decode(String(e).replace(/[-_]/g,(function(e){return"-"==e?"+":"/"})).replace(/[^A-Za-z0-9\+\/]/g,""))},noConflict=function noConflict(){var e=global.Base64;return global.Base64=_Base64,e};if(global.Base64={VERSION:version,atob:atob,btoa:btoa,fromBase64:decode,toBase64:encode,utob:utob,encode:encode,encodeURI:encodeURI,btou:btou,decode:decode,noConflict:noConflict,__buffer__:buffer},"function"===typeof Object.defineProperty){var noEnum=function noEnum(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}};global.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",noEnum((function(){return decode(this)}))),Object.defineProperty(String.prototype,"toBase64",noEnum((function(e){return encode(this,e)}))),Object.defineProperty(String.prototype,"toBase64URI",noEnum((function(){return encode(this,!0)})))}}return global.Meteor&&(Base64=global.Base64),module.exports?module.exports.Base64=global.Base64:(__WEBPACK_AMD_DEFINE_ARRAY__=[],__WEBPACK_AMD_DEFINE_RESULT__=function(){return global.Base64}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)),{Base64:global.Base64}}))}).call(this,__webpack_require__(18))},function(e,t){var r=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,n=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];e.exports=function parseuri(e){var t=e,i=e.indexOf("["),a=e.indexOf("]");-1!=i&&-1!=a&&(e=e.substring(0,i)+e.substring(i,a).replace(/:/g,";")+e.substring(a,e.length));for(var o=r.exec(e||""),s={},u=14;u--;)s[n[u]]=o[u]||"";return-1!=i&&-1!=a&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s}},function(e,t,r){var n=r(523),i=r(524),a=r(525);e.exports=function _toConsumableArray(e){return n(e)||i(e)||a()}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){(function(t){e.exports=function isBuf(e){return r&&t.isBuffer(e)||n&&(e instanceof ArrayBuffer||i(e))};var r="function"===typeof t&&"function"===typeof t.isBuffer,n="function"===typeof ArrayBuffer,i=function isView(e){return"function"===typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer}}).call(this,r(21).Buffer)},function(e,t,r){var n=r(530),i=r(215),a=r(51),o=r(131),s=r(216),u=r(217),l=r(79)("socket.io-client:manager"),c=r(214),f=r(547),d=Object.prototype.hasOwnProperty;function Manager(e,t){if(!(this instanceof Manager))return new Manager(e,t);e&&"object"===typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.nsps={},this.subs=[],this.opts=t,this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(t.randomizationFactor||.5),this.backoff=new f({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this.readyState="closed",this.uri=e,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];var r=t.parser||o;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this.autoConnect=!1!==t.autoConnect,this.autoConnect&&this.open()}e.exports=Manager,Manager.prototype.emitAll=function(){for(var e in this.emit.apply(this,arguments),this.nsps)d.call(this.nsps,e)&&this.nsps[e].emit.apply(this.nsps[e],arguments)},Manager.prototype.updateSocketIds=function(){for(var e in this.nsps)d.call(this.nsps,e)&&(this.nsps[e].id=this.generateId(e))},Manager.prototype.generateId=function(e){return("/"===e?"":e+"#")+this.engine.id},a(Manager.prototype),Manager.prototype.reconnection=function(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection},Manager.prototype.reconnectionAttempts=function(e){return arguments.length?(this._reconnectionAttempts=e,this):this._reconnectionAttempts},Manager.prototype.reconnectionDelay=function(e){return arguments.length?(this._reconnectionDelay=e,this.backoff&&this.backoff.setMin(e),this):this._reconnectionDelay},Manager.prototype.randomizationFactor=function(e){return arguments.length?(this._randomizationFactor=e,this.backoff&&this.backoff.setJitter(e),this):this._randomizationFactor},Manager.prototype.reconnectionDelayMax=function(e){return arguments.length?(this._reconnectionDelayMax=e,this.backoff&&this.backoff.setMax(e),this):this._reconnectionDelayMax},Manager.prototype.timeout=function(e){return arguments.length?(this._timeout=e,this):this._timeout},Manager.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},Manager.prototype.open=Manager.prototype.connect=function(e,t){if(l("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;l("opening %s",this.uri),this.engine=n(this.uri,this.opts);var r=this.engine,i=this;this.readyState="opening",this.skipReconnect=!1;var a=s(r,"open",(function(){i.onopen(),e&&e()})),o=s(r,"error",(function(t){if(l("connect_error"),i.cleanup(),i.readyState="closed",i.emitAll("connect_error",t),e){var r=new Error("Connection error");r.data=t,e(r)}else i.maybeReconnectOnOpen()}));if(!1!==this._timeout){var u=this._timeout;l("connect attempt will timeout after %d",u);var c=setTimeout((function(){l("connect attempt timed out after %d",u),a.destroy(),r.close(),r.emit("error","timeout"),i.emitAll("connect_timeout",u)}),u);this.subs.push({destroy:function destroy(){clearTimeout(c)}})}return this.subs.push(a),this.subs.push(o),this},Manager.prototype.onopen=function(){l("open"),this.cleanup(),this.readyState="open",this.emit("open");var e=this.engine;this.subs.push(s(e,"data",u(this,"ondata"))),this.subs.push(s(e,"ping",u(this,"onping"))),this.subs.push(s(e,"pong",u(this,"onpong"))),this.subs.push(s(e,"error",u(this,"onerror"))),this.subs.push(s(e,"close",u(this,"onclose"))),this.subs.push(s(this.decoder,"decoded",u(this,"ondecoded")))},Manager.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},Manager.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},Manager.prototype.ondata=function(e){this.decoder.add(e)},Manager.prototype.ondecoded=function(e){this.emit("packet",e)},Manager.prototype.onerror=function(e){l("error",e),this.emitAll("error",e)},Manager.prototype.socket=function(e,t){var r=this.nsps[e];if(!r){r=new i(this,e,t),this.nsps[e]=r;var n=this;r.on("connecting",onConnecting),r.on("connect",(function(){r.id=n.generateId(e)})),this.autoConnect&&onConnecting()}function onConnecting(){~c(n.connecting,r)||n.connecting.push(r)}return r},Manager.prototype.destroy=function(e){var t=c(this.connecting,e);~t&&this.connecting.splice(t,1),this.connecting.length||this.close()},Manager.prototype.packet=function(e){l("writing packet %j",e);var t=this;e.query&&0===e.type&&(e.nsp+="?"+e.query),t.encoding?t.packetBuffer.push(e):(t.encoding=!0,this.encoder.encode(e,(function(r){for(var n=0;n<r.length;n++)t.engine.write(r[n],e.options);t.encoding=!1,t.processPacketQueue()})))},Manager.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var e=this.packetBuffer.shift();this.packet(e)}},Manager.prototype.cleanup=function(){l("cleanup");for(var e=this.subs.length,t=0;t<e;t++){this.subs.shift().destroy()}this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},Manager.prototype.close=Manager.prototype.disconnect=function(){l("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,"opening"===this.readyState&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},Manager.prototype.onclose=function(e){l("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",e),this._reconnection&&!this.skipReconnect&&this.reconnect()},Manager.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var e=this;if(this.backoff.attempts>=this._reconnectionAttempts)l("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var t=this.backoff.duration();l("will wait %dms before reconnect attempt",t),this.reconnecting=!0;var r=setTimeout((function(){e.skipReconnect||(l("attempting reconnect"),e.emitAll("reconnect_attempt",e.backoff.attempts),e.emitAll("reconnecting",e.backoff.attempts),e.skipReconnect||e.open((function(t){t?(l("reconnect attempt error"),e.reconnecting=!1,e.reconnect(),e.emitAll("reconnect_error",t.data)):(l("reconnect success"),e.onreconnect())})))}),t);this.subs.push({destroy:function destroy(){clearTimeout(r)}})}},Manager.prototype.onreconnect=function(){var e=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",e)}},function(e,t,r){var n=r(132),i=r(533),a=r(543),o=r(544);t.polling=function polling(e){var t=!1,r=!1,o=!1!==e.jsonp;if("undefined"!==typeof location){var s="https:"===location.protocol,u=location.port;u||(u=s?443:80),t=e.hostname!==location.hostname||u!==e.port,r=e.secure!==s}if(e.xdomain=t,e.xscheme=r,"open"in new n(e)&&!e.forceJSONP)return new i(e);if(!o)throw new Error("JSONP disabled");return new a(e)},t.websocket=o},function(e,t,r){var n=r(133),i=r(80),a=r(52),o=r(81),s=r(213),u=r(82)("engine.io-client:polling");e.exports=Polling;var l=null!=new(r(132))({xdomain:!1}).responseType;function Polling(e){var t=e&&e.forceBase64;l&&!t||(this.supportsBinary=!1),n.call(this,e)}o(Polling,n),Polling.prototype.name="polling",Polling.prototype.doOpen=function(){this.poll()},Polling.prototype.pause=function(e){var t=this;function pause(){u("paused"),t.readyState="paused",e()}if(this.readyState="pausing",this.polling||!this.writable){var r=0;this.polling&&(u("we are currently polling - waiting to pause"),r++,this.once("pollComplete",(function(){u("pre-pause polling complete"),--r||pause()}))),this.writable||(u("we are currently writing - waiting to pause"),r++,this.once("drain",(function(){u("pre-pause writing complete"),--r||pause()})))}else pause()},Polling.prototype.poll=function(){u("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},Polling.prototype.onData=function(e){var t=this;u("polling got data %s",e);a.decodePayload(e,this.socket.binaryType,(function callback(e,r,n){if("opening"===t.readyState&&t.onOpen(),"close"===e.type)return t.onClose(),!1;t.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():u('ignoring poll - transport state "%s"',this.readyState))},Polling.prototype.doClose=function(){var e=this;function close(){u("writing close packet"),e.write([{type:"close"}])}"open"===this.readyState?(u("transport open - closing"),close()):(u("transport not open - deferring close"),this.once("open",close))},Polling.prototype.write=function(e){var t=this;this.writable=!1;var r=function callbackfn(){t.writable=!0,t.emit("drain")};a.encodePayload(e,this.supportsBinary,(function(e){t.doWrite(e,r)}))},Polling.prototype.uri=function(){var e=this.query||{},t=this.secure?"https":"http",r="";return!1!==this.timestampRequests&&(e[this.timestampParam]=s()),this.supportsBinary||e.sid||(e.b64=1),e=i.encode(e),this.port&&("https"===t&&443!==Number(this.port)||"http"===t&&80!==Number(this.port))&&(r=":"+this.port),e.length&&(e="?"+e),t+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+r+this.path+e}},function(e,t,r){(function(t){var n=r(535),i=Object.prototype.toString,a="function"===typeof Blob||"undefined"!==typeof Blob&&"[object BlobConstructor]"===i.call(Blob),o="function"===typeof File||"undefined"!==typeof File&&"[object FileConstructor]"===i.call(File);e.exports=function hasBinary(e){if(!e||"object"!==typeof e)return!1;if(n(e)){for(var r=0,i=e.length;r<i;r++)if(hasBinary(e[r]))return!0;return!1}if("function"===typeof t&&t.isBuffer&&t.isBuffer(e)||"function"===typeof ArrayBuffer&&e instanceof ArrayBuffer||a&&e instanceof Blob||o&&e instanceof File)return!0;if(e.toJSON&&"function"===typeof e.toJSON&&1===arguments.length)return hasBinary(e.toJSON(),!0);for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&hasBinary(e[s]))return!0;return!1}}).call(this,r(21).Buffer)},function(e,t,r){"use strict";var n,i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),a=64,o={},s=0,u=0;function encode(e){var t="";do{t=i[e%a]+t,e=Math.floor(e/a)}while(e>0);return t}function yeast(){var e=encode(+new Date);return e!==n?(s=0,n=e):e+"."+encode(s++)}for(;u<a;u++)o[i[u]]=u;yeast.encode=encode,yeast.decode=function decode(e){var t=0;for(u=0;u<e.length;u++)t=t*a+o[e.charAt(u)];return t},e.exports=yeast},function(e,t){var r=[].indexOf;e.exports=function(e,t){if(r)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}},function(e,t,r){var n=r(131),i=r(51),a=r(546),o=r(216),s=r(217),u=r(79)("socket.io-client:socket"),l=r(80),c=r(212);e.exports=Socket;var f={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},d=i.prototype.emit;function Socket(e,t,r){this.io=e,this.nsp=t,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,this.flags={},r&&r.query&&(this.query=r.query),this.io.autoConnect&&this.open()}i(Socket.prototype),Socket.prototype.subEvents=function(){if(!this.subs){var e=this.io;this.subs=[o(e,"open",s(this,"onopen")),o(e,"packet",s(this,"onpacket")),o(e,"close",s(this,"onclose"))]}},Socket.prototype.open=Socket.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting"),this)},Socket.prototype.send=function(){var e=a(arguments);return e.unshift("message"),this.emit.apply(this,e),this},Socket.prototype.emit=function(e){if(f.hasOwnProperty(e))return d.apply(this,arguments),this;var t=a(arguments),r={type:(void 0!==this.flags.binary?this.flags.binary:c(t))?n.BINARY_EVENT:n.EVENT,data:t,options:{}};return r.options.compress=!this.flags||!1!==this.flags.compress,"function"===typeof t[t.length-1]&&(u("emitting packet with ack id %d",this.ids),this.acks[this.ids]=t.pop(),r.id=this.ids++),this.connected?this.packet(r):this.sendBuffer.push(r),this.flags={},this},Socket.prototype.packet=function(e){e.nsp=this.nsp,this.io.packet(e)},Socket.prototype.onopen=function(){if(u("transport is open - connecting"),"/"!==this.nsp)if(this.query){var e="object"===typeof this.query?l.encode(this.query):this.query;u("sending connect packet with query %s",e),this.packet({type:n.CONNECT,query:e})}else this.packet({type:n.CONNECT})},Socket.prototype.onclose=function(e){u("close (%s)",e),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",e)},Socket.prototype.onpacket=function(e){var t=e.nsp===this.nsp,r=e.type===n.ERROR&&"/"===e.nsp;if(t||r)switch(e.type){case n.CONNECT:this.onconnect();break;case n.EVENT:case n.BINARY_EVENT:this.onevent(e);break;case n.ACK:case n.BINARY_ACK:this.onack(e);break;case n.DISCONNECT:this.ondisconnect();break;case n.ERROR:this.emit("error",e.data)}},Socket.prototype.onevent=function(e){var t=e.data||[];u("emitting event %j",t),null!=e.id&&(u("attaching ack callback to event"),t.push(this.ack(e.id))),this.connected?d.apply(this,t):this.receiveBuffer.push(t)},Socket.prototype.ack=function(e){var t=this,r=!1;return function(){if(!r){r=!0;var i=a(arguments);u("sending ack %j",i),t.packet({type:c(i)?n.BINARY_ACK:n.ACK,id:e,data:i})}}},Socket.prototype.onack=function(e){var t=this.acks[e.id];"function"===typeof t?(u("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),delete this.acks[e.id]):u("bad ack %s",e.id)},Socket.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},Socket.prototype.emitBuffered=function(){var e;for(e=0;e<this.receiveBuffer.length;e++)d.apply(this,this.receiveBuffer[e]);for(this.receiveBuffer=[],e=0;e<this.sendBuffer.length;e++)this.packet(this.sendBuffer[e]);this.sendBuffer=[]},Socket.prototype.ondisconnect=function(){u("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},Socket.prototype.destroy=function(){if(this.subs){for(var e=0;e<this.subs.length;e++)this.subs[e].destroy();this.subs=null}this.io.destroy(this)},Socket.prototype.close=Socket.prototype.disconnect=function(){return this.connected&&(u("performing disconnect (%s)",this.nsp),this.packet({type:n.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},Socket.prototype.compress=function(e){return this.flags.compress=e,this},Socket.prototype.binary=function(e){return this.flags.binary=e,this}},function(e,t){e.exports=function on(e,t,r){return e.on(t,r),{destroy:function destroy(){e.removeListener(t,r)}}}},function(e,t){var r=[].slice;e.exports=function(e,t){if("string"==typeof t&&(t=e[t]),"function"!=typeof t)throw new Error("bind() requires a function");var n=r.call(arguments,2);return function(){return t.apply(e,n.concat(r.call(arguments)))}}},,function(e,t,r){"use strict";!function checkDCE(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE)}catch(e){console.error(e)}}}(),e.exports=r(259)},,function(e,t,r){(function(t){var n=r(362),i="undefined"!==typeof window?window:"undefined"!==typeof t?t:"undefined"!==typeof self?self:{},a=i.Raven,o=new n;o.noConflict=function(){return i.Raven=a,o},o.afterLoad(),e.exports=o,e.exports.Client=n}).call(this,r(18))},,function(e,t,r){e.exports=function(){"use strict";var e,t,r="https:"===location.protocol||"chrome-extension:"===location.protocol||"localhost"===location.hostname,n=!1,i={createWriteStream:function createWriteStream(a,o,s){if(Number.isFinite(o)){var u=[o,s];s=u[0],o=u[1]}var l,c=new MessageChannel,f=function setupChannel(n){return new Promise((function(o){var u,f,d=[{filename:a,size:s},"*",[c.port2]];n&&(d[0].readableStream=n,d[2].push(n)),c.port1.onmessage=function(e){e.data.download&&(o(),r||l.close(),window.chrome&&chrome.extension&&chrome.extension.getBackgroundPage&&chrome.extension.getBackgroundPage()===window?chrome.tabs.create({url:e.data.download,active:!1}):window.location=e.data.download,n&&(c.port1.close(),c.port2.close()),c.port1.onmessage=null)},r&&!e&&((e=document.createElement("iframe")).src=i.mitm,e.hidden=!0,document.body.appendChild(e)),r&&!t&&e.addEventListener("load",u=function fn(){var r;t=!0,e.removeEventListener("load",u),(r=e.contentWindow).postMessage.apply(r,d)}),r&&t&&(f=e.contentWindow).postMessage.apply(f,d),r||(l=window.open(i.mitm,Math.random()),window.addEventListener("message",(function onready(e){var t;e.source===l&&((t=l).postMessage.apply(t,d),window.removeEventListener("message",onready))})))}))};if(n){var d=new TransformStream({start:function start(){return new Promise((function(e){return setTimeout((function(){return f(d.readable).then(e)}))}))}},o);return d.writable}return new WritableStream({start:function start(){return f()},write:function write(e){c.port1.postMessage(e)},close:function close(){c.port1.postMessage("end")},abort:function abort(){c.port1.postMessage("abort")}},o)},supported:!1,version:{full:"1.2.0",major:1,minor:2,dot:0}};i.mitm="https://jimmywarting.github.io/StreamSaver.js/mitm.html?version="+i.version.full;try{i.supported="serviceWorker"in navigator&&!!new ReadableStream&&!!new WritableStream}catch(s){}try{var a=(new TransformStream).readable,o=new MessageChannel;o.port1.postMessage(a,[a]),o.port1.close(),o.port2.close(),n=!0===a.locked}catch(s){}return i}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SAFETY_ELM327=t.SAFETY_ALLOUTPUT=t.SAFETY_TOYOTA_NOLIMITS=t.SAFETY_HONDA_BOSCH=t.SAFETY_TOYOTA=t.SAFETY_HONDA=t.SAFETY_NOOUTPUT=void 0,t.default=function Panda(e){e=e||{};var t=new n.default(e,navigator.usb);return e.device=t,new i.default(e)};var n=_interopRequireDefault(r(367)),i=_interopRequireDefault(r(399));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}t.SAFETY_NOOUTPUT=0,t.SAFETY_HONDA=1,t.SAFETY_TOYOTA=2,t.SAFETY_HONDA_BOSCH=4,t.SAFETY_TOYOTA_NOLIMITS=4918,t.SAFETY_ALLOUTPUT=4919,t.SAFETY_ELM327=58151},,function(e,t,r){"use strict";e.exports=function rightPad(e,t,r){if("string"!==typeof e)throw new Error("The string parameter must be a string.");if(e.length<1)throw new Error("The string parameter must be 1 character or longer.");if("number"!==typeof t)throw new Error("The length parameter must be a number.");if("string"!==typeof r&&r)throw new Error("The character parameter must be a string.");var n=-1;for(t-=e.length,r||0===r||(r=" ");++n<t;)e+=r;return e}},,function(e,t,r){(function(e){!function(r,n){var i=function(){var e=null,t={};!function loadColorBounds(){defineColor("monochrome",null,[[0,0],[100,0]]),defineColor("red",[-26,18],[[20,100],[30,92],[40,89],[50,85],[60,78],[70,70],[80,60],[90,55],[100,50]]),defineColor("orange",[19,46],[[20,100],[30,93],[40,88],[50,86],[60,85],[70,70],[100,70]]),defineColor("yellow",[47,62],[[25,100],[40,94],[50,89],[60,86],[70,84],[80,82],[90,80],[100,75]]),defineColor("green",[63,178],[[30,100],[40,90],[50,85],[60,81],[70,74],[80,64],[90,50],[100,40]]),defineColor("blue",[179,257],[[20,100],[30,86],[40,80],[50,74],[60,60],[70,52],[80,44],[90,39],[100,35]]),defineColor("purple",[258,282],[[20,100],[30,87],[40,79],[50,70],[60,65],[70,59],[80,52],[90,45],[100,42]]),defineColor("pink",[283,334],[[20,100],[30,90],[40,86],[60,84],[80,80],[90,75],[100,73]])}();var r=[];function pickHue(e){if(r.length>0){var n=randomWithin(o=function getRealHueRange(e){if(isNaN(e)){if("string"===typeof e)if(t[e]){var r=t[e];if(r.hueRange)return r.hueRange}else if(e.match(/^#?([0-9A-F]{3}|[0-9A-F]{6})$/i)){return getColorInfo(HexToHSB(e)[0]).hueRange}}else{var n=parseInt(e);if(n<360&&n>0)return getColorInfo(e).hueRange}return[0,360]}(e.hue)),i=(o[1]-o[0])/r.length,a=parseInt((n-o[0])/i);return!0===r[a]?a=(a+2)%r.length:r[a]=!0,(n=randomWithin(o=[(o[0]+a*i)%359,(o[0]+(a+1)*i)%359]))<0&&(n=360+n),n}var o;return(n=randomWithin(o=function getHueRange(e){if("number"===typeof parseInt(e)){var r=parseInt(e);if(r<360&&r>0)return[r,r]}if("string"===typeof e)if(t[e]){var n=t[e];if(n.hueRange)return n.hueRange}else if(e.match(/^#?([0-9A-F]{3}|[0-9A-F]{6})$/i)){var i=HexToHSB(e)[0];return[i,i]}return[0,360]}(e.hue)))<0&&(n=360+n),n}function pickSaturation(e,t){if("monochrome"===t.hue)return 0;if("random"===t.luminosity)return randomWithin([0,100]);var r=function getSaturationRange(e){return getColorInfo(e).saturationRange}(e),n=r[0],i=r[1];switch(t.luminosity){case"bright":n=55;break;case"dark":n=i-10;break;case"light":i=55}return randomWithin([n,i])}function pickBrightness(e,t,r){var n=function getMinimumBrightness(e,t){for(var r=getColorInfo(e).lowerBounds,n=0;n<r.length-1;n++){var i=r[n][0],a=r[n][1],o=r[n+1][0],s=r[n+1][1];if(t>=i&&t<=o){var u=(s-a)/(o-i);return u*t+(a-u*i)}}return 0}(e,t),i=100;switch(r.luminosity){case"dark":i=n+20;break;case"light":n=(i+n)/2;break;case"random":n=0,i=100}return randomWithin([n,i])}function setFormat(e,t){switch(t.format){case"hsvArray":return e;case"hslArray":return HSVtoHSL(e);case"hsl":var r=HSVtoHSL(e);return"hsl("+r[0]+", "+r[1]+"%, "+r[2]+"%)";case"hsla":var n=HSVtoHSL(e),i=t.alpha||Math.random();return"hsla("+n[0]+", "+n[1]+"%, "+n[2]+"%, "+i+")";case"rgbArray":return HSVtoRGB(e);case"rgb":return"rgb("+HSVtoRGB(e).join(", ")+")";case"rgba":var a=HSVtoRGB(e);i=t.alpha||Math.random();return"rgba("+a.join(", ")+", "+i+")";default:return function HSVtoHex(e){var t=HSVtoRGB(e);function componentToHex(e){var t=e.toString(16);return 1==t.length?"0"+t:t}return"#"+componentToHex(t[0])+componentToHex(t[1])+componentToHex(t[2])}(e)}}function getColorInfo(e){for(var r in e>=334&&e<=360&&(e-=360),t){var n=t[r];if(n.hueRange&&e>=n.hueRange[0]&&e<=n.hueRange[1])return t[r]}return"Color not found"}function randomWithin(t){if(null===e){var r=Math.random();return r+=.618033988749895,r%=1,Math.floor(t[0]+r*(t[1]+1-t[0]))}var n=t[1]||1,i=t[0]||0,a=(e=(9301*e+49297)%233280)/233280;return Math.floor(i+a*(n-i))}function defineColor(e,r,n){var i=n[0][0],a=n[n.length-1][0],o=n[n.length-1][1],s=n[0][1];t[e]={hueRange:r,lowerBounds:n,saturationRange:[i,a],brightnessRange:[o,s]}}function HSVtoRGB(e){var t=e[0];0===t&&(t=1),360===t&&(t=359),t/=360;var r=e[1]/100,n=e[2]/100,i=Math.floor(6*t),a=6*t-i,o=n*(1-r),s=n*(1-a*r),u=n*(1-(1-a)*r),l=256,c=256,f=256;switch(i){case 0:l=n,c=u,f=o;break;case 1:l=s,c=n,f=o;break;case 2:l=o,c=n,f=u;break;case 3:l=o,c=s,f=n;break;case 4:l=u,c=o,f=n;break;case 5:l=n,c=o,f=s}return[Math.floor(255*l),Math.floor(255*c),Math.floor(255*f)]}function HexToHSB(e){e=3===(e=e.replace(/^#/,"")).length?e.replace(/(.)/g,"$1$1"):e;var t=parseInt(e.substr(0,2),16)/255,r=parseInt(e.substr(2,2),16)/255,n=parseInt(e.substr(4,2),16)/255,i=Math.max(t,r,n),a=i-Math.min(t,r,n),o=i?a/i:0;switch(i){case t:return[(r-n)/a%6*60||0,o,i];case r:return[60*((n-t)/a+2)||0,o,i];case n:return[60*((t-r)/a+4)||0,o,i]}}function HSVtoHSL(e){var t=e[0],r=e[1]/100,n=e[2]/100,i=(2-r)*n;return[t,Math.round(r*n/(i<1?i:2-i)*1e4)/100,i/2*100]}return function randomColor(t){if(void 0!==(t=t||{}).seed&&null!==t.seed&&t.seed===parseInt(t.seed,10))e=t.seed;else if("string"===typeof t.seed)e=function stringToInteger(e){for(var t=0,r=0;r!==e.length&&!(t>=Number.MAX_SAFE_INTEGER);r++)t+=e.charCodeAt(r);return t}(t.seed);else{if(void 0!==t.seed&&null!==t.seed)throw new TypeError("The seed value must be an integer or string");e=null}var n,i;if(null!==t.count&&void 0!==t.count){for(var a=t.count,o=[],s=0;s<t.count;s++)r.push(!1);for(t.count=null;a>o.length;)e&&t.seed&&(t.seed+=1),o.push(randomColor(t));return t.count=a,o}return setFormat([n=pickHue(t),i=pickSaturation(n,t),pickBrightness(n,i,t)],t)}}();e&&e.exports&&(t=e.exports=i),t.randomColor=i}()}).call(this,r(77)(e))},function(e,t,r){var n,i,a;i=[e,r(405),r(407),r(408)],void 0===(a="function"===typeof(n=function(e,t,r,n){"use strict";var i=_interopRequireDefault(t),a=_interopRequireDefault(r),o=_interopRequireDefault(n);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var s="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u=function(){function defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&defineProperties(e.prototype,t),r&&defineProperties(e,r),e}}(),l=function(e){function Clipboard(e,t){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,Clipboard);var r=function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(Clipboard.__proto__||Object.getPrototypeOf(Clipboard)).call(this));return r.resolveOptions(t),r.listenClick(e),r}return function _inherits(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(Clipboard,e),u(Clipboard,[{key:"resolveOptions",value:function resolveOptions(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"===typeof e.action?e.action:this.defaultAction,this.target="function"===typeof e.target?e.target:this.defaultTarget,this.text="function"===typeof e.text?e.text:this.defaultText,this.container="object"===s(e.container)?e.container:document.body}},{key:"listenClick",value:function listenClick(e){var t=this;this.listener=(0,o.default)(e,"click",(function(e){return t.onClick(e)}))}},{key:"onClick",value:function onClick(e){var t=e.delegateTarget||e.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new i.default({action:this.action(t),target:this.target(t),text:this.text(t),container:this.container,trigger:t,emitter:this})}},{key:"defaultAction",value:function defaultAction(e){return getAttributeValue("action",e)}},{key:"defaultTarget",value:function defaultTarget(e){var t=getAttributeValue("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function defaultText(e){return getAttributeValue("text",e)}},{key:"destroy",value:function destroy(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function isSupported(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"===typeof e?[e]:e,r=!!document.queryCommandSupported;return t.forEach((function(e){r=r&&!!document.queryCommandSupported(e)})),r}}]),Clipboard}(a.default);function getAttributeValue(e,t){var r="data-clipboard-"+e;if(t.hasAttribute(r))return t.getAttribute(r)}e.exports=l})?n.apply(t,i):n)||(e.exports=a)},,function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(129),i=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(193));t.default=(0,i.default)(!0,n.defaultSelectorHandlers),e.exports=t.default},function(e,t,r){e.exports=function(){"use strict";return function(e){function toSheet(t){if(t)try{e(t+"}")}catch(r){}}return function ruleSheet(t,r,n,i,a,o,s,u,l){switch(t){case 1:0===l&&64===r.charCodeAt(0)&&e(r);break;case 2:if(0===u)return r+"/*|*/";break;case 3:switch(u){case 102:case 112:return e(n[0]+r),"";default:return r+"/*|*/"}case-2:r.split("/*|*/}").forEach(toSheet)}}}}()},function(e,t,r){"use strict";(function(e){var r=function(){if("undefined"!==typeof Map)return Map;function getIndex(e,t){var r=-1;return e.some((function(e,n){return e[0]===t&&(r=n,!0)})),r}return function(){function class_1(){this.__entries__=[]}return Object.defineProperty(class_1.prototype,"size",{get:function get(){return this.__entries__.length},enumerable:!0,configurable:!0}),class_1.prototype.get=function(e){var t=getIndex(this.__entries__,e),r=this.__entries__[t];return r&&r[1]},class_1.prototype.set=function(e,t){var r=getIndex(this.__entries__,e);~r?this.__entries__[r][1]=t:this.__entries__.push([e,t])},class_1.prototype.delete=function(e){var t=this.__entries__,r=getIndex(t,e);~r&&t.splice(r,1)},class_1.prototype.has=function(e){return!!~getIndex(this.__entries__,e)},class_1.prototype.clear=function(){this.__entries__.splice(0)},class_1.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var r=0,n=this.__entries__;r<n.length;r++){var i=n[r];e.call(t,i[1],i[0])}},class_1}()}(),n="undefined"!==typeof window&&"undefined"!==typeof document&&window.document===document,i="undefined"!==typeof e&&e.Math===Math?e:"undefined"!==typeof self&&self.Math===Math?self:"undefined"!==typeof window&&window.Math===Math?window:Function("return this")(),a="function"===typeof requestAnimationFrame?requestAnimationFrame.bind(i):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)},o=2;var s=20,u=["top","right","bottom","left","width","height","size","weight"],l="undefined"!==typeof MutationObserver,c=function(){function ResizeObserverController(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function throttle(e,t){var r=!1,n=!1,i=0;function resolvePending(){r&&(r=!1,e()),n&&proxy()}function timeoutCallback(){a(resolvePending)}function proxy(){var e=Date.now();if(r){if(e-i<o)return;n=!0}else r=!0,n=!1,setTimeout(timeoutCallback,t);i=e}return proxy}(this.refresh.bind(this),s)}return ResizeObserverController.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},ResizeObserverController.prototype.removeObserver=function(e){var t=this.observers_,r=t.indexOf(e);~r&&t.splice(r,1),!t.length&&this.connected_&&this.disconnect_()},ResizeObserverController.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},ResizeObserverController.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},ResizeObserverController.prototype.connect_=function(){n&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),l?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},ResizeObserverController.prototype.disconnect_=function(){n&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},ResizeObserverController.prototype.onTransitionEnd_=function(e){var t=e.propertyName,r=void 0===t?"":t;u.some((function(e){return!!~r.indexOf(e)}))&&this.refresh()},ResizeObserverController.getInstance=function(){return this.instance_||(this.instance_=new ResizeObserverController),this.instance_},ResizeObserverController.instance_=null,ResizeObserverController}(),f=function defineConfigurable(e,t){for(var r=0,n=Object.keys(t);r<n.length;r++){var i=n[r];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},d=function getWindowOf(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||i},h=createRectInit(0,0,0,0);function toFloat(e){return parseFloat(e)||0}function getBordersSize(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return t.reduce((function(t,r){return t+toFloat(e["border-"+r+"-width"])}),0)}function getHTMLElementContentRect(e){var t=e.clientWidth,r=e.clientHeight;if(!t&&!r)return h;var n=d(e).getComputedStyle(e),i=function getPaddings(e){for(var t={},r=0,n=["top","right","bottom","left"];r<n.length;r++){var i=n[r],a=e["padding-"+i];t[i]=toFloat(a)}return t}(n),a=i.left+i.right,o=i.top+i.bottom,s=toFloat(n.width),u=toFloat(n.height);if("border-box"===n.boxSizing&&(Math.round(s+a)!==t&&(s-=getBordersSize(n,"left","right")+a),Math.round(u+o)!==r&&(u-=getBordersSize(n,"top","bottom")+o)),!function isDocumentElement(e){return e===d(e).document.documentElement}(e)){var l=Math.round(s+a)-t,c=Math.round(u+o)-r;1!==Math.abs(l)&&(s-=l),1!==Math.abs(c)&&(u-=c)}return createRectInit(i.left,i.top,s,u)}var p="undefined"!==typeof SVGGraphicsElement?function(e){return e instanceof d(e).SVGGraphicsElement}:function(e){return e instanceof d(e).SVGElement&&"function"===typeof e.getBBox};function getContentRect(e){return n?p(e)?function getSVGContentRect(e){var t=e.getBBox();return createRectInit(0,0,t.width,t.height)}(e):getHTMLElementContentRect(e):h}function createRectInit(e,t,r,n){return{x:e,y:t,width:r,height:n}}var g=function(){function ResizeObservation(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=createRectInit(0,0,0,0),this.target=e}return ResizeObservation.prototype.isActive=function(){var e=getContentRect(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},ResizeObservation.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},ResizeObservation}(),m=function(){return function ResizeObserverEntry(e,t){var r=function createReadOnlyRect(e){var t=e.x,r=e.y,n=e.width,i=e.height,a="undefined"!==typeof DOMRectReadOnly?DOMRectReadOnly:Object,o=Object.create(a.prototype);return f(o,{x:t,y:r,width:n,height:i,top:r,right:t+n,bottom:i+r,left:t}),o}(t);f(this,{target:e,contentRect:r})}}(),v=function(){function ResizeObserverSPI(e,t,n){if(this.activeObservations_=[],this.observations_=new r,"function"!==typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=n}return ResizeObserverSPI.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!==typeof Element&&Element instanceof Object){if(!(e instanceof d(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new g(e)),this.controller_.addObserver(this),this.controller_.refresh())}},ResizeObserverSPI.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!==typeof Element&&Element instanceof Object){if(!(e instanceof d(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},ResizeObserverSPI.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},ResizeObserverSPI.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},ResizeObserverSPI.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new m(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},ResizeObserverSPI.prototype.clearActive=function(){this.activeObservations_.splice(0)},ResizeObserverSPI.prototype.hasActive=function(){return this.activeObservations_.length>0},ResizeObserverSPI}(),y="undefined"!==typeof WeakMap?new WeakMap:new r,_=function(){return function ResizeObserver(e){if(!(this instanceof ResizeObserver))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=c.getInstance(),r=new v(e,t,this);y.set(this,r)}}();["observe","unobserve","disconnect"].forEach((function(e){_.prototype[e]=function(){var t;return(t=y.get(this))[e].apply(t,arguments)}}));var b="undefined"!==typeof i.ResizeObserver?i.ResizeObserver:_;t.a=b}).call(this,r(18))},function(e){e.exports=JSON.parse('{"name":"vega-lite","author":"Dominik Moritz, Kanit \\"Ham\\" Wongsuphasawat, Arvind Satyanarayan, Jeffrey Heer","version":"3.4.0","collaborators":["Kanit Wongsuphasawat <kanitw@gmail.com> (http://kanitw.yellowpigz.com)","Dominik Moritz <domoritz@cs.washington.edu> (https://www.domoritz.de)","Arvind Satyanarayan (https://arvindsatya.com/)","Jeffrey Heer (https://jheer.org)"],"homepage":"https://vega.github.io/vega-lite/","description":"Vega-Lite is a concise high-level language for interactive visualization.","main":"build/vega-lite.js","unpkg":"build/vega-lite.min.js","jsdelivr":"build/vega-lite.min.js","module":"build/src/index","types":"build/src/index.d.ts","bin":{"vl2png":"./bin/vl2png","vl2svg":"./bin/vl2svg","vl2vg":"./bin/vl2vg"},"directories":{"test":"test"},"scripts":{"build":"npm run build:only","build:only":"npm run tsc:src && rollup -c","postbuild":"terser build/vega-lite.js -cm --source-map content=build/vega-lite.js.map,filename=build/vega-lite.min.js.map -o build/vega-lite.min.js && npm run schema","build:examples":"npm run build:only","postbuild:examples":"npm run data && TZ=America/Los_Angeles scripts/build-examples.sh","build:examples-full":"npm run build:only","postbuild:examples-full":"TZ=America/Los_Angeles scripts/build-examples.sh 1","build:example":"TZ=America/Los_Angeles scripts/build-example.sh","build:toc":"npm run data && bundle exec jekyll build -q && scripts/generate-toc","build:site":"npm run tsc:site && rollup -c site/rollup.config.js","build:versions":"scripts/update-version.sh","clean":"rm -rf build && rm -f examples/compiled/*.png && find site/examples ! -name \'index.md\' -type f -delete","data":"rsync -r node_modules/vega-datasets/data/* data","deploy":"scripts/deploy.sh","deploy:gh":"scripts/deploy-gh.sh","deploy:schema":"scripts/deploy-schema.sh","schema":"mkdir -p build && ts-json-schema-generator -c -f tsconfig.json -t TopLevelSpec > build/vega-lite-schema.json && npm run renameschema && cp build/vega-lite-schema.json _data/","renameschema":"scripts/rename-schema.sh","presite":"npm run data && npm run build:site && npm run build:toc && npm run build:versions && scripts/create-example-pages","site":"bundle exec jekyll serve --incremental","tsc:src":"tsc -b src/tsconfig.src.json","tsc:site":"tsc -b site/tsconfig.site.json","prettierbase":"prettier \'{src,test,test-runtime,site,typings}/**/*.{md,css}\'","eslintbase":"eslint \'{src,test,test-runtime,site,typings}/**/*.{ts,js}\'","format":"npm run eslintbase -- --fix && npm run prettierbase -- --write","lint":"npm run eslintbase && npm run prettierbase -- --check","test":"jest test/ && npm run lint && npm run schema && jest examples/ && npm run test:runtime","test:inspect":"node --inspect-brk ./node_modules/.bin/jest --runInBand test","test:runtime":"TZ=America/Los_Angeles jest test-runtime/","test:runtime:generate":"rm -Rf test-runtime/resources && VL_GENERATE_TESTS=true npm run test:runtime","watch:build":"npm run build:only && concurrently --kill-others -n Typescript,Rollup \'npm run tsc:src -- -w\' \'rollup -c -w\'","watch:site":"concurrently --kill-others -n Typescript,Rollup \'npm run tsc:site -- -w\' \'rollup -c site/rollup.config.js -w\'","watch:test":"jest --watch"},"repository":{"type":"git","url":"https://github.com/vega/vega-lite.git"},"license":"BSD-3-Clause","bugs":{"url":"https://github.com/vega/vega-lite/issues"},"devDependencies":{"@types/chai":"^4.1.7","@types/d3":"^5.7.2","@types/highlight.js":"^9.12.3","@types/jest":"^24.0.15","@types/jest-environment-puppeteer":"^4.0.0","@types/mkdirp":"^0.5.2","@types/node":"^12.6.8","@types/puppeteer":"^1.12.4","@typescript-eslint/eslint-plugin":"^1.13.0","@typescript-eslint/parser":"^1.13.0","ajv":"^6.10.2","chai":"^4.2.0","cheerio":"^1.0.0-rc.2","codecov":"^3.5.0","concurrently":"^4.1.1","d3":"^5.9.7","eslint":"^5.16.0","eslint-config-prettier":"^6.0.0","eslint-plugin-prettier":"^3.1.0","highlight.js":"^9.15.8","http-server":"^0.11.1","jest":"^24.8.0","jest-puppeteer":"^4.3.0","mkdirp":"^0.5.1","prettier":"^1.18.2","puppeteer":"^1.19.0","rollup":"^1.17.0","rollup-plugin-commonjs":"^10.0.1","rollup-plugin-json":"^4.0.0","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-terser":"^5.1.1","svg2png-many":"^0.0.7","terser":"^4.1.2","ts-jest":"^24.0.2","ts-json-schema-generator":"^0.52.14","typescript":"~3.4.5","vega-cli":"^5.4.0","vega-datasets":"^1.25.0","vega-embed":"^4.2.1","vega-tooltip":"^0.18.1","yaml-front-matter":"^4.0.0"},"dependencies":{"@types/clone":"~0.1.30","@types/fast-json-stable-stringify":"^2.0.0","clone":"~2.1.2","fast-deep-equal":"~2.0.1","fast-json-stable-stringify":"~2.0.0","json-stringify-pretty-compact":"~2.0.0","tslib":"~1.10.0","vega-event-selector":"~2.0.0","vega-expression":"~2.6.0","vega-typings":"0.7.2","vega-util":"~1.10.0","yargs":"~13.3.0"},"peerDependencies":{"vega":"^5.4.0"},"jest":{"preset":"jest-puppeteer","transform":{"^.+\\\\.tsx?$":"ts-jest"},"testRegex":"(/__tests__/.*|(\\\\.|/)(test|spec))\\\\.(jsx?|tsx?)$","moduleFileExtensions":["ts","tsx","js","jsx","json","node"],"testPathIgnorePatterns":["<rootDir>/node_modules","<rootDir>/build","<rootDir>/_site","<rootDir>/src"],"coverageDirectory":"./coverage/","collectCoverage":false}}')},function(e,t,r){(function(t){var r=function(){"use strict";function _instanceof(e,t){return null!=t&&e instanceof t}var e,r,n;try{e=Map}catch(i){e=function nativeMap(){}}try{r=Set}catch(i){r=function nativeSet(){}}try{n=Promise}catch(i){n=function nativePromise(){}}function clone(i,a,o,s,u){"object"===typeof a&&(o=a.depth,s=a.prototype,u=a.includeNonEnumerable,a=a.circular);var l=[],c=[],f="undefined"!=typeof t;return"undefined"==typeof a&&(a=!0),"undefined"==typeof o&&(o=1/0),function _clone(i,o){if(null===i)return null;if(0===o)return i;var d,h;if("object"!=typeof i)return i;if(_instanceof(i,e))d=new e;else if(_instanceof(i,r))d=new r;else if(_instanceof(i,n))d=new n((function(e,t){i.then((function(t){e(_clone(t,o-1))}),(function(e){t(_clone(e,o-1))}))}));else if(clone.__isArray(i))d=[];else if(clone.__isRegExp(i))d=new RegExp(i.source,__getRegExpFlags(i)),i.lastIndex&&(d.lastIndex=i.lastIndex);else if(clone.__isDate(i))d=new Date(i.getTime());else{if(f&&t.isBuffer(i))return d=t.allocUnsafe?t.allocUnsafe(i.length):new t(i.length),i.copy(d),d;_instanceof(i,Error)?d=Object.create(i):"undefined"==typeof s?(h=Object.getPrototypeOf(i),d=Object.create(h)):(d=Object.create(s),h=s)}if(a){var p=l.indexOf(i);if(-1!=p)return c[p];l.push(i),c.push(d)}for(var g in _instanceof(i,e)&&i.forEach((function(e,t){var r=_clone(t,o-1),n=_clone(e,o-1);d.set(r,n)})),_instanceof(i,r)&&i.forEach((function(e){var t=_clone(e,o-1);d.add(t)})),i){var m;h&&(m=Object.getOwnPropertyDescriptor(h,g)),m&&null==m.set||(d[g]=_clone(i[g],o-1))}if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(i);for(g=0;g<v.length;g++){var y=v[g];(!(b=Object.getOwnPropertyDescriptor(i,y))||b.enumerable||u)&&(d[y]=_clone(i[y],o-1),b.enumerable||Object.defineProperty(d,y,{enumerable:!1}))}}if(u){var _=Object.getOwnPropertyNames(i);for(g=0;g<_.length;g++){var b,x=_[g];(b=Object.getOwnPropertyDescriptor(i,x))&&b.enumerable||(d[x]=_clone(i[x],o-1),Object.defineProperty(d,x,{enumerable:!1}))}}return d}(i,o)}function __objToStr(e){return Object.prototype.toString.call(e)}function __getRegExpFlags(e){var t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),t}return clone.clonePrototype=function clonePrototype(e){if(null===e)return null;var t=function c(){};return t.prototype=e,new t},clone.__objToStr=__objToStr,clone.__isDate=function __isDate(e){return"object"===typeof e&&"[object Date]"===__objToStr(e)},clone.__isArray=function __isArray(e){return"object"===typeof e&&"[object Array]"===__objToStr(e)},clone.__isRegExp=function __isRegExp(e){return"object"===typeof e&&"[object RegExp]"===__objToStr(e)},clone.__getRegExpFlags=__getRegExpFlags,clone}();e.exports&&(e.exports=r)}).call(this,r(21).Buffer)},function(e,t,r){"use strict";var n=Array.isArray,i=Object.keys,a=Object.prototype.hasOwnProperty;e.exports=function equal(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){var r,o,s,u=n(e),l=n(t);if(u&&l){if((o=e.length)!=t.length)return!1;for(r=o;0!==r--;)if(!equal(e[r],t[r]))return!1;return!0}if(u!=l)return!1;var c=e instanceof Date,f=t instanceof Date;if(c!=f)return!1;if(c&&f)return e.getTime()==t.getTime();var d=e instanceof RegExp,h=t instanceof RegExp;if(d!=h)return!1;if(d&&h)return e.toString()==t.toString();var p=i(e);if((o=p.length)!==i(t).length)return!1;for(r=o;0!==r--;)if(!a.call(t,p[r]))return!1;for(r=o;0!==r--;)if(!equal(e[s=p[r]],t[s]))return!1;return!0}return e!==e&&t!==t}},function(e){e.exports=JSON.parse('{"name":"vega-themes","version":"2.4.0","description":"Themes for stylized Vega and Vega-Lite visualizations.","keywords":["vega","vega-lite","themes","style"],"license":"BSD-3-Clause","author":{"name":"UW Interactive Data Lab","url":"https://idl.cs.washington.edu"},"contributors":[{"name":"Emily Gu","url":"https://github.com/emilygu"},{"name":"Arvind Satyanarayan","url":"http://arvindsatya.com"},{"name":"Jeffrey Heer","url":"http://idl.cs.washington.edu"},{"name":"Dominik Moritz","url":"https://www.domoritz.de"}],"main":"build/vega-themes.js","module":"build/src/index.js","unpkg":"build/vega-themes.min.js","jsdelivr":"build/vega-themes.min.js","typings":"build/src/index.d.ts","repository":{"type":"git","url":"https://github.com/vega/vega-themes.git"},"scripts":{"prepare":"beemo create-config --silent","clean":"rm -rf build examples/build","prettierbase":"beemo prettier \'examples/*.{html,scss,css}\'","eslintbase":"beemo eslint \'src/**/*.ts\'","format":"yarn eslintbase --fix && yarn prettierbase --write","lint":"yarn eslintbase && yarn prettierbase --check","prebuild":"mkdir -p build","build":"tsc && rollup -c","postbuild":"terser build/vega-themes.js -cm > build/vega-themes.min.js","deploy:gh":"yarn build && mkdir -p examples/build && rsync -r build/* examples/build && gh-pages -d examples","prepublishOnly":"yarn clean && yarn build","preversion":"yarn lint","serve":"browser-sync start -s -f build examples --serveStatic examples","start":"yarn build && concurrently --kill-others -n Server,Typescript,Rollup \'yarn serve\' \'tsc -w\' \'rollup -c -w\'"},"devDependencies":{"browser-sync":"^2.26.7","concurrently":"^4.1.2","gh-pages":"^2.1.1","rollup":"^1.20.3","rollup-plugin-json":"^4.0.0","terser":"^4.2.1","typescript":"~3.5.3","vega":"^5.5.2","vega-lite":"^4.0.0-beta.1","vega-lite-dev-config":"^0.2.5"},"peerDependencies":{"vega":"*","vega-lite":"*"},"beemo":{"module":"vega-lite-dev-config","drivers":["prettier","eslint"]}}')},function(e){e.exports=JSON.parse('{"name":"vega-tooltip","version":"0.18.1","description":"A tooltip plugin for Vega-Lite and Vega visualizations.","main":"build/vega-tooltip.js","module":"build/src/index.js","unpkg":"build/vega-tooltip.min.js","jsdelivr":"build/vega-tooltip.min.js","typings":"build/src/index.d.ts","repository":{"type":"git","url":"https://github.com/vega/vega-tooltip.git"},"keywords":["vega-lite","vega","tooltip"],"author":{"name":"UW Interactive Data Lab","url":"https://idl.cs.washington.edu"},"collaborators":["Dominik Moritz","Sira Horradarn","Zening Qu","Kanit Wongsuphasawat","Yuri Astrakhan","Jeffrey Heer"],"license":"BSD-3-Clause","bugs":{"url":"https://github.com/vega/vega-tooltip/issues"},"homepage":"https://github.com/vega/vega-tooltip#readme","scripts":{"prepare":"beemo create-config --silent","build":"rollup -c","clean":"rm -rf build examples/data && rm -f src/style.ts && mkdir build","copy:data":"rsync -r node_modules/vega-datasets/data/* examples/data","copy:build":"rsync -r build/* examples/build","deploy:gh":"yarn build && yarn copy:build && gh-pages -d examples && yarn clean","prettierbase":"beemo prettier \'examples/*.{html,scss,css}\'","eslintbase":"beemo eslint \'{src,test,typings}/**/*.ts\' \'*.js\'","format":"yarn eslintbase --fix && yarn prettierbase --write","lint":"yarn eslintbase && yarn prettierbase --check","postbuild":"terser build/vega-tooltip.js -c -m -o build/vega-tooltip.min.js","prebuild":"yarn clean && yarn copy:data && ./build-style.sh && tsc","prepublishOnly":"yarn build","preversion":"yarn lint","start":"yarn build && concurrently --kill-others -n Server,Typescript,Rollup \'browser-sync start -s -f build examples --serveStatic examples\' \'tsc -w\' \'rollup -c -w\'","pretest":"./build-style.sh","test":"jest"},"devDependencies":{"@types/jest":"^24.0.15","@types/node":"^12.6.8","browser-sync":"^2.26.7","concurrently":"^4.1.1","gh-pages":"^2.0.1","jest":"^24.8.0","node-sass":"^4.12.0","path":"^0.12.7","rollup":"^1.17.0","rollup-plugin-commonjs":"^10.0.1","rollup-plugin-json":"^4.0.0","rollup-plugin-node-resolve":"^5.2.0","terser":"^4.1.2","ts-jest":"^24.0.2","typescript":"^3.5.3","vega-datasets":"^1.25.0","vega-lite-dev-config":"^0.1.16","vega-typings":"^0.7.2"},"dependencies":{"vega-util":"^1.10.0"},"beemo":{"module":"vega-lite-dev-config","drivers":["prettier","eslint"]},"jest":{"testURL":"http://localhost/","transform":{"^.+\\\\.tsx?$":"ts-jest"},"testRegex":"(/__tests__/.*|(\\\\.|/)(test|spec))\\\\.(jsx?|tsx?)$","moduleFileExtensions":["ts","tsx","js","jsx","json","node"],"testPathIgnorePatterns":["node_modules","<rootDir>/build","src"]}}')},function(e,t,r){var n,i,a;i=[r(1),r(16)],void 0===(a="function"===typeof(n=function(t,r){"use strict";var n,i;function _getRequireWildcardCache(){if("function"!==typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function _typeof(e){return(_typeof="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function _typeof(e){return typeof e}:function _typeof(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _possibleConstructorReturn(e,t){return!t||"object"!==_typeof(t)&&"function"!==typeof t?function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),e}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(e,t){return e.__proto__=t,e})(e,t)}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}t=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var r={};if(null!=e){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=n?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}}return r.default=e,t&&t.set(e,r),r}(t),r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r);var a={x:"clientWidth",y:"clientHeight"},o={x:"clientTop",y:"clientLeft"},s={x:"innerWidth",y:"innerHeight"},u={x:"offsetWidth",y:"offsetHeight"},l={x:"offsetLeft",y:"offsetTop"},c={x:"overflowX",y:"overflowY"},f={x:"scrollWidth",y:"scrollHeight"},d={x:"scrollLeft",y:"scrollTop"},h={x:"width",y:"height"},p=function NOOP(){},g=!!function(){if("undefined"===typeof window)return!1;var e=!1;try{document.createElement("div").addEventListener("test",p,{get passive(){return e=!0,!1}})}catch(t){}return e}()&&{passive:!0},m=function constrain(e,t){var r=e.length,n=e.minSize,i=e.type,a=t.from,o=t.size,s=t.itemsPerRow,u=(o=Math.max(o,n))%s;return u&&(o+=s-u),o>r&&(o=r),(u=(a="simple"!==i&&a?Math.max(Math.min(a,r-o),0):0)%s)&&(a-=u,o+=u),a===t.from&&o==t.size?t:function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(r,!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},t,{from:a,size:o})};e.exports=(i=n=function(e){function ReactList(e){var t;return function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,ReactList),(t=_possibleConstructorReturn(this,_getPrototypeOf(ReactList).call(this,e))).state=m(e,{itemsPerRow:1,from:e.initialIndex,size:0}),t.cache={},t.cachedScrollPosition=null,t.prevPrevState={},t.unstable=!1,t.updateCounter=0,t}return function _inherits(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}(ReactList,e),_createClass(ReactList,null,[{key:"getDerivedStateFromProps",value:function getDerivedStateFromProps(e,t){var r=m(e,t);return r===t?null:r}}]),_createClass(ReactList,[{key:"componentDidMount",value:function componentDidMount(){this.updateFrameAndClearCache=this.updateFrameAndClearCache.bind(this),window.addEventListener("resize",this.updateFrameAndClearCache),this.updateFrame(this.scrollTo.bind(this,this.props.initialIndex))}},{key:"componentDidUpdate",value:function componentDidUpdate(e){var t=this;if(this.props.axis!==e.axis&&this.clearSizeCache(),!this.unstable){if(++this.updateCounter>50)return this.unstable=!0,console.error("ReactList failed to reach a stable state.");this.updateCounterTimeoutId||(this.updateCounterTimeoutId=setTimeout((function(){t.updateCounter=0,delete t.updateCounterTimeoutId}),0)),this.updateFrame()}}},{key:"maybeSetState",value:function maybeSetState(e,t){if(function isEqualSubset(e,t){for(var r in t)if(e[r]!==t[r])return!1;return!0}(this.state,e))return t();this.setState(e,t)}},{key:"componentWillUnmount",value:function componentWillUnmount(){window.removeEventListener("resize",this.updateFrameAndClearCache),this.scrollParent.removeEventListener("scroll",this.updateFrameAndClearCache,g),this.scrollParent.removeEventListener("mousewheel",p,g)}},{key:"getOffset",value:function getOffset(e){var t=this.props.axis,r=e[o[t]]||0,n=l[t];do{r+=e[n]||0}while(e=e.offsetParent);return r}},{key:"getEl",value:function getEl(){return this.el||this.items}},{key:"getScrollPosition",value:function getScrollPosition(){if("number"===typeof this.cachedScrollPosition)return this.cachedScrollPosition;var e=this.scrollParent,t=this.props.axis,r=d[t],n=e===window?document.body[r]||document.documentElement[r]:e[r],i=this.getScrollSize()-this.props.scrollParentViewportSizeGetter(this),a=Math.max(0,Math.min(n,i)),o=this.getEl();return this.cachedScrollPosition=this.getOffset(e)+a-this.getOffset(o),this.cachedScrollPosition}},{key:"setScroll",value:function setScroll(e){var t=this.scrollParent,r=this.props.axis;if(e+=this.getOffset(this.getEl()),t===window)return window.scrollTo(0,e);e-=this.getOffset(this.scrollParent),t[d[r]]=e}},{key:"getScrollSize",value:function getScrollSize(){var e=this.scrollParent,t=document,r=t.body,n=t.documentElement,i=f[this.props.axis];return e===window?Math.max(r[i],n[i]):e[i]}},{key:"hasDeterminateSize",value:function hasDeterminateSize(){var e=this.props,t=e.itemSizeGetter;return"uniform"===e.type||t}},{key:"getStartAndEnd",value:function getStartAndEnd(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.threshold,t=this.getScrollPosition(),r=Math.max(0,t-e),n=t+this.props.scrollParentViewportSizeGetter(this)+e;return this.hasDeterminateSize()&&(n=Math.min(n,this.getSpaceBefore(this.props.length))),{start:r,end:n}}},{key:"getItemSizeAndItemsPerRow",value:function getItemSizeAndItemsPerRow(){var e=this.props,t=e.axis,r=e.useStaticSize,n=this.state,i=n.itemSize,a=n.itemsPerRow;if(r&&i&&a)return{itemSize:i,itemsPerRow:a};var o=this.items.children;if(!o.length)return{};var s=o[0],c=s[u[t]],f=Math.abs(c-i);if((isNaN(f)||f>=1)&&(i=c),!i)return{};for(var d=l[t],h=s[d],p=o[a=1];p&&p[d]===h;p=o[a])++a;return{itemSize:i,itemsPerRow:a}}},{key:"clearSizeCache",value:function clearSizeCache(){this.cachedScrollPosition=null}},{key:"updateFrameAndClearCache",value:function updateFrameAndClearCache(e){return this.clearSizeCache(),this.updateFrame(e)}},{key:"updateFrame",value:function updateFrame(e){switch(this.updateScrollParent(),"function"!=typeof e&&(e=p),this.props.type){case"simple":return this.updateSimpleFrame(e);case"variable":return this.updateVariableFrame(e);case"uniform":return this.updateUniformFrame(e)}}},{key:"updateScrollParent",value:function updateScrollParent(){var e=this.scrollParent;this.scrollParent=this.props.scrollParentGetter(this),e!==this.scrollParent&&(e&&(e.removeEventListener("scroll",this.updateFrameAndClearCache),e.removeEventListener("mousewheel",p)),this.clearSizeCache(),this.scrollParent.addEventListener("scroll",this.updateFrameAndClearCache,g),this.scrollParent.addEventListener("mousewheel",p,g))}},{key:"updateSimpleFrame",value:function updateSimpleFrame(e){var t=this.getStartAndEnd().end,r=this.items.children,n=0;if(r.length){var i=this.props.axis,a=r[0],o=r[r.length-1];n=this.getOffset(o)+o[u[i]]-this.getOffset(a)}if(n>t)return e();var s=this.props,l=s.pageSize,c=s.length,f=Math.min(this.state.size+l,c);this.maybeSetState({size:f},e)}},{key:"updateVariableFrame",value:function updateVariableFrame(e){this.props.itemSizeGetter||this.cacheSizes();for(var t=this.getStartAndEnd(),r=t.start,n=t.end,i=this.props,a=i.length,o=i.pageSize,s=0,u=0,l=0,c=a-1;u<c;){var f=this.getSizeOfItem(u);if(null==f||s+f>r)break;s+=f,++u}for(var d=a-u;l<d&&s<n;){var h=this.getSizeOfItem(u+l);if(null==h){l=Math.min(l+o,d);break}s+=h,++l}this.maybeSetState({from:u,size:l},e)}},{key:"updateUniformFrame",value:function updateUniformFrame(e){var t=this.getItemSizeAndItemsPerRow(),r=t.itemSize,n=t.itemsPerRow;if(!r||!n)return e();var i=this.getStartAndEnd(),a=i.start,o=i.end,s=m(this.props,{from:Math.floor(a/r)*n,size:(Math.ceil((o-a)/r)+1)*n,itemsPerRow:n}),u=s.from,l=s.size;return this.maybeSetState({itemsPerRow:n,from:u,itemSize:r,size:l},e)}},{key:"getSpaceBefore",value:function getSpaceBefore(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null!=t[e])return t[e];var r=this.state,n=r.itemSize,i=r.itemsPerRow;if(n)return t[e]=Math.floor(e/i)*n;for(var a=e;a>0&&null==t[--a];);for(var o=t[a]||0,s=a;s<e;++s){t[s]=o;var u=this.getSizeOfItem(s);if(null==u)break;o+=u}return t[e]=o}},{key:"cacheSizes",value:function cacheSizes(){for(var e=this.cache,t=this.state.from,r=this.items.children,n=u[this.props.axis],i=0,a=r.length;i<a;++i)e[t+i]=r[i][n]}},{key:"getSizeOfItem",value:function getSizeOfItem(e){var t=this.cache,r=this.items,n=this.props,i=n.axis,a=n.itemSizeGetter,o=n.itemSizeEstimator,s=n.type,l=this.state,c=l.from,f=l.itemSize,d=l.size;if(f)return f;if(a)return a(e);if(e in t)return t[e];if("simple"===s&&e>=c&&e<c+d&&r){var h=r.children[e-c];if(h)return h[u[i]]}return o?o(e,t):void 0}},{key:"scrollTo",value:function scrollTo(e){null!=e&&this.setScroll(this.getSpaceBefore(e))}},{key:"scrollAround",value:function scrollAround(e){var t=this.getScrollPosition(),r=this.getSpaceBefore(e),n=r-this.props.scrollParentViewportSizeGetter(this)+this.getSizeOfItem(e),i=Math.min(n,r),a=Math.max(n,r);return t<=i?this.setScroll(i):t>a?this.setScroll(a):void 0}},{key:"getVisibleRange",value:function getVisibleRange(){for(var e,t,r=this.state,n=r.from,i=r.size,a=this.getStartAndEnd(0),o=a.start,s=a.end,u={},l=n;l<n+i;++l){var c=this.getSpaceBefore(l,u),f=c+this.getSizeOfItem(l);null==e&&f>o&&(e=l),null!=e&&c<s&&(t=l)}return[e,t]}},{key:"renderItems",value:function renderItems(){for(var e=this,t=this.props,r=t.itemRenderer,n=t.itemsRenderer,i=this.state,a=i.from,o=i.size,s=[],u=0;u<o;++u)s.push(r(a+u,u));return n(s,(function(t){return e.items=t}))}},{key:"render",value:function render(){var e=this,r=this.props,n=r.axis,i=r.length,a=r.type,o=r.useTranslate3d,s=this.state,u=s.from,l=s.itemsPerRow,c=this.renderItems();if("simple"===a)return c;var f={position:"relative"},d={},p=Math.ceil(i/l)*l,g=this.getSpaceBefore(p,d);g&&(f[h[n]]=g,"x"===n&&(f.overflowX="hidden"));var m=this.getSpaceBefore(u,d),v="x"===n?m:0,y="y"===n?m:0,_=o?"translate3d(".concat(v,"px, ").concat(y,"px, 0)"):"translate(".concat(v,"px, ").concat(y,"px)"),b={msTransform:_,WebkitTransform:_,transform:_};return t.default.createElement("div",{style:f,ref:function ref(t){return e.el=t}},t.default.createElement("div",{style:b},c))}}]),ReactList}(t.Component),_defineProperty(n,"displayName","ReactList"),_defineProperty(n,"propTypes",{axis:r.default.oneOf(["x","y"]),initialIndex:r.default.number,itemRenderer:r.default.func,itemSizeEstimator:r.default.func,itemSizeGetter:r.default.func,itemsRenderer:r.default.func,length:r.default.number,minSize:r.default.number,pageSize:r.default.number,scrollParentGetter:r.default.func,scrollParentViewportSizeGetter:r.default.func,threshold:r.default.number,type:r.default.oneOf(["simple","variable","uniform"]),useStaticSize:r.default.bool,useTranslate3d:r.default.bool}),_defineProperty(n,"defaultProps",{axis:"y",itemRenderer:function itemRenderer(e,r){return t.default.createElement("div",{key:r},e)},itemsRenderer:function itemsRenderer(e,r){return t.default.createElement("div",{ref:r},e)},length:0,minSize:1,pageSize:10,scrollParentGetter:function defaultScrollParentGetter(e){for(var t=e.props.axis,r=e.getEl(),n=c[t];r=r.parentElement;)switch(window.getComputedStyle(r)[n]){case"auto":case"scroll":case"overlay":return r}return window},scrollParentViewportSizeGetter:function defaultScrollParentViewportSizeGetter(e){var t=e.props.axis,r=e.scrollParent;return r===window?window[s[t]]:r[a[t]]},threshold:100,type:"simple",useStaticSize:!1,useTranslate3d:!1}),i)})?n.apply(t,i):n)||(e.exports=a)},,,function(e,t,r){var n,i=i||function(e){"use strict";if(!("undefined"===typeof e||"undefined"!==typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent))){var t=e.document,r=function get_URL(){return e.URL||e.webkitURL||e},n=t.createElementNS("http://www.w3.org/1999/xhtml","a"),i="download"in n,a=/constructor/i.test(e.HTMLElement)||e.safari,o=/CriOS\/[\d]+/.test(navigator.userAgent),s=function throw_outside(t){(e.setImmediate||e.setTimeout)((function(){throw t}),0)},u=function revoke(e){setTimeout((function revoker(){"string"===typeof e?r().revokeObjectURL(e):e.remove()}),4e4)},l=function auto_bom(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([String.fromCharCode(65279),e],{type:e.type}):e},c=function FileSaver(t,c,f){f||(t=l(t));var d,h=this,p="application/octet-stream"===t.type,g=function dispatch_all(){!function dispatch(e,t,r){for(var n=(t=[].concat(t)).length;n--;){var i=e["on"+t[n]];if("function"===typeof i)try{i.call(e,r||e)}catch(a){s(a)}}}(h,"writestart progress write writeend".split(" "))};if(h.readyState=h.INIT,i)return d=r().createObjectURL(t),void setTimeout((function(){n.href=d,n.download=c,function click(e){var t=new MouseEvent("click");e.dispatchEvent(t)}(n),g(),u(d),h.readyState=h.DONE}));!function fs_error(){if((o||p&&a)&&e.FileReader){var n=new FileReader;return n.onloadend=function(){var t=o?n.result:n.result.replace(/^data:[^;]*;/,"data:attachment/file;");e.open(t,"_blank")||(e.location.href=t),t=void 0,h.readyState=h.DONE,g()},n.readAsDataURL(t),void(h.readyState=h.INIT)}(d||(d=r().createObjectURL(t)),p)?e.location.href=d:e.open(d,"_blank")||(e.location.href=d);h.readyState=h.DONE,g(),u(d)}()},f=c.prototype;return"undefined"!==typeof navigator&&navigator.msSaveOrOpenBlob?function(e,t,r){return t=t||e.name||"download",r||(e=l(e)),navigator.msSaveOrOpenBlob(e,t)}:(f.abort=function(){},f.readyState=f.INIT=0,f.WRITING=1,f.DONE=2,f.error=f.onwritestart=f.onprogress=f.onwrite=f.onabort=f.onerror=f.onwriteend=null,function saveAs(e,t,r){return new c(e,t||e.name||"download",r)})}}("undefined"!==typeof self&&self||"undefined"!==typeof window&&window||this.content);e.exports?e.exports.saveAs=i:null!==r(490)&&null!==r(491)&&(void 0===(n=function(){return i}.call(t,r,t,e))||(e.exports=n))},function(e,t,r){"use strict";var n=function(){function defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&defineProperties(e.prototype,t),r&&defineProperties(e,r),e}}(),i=_interopRequireDefault(r(492)),a=_interopRequireDefault(r(511)),o=_interopRequireDefault(r(512)),s=_interopRequireDefault(r(513)),u=_interopRequireDefault(r(514)),l=_interopRequireDefault(r(515)),c=_interopRequireDefault(r(517)),f=_interopRequireDefault(r(518)),d=_interopRequireDefault(r(519)),h=_interopRequireDefault(r(520));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var p=function(){function GitHub(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"https://api.github.com";!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,GitHub),this.__apiBase=t,this.__auth=e||{}}return n(GitHub,[{key:"getGist",value:function getGist(e){return new i.default(e,this.__auth,this.__apiBase)}},{key:"getUser",value:function getUser(e){return new a.default(e,this.__auth,this.__apiBase)}},{key:"getOrganization",value:function getOrganization(e){return new c.default(e,this.__auth,this.__apiBase)}},{key:"getTeam",value:function getTeam(e){return new f.default(e,this.__auth,this.__apiBase)}},{key:"getRepo",value:function getRepo(e,t){return new l.default(this._getFullName(e,t),this.__auth,this.__apiBase)}},{key:"getIssues",value:function getIssues(e,t){return new o.default(this._getFullName(e,t),this.__auth,this.__apiBase)}},{key:"search",value:function search(e){return new s.default(e,this.__auth,this.__apiBase)}},{key:"getRateLimit",value:function getRateLimit(){return new u.default(this.__auth,this.__apiBase)}},{key:"getMarkdown",value:function getMarkdown(){return new d.default(this.__auth,this.__apiBase)}},{key:"getProject",value:function getProject(e){return new h.default(e,this.__auth,this.__apiBase)}},{key:"_getFullName",value:function _getFullName(e,t){var r=e;return t&&(r=e+"/"+t),r}}]),GitHub}();e.exports=p},,,,function(e,t,r){var n=r(521),i=r(131),a=r(209),o=r(79)("socket.io-client");e.exports=t=lookup;var s=t.managers={};function lookup(e,t){"object"===typeof e&&(t=e,e=void 0),t=t||{};var r,i=n(e),u=i.source,l=i.id,c=i.path,f=s[l]&&c in s[l].nsps;return t.forceNew||t["force new connection"]||!1===t.multiplex||f?(o("ignoring socket cache for %s",u),r=a(u,t)):(s[l]||(o("new io instance for %s",u),s[l]=a(u,t)),r=s[l]),i.query&&!t.query&&(t.query=i.query),r.socket(i.path,t)}t.protocol=i.protocol,t.connect=lookup,t.Manager=r(209),t.Socket=r(215)},,,,,,,,function(e,t,r){(function(e){("undefined"!==typeof window?window:"undefined"!==typeof e?e:"undefined"!==typeof self?self:{}).SENTRY_RELEASE={id:"13a7aa3da82ecbeefb39a87f6c3f30843a2ad42b"}}).call(this,r(18))},,function(e,t,r){var n=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,i="function"===typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function wrap(e,t,r,n){var i=t&&t.prototype instanceof Generator?t:Generator,a=Object.create(i.prototype),o=new Context(n||[]);return a._invoke=function makeInvokeMethod(e,t,r){var n=u;return function invoke(i,a){if(n===c)throw new Error("Generator is already running");if(n===f){if("throw"===i)throw a;return doneResult()}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var s=maybeInvokeDelegate(o,r);if(s){if(s===d)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===u)throw n=f,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=c;var h=tryCatch(e,t,r);if("normal"===h.type){if(n=r.done?f:l,h.arg===d)continue;return{value:h.arg,done:r.done}}"throw"===h.type&&(n=f,r.method="throw",r.arg=h.arg)}}}(e,r,o),a}function tryCatch(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(n){return{type:"throw",arg:n}}}e.wrap=wrap;var u="suspendedStart",l="suspendedYield",c="executing",f="completed",d={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var h={};h[a]=function(){return this};var p=Object.getPrototypeOf,g=p&&p(p(values([])));g&&g!==r&&n.call(g,a)&&(h=g);var m=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(h);function defineIteratorMethods(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function AsyncIterator(e){var t;this._invoke=function enqueue(r,i){function callInvokeWithMethodAndArg(){return new Promise((function(t,a){!function invoke(t,r,i,a){var o=tryCatch(e[t],e,r);if("throw"!==o.type){var s=o.arg,u=s.value;return u&&"object"===typeof u&&n.call(u,"__await")?Promise.resolve(u.__await).then((function(e){invoke("next",e,i,a)}),(function(e){invoke("throw",e,i,a)})):Promise.resolve(u).then((function(e){s.value=e,i(s)}),(function(e){return invoke("throw",e,i,a)}))}a(o.arg)}(r,i,t,a)}))}return t=t?t.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}function maybeInvokeDelegate(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method))return d;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var i=tryCatch(n,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,d;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function pushTryEntry(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function resetTryEntry(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function Context(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(pushTryEntry,this),this.reset(!0)}function values(e){if(e){var r=e[a];if(r)return r.call(e);if("function"===typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function next(){for(;++i<e.length;)if(n.call(e,i))return next.value=e[i],next.done=!1,next;return next.value=t,next.done=!0,next};return o.next=o}}return{next:doneResult}}function doneResult(){return{value:t,done:!0}}return GeneratorFunction.prototype=m.constructor=GeneratorFunctionPrototype,GeneratorFunctionPrototype.constructor=GeneratorFunction,GeneratorFunctionPrototype[s]=GeneratorFunction.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"===typeof e&&e.constructor;return!!t&&(t===GeneratorFunction||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,s in e||(e[s]="GeneratorFunction")),e.prototype=Object.create(m),e},e.awrap=function(e){return{__await:e}},defineIteratorMethods(AsyncIterator.prototype),AsyncIterator.prototype[o]=function(){return this},e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,i){var a=new AsyncIterator(wrap(t,r,n,i));return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},defineIteratorMethods(m),m[s]="Generator",m[a]=function(){return this},m.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function next(){for(;t.length;){var r=t.pop();if(r in e)return next.value=r,next.done=!1,next}return next.done=!0,next}},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function stop(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,i){return o.type="throw",o.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return handle("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return handle(a.catchLoc,!0);if(this.prev<a.finallyLoc)return handle(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return handle(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return handle(a.finallyLoc)}}}},abrupt:function abrupt(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,d):this.complete(o)},complete:function complete(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function finish(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),d}},catch:function _catch(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;resetTryEntry(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}(e.exports);try{regeneratorRuntime=n}catch(i){Function("r","regeneratorRuntime = r")(n)}},function(e,t,r){"use strict";var n=r(66),i="function"===typeof Symbol&&Symbol.for,a=i?Symbol.for("react.element"):60103,o=i?Symbol.for("react.portal"):60106,s=i?Symbol.for("react.fragment"):60107,u=i?Symbol.for("react.strict_mode"):60108,l=i?Symbol.for("react.profiler"):60114,c=i?Symbol.for("react.provider"):60109,f=i?Symbol.for("react.context"):60110,d=i?Symbol.for("react.forward_ref"):60112,h=i?Symbol.for("react.suspense"):60113,p=i?Symbol.for("react.suspense_list"):60120,g=i?Symbol.for("react.memo"):60115,m=i?Symbol.for("react.lazy"):60116;i&&Symbol.for("react.fundamental"),i&&Symbol.for("react.responder");var v="function"===typeof Symbol&&Symbol.iterator;function A(e){for(var t=e.message,r="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)r+="&args[]="+encodeURIComponent(arguments[n]);return e.message="Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",e}var y={isMounted:function isMounted(){return!1},enqueueForceUpdate:function enqueueForceUpdate(){},enqueueReplaceState:function enqueueReplaceState(){},enqueueSetState:function enqueueSetState(){}},_={};function D(e,t,r){this.props=e,this.context=t,this.refs=_,this.updater=r||y}function E(){}function F(e,t,r){this.props=e,this.context=t,this.refs=_,this.updater=r||y}D.prototype.isReactComponent={},D.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw A(Error(85));this.updater.enqueueSetState(this,e,t,"setState")},D.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},E.prototype=D.prototype;var b=F.prototype=new E;b.constructor=F,n(b,D.prototype),b.isPureReactComponent=!0;var x={current:null},w={suspense:null},k={current:null},C=Object.prototype.hasOwnProperty,O={key:!0,ref:!0,__self:!0,__source:!0};function M(e,t,r){var n=void 0,i={},o=null,s=null;if(null!=t)for(n in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(o=""+t.key),t)C.call(t,n)&&!O.hasOwnProperty(n)&&(i[n]=t[n]);var u=arguments.length-2;if(1===u)i.children=r;else if(1<u){for(var l=Array(u),c=0;c<u;c++)l[c]=arguments[c+2];i.children=l}if(e&&e.defaultProps)for(n in u=e.defaultProps)void 0===i[n]&&(i[n]=u[n]);return{$$typeof:a,type:e,key:o,ref:s,props:i,_owner:k.current}}function N(e){return"object"===typeof e&&null!==e&&e.$$typeof===a}var P=/\/+/g,j=[];function Q(e,t,r,n){if(j.length){var i=j.pop();return i.result=e,i.keyPrefix=t,i.func=r,i.context=n,i.count=0,i}return{result:e,keyPrefix:t,func:r,context:n,count:0}}function R(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>j.length&&j.push(e)}function U(e,t,r){return null==e?0:function S(e,t,r,n){var i=typeof e;"undefined"!==i&&"boolean"!==i||(e=null);var s=!1;if(null===e)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case a:case o:s=!0}}if(s)return r(n,e,""===t?"."+T(e,0):t),1;if(s=0,t=""===t?".":t+":",Array.isArray(e))for(var u=0;u<e.length;u++){var l=t+T(i=e[u],u);s+=S(i,l,r,n)}else if(null===e||"object"!==typeof e?l=null:l="function"===typeof(l=v&&e[v]||e["@@iterator"])?l:null,"function"===typeof l)for(e=l.call(e),u=0;!(i=e.next()).done;)s+=S(i=i.value,l=t+T(i,u++),r,n);else if("object"===i)throw r=""+e,A(Error(31),"[object Object]"===r?"object with keys {"+Object.keys(e).join(", ")+"}":r,"");return s}(e,"",t,r)}function T(e,t){return"object"===typeof e&&null!==e&&null!=e.key?function escape(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,(function(e){return t[e]}))}(e.key):t.toString(36)}function ea(e,t){e.func.call(e.context,t,e.count++)}function fa(e,t,r){var n=e.result,i=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?V(e,n,r,(function(e){return e})):null!=e&&(N(e)&&(e=function da(e,t){return{$$typeof:a,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(e,i+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(P,"$&/")+"/")+r)),n.push(e))}function V(e,t,r,n,i){var a="";null!=r&&(a=(""+r).replace(P,"$&/")+"/"),U(e,fa,t=Q(t,a,n,i)),R(t)}function W(){var e=x.current;if(null===e)throw A(Error(321));return e}var I={Children:{map:function map(e,t,r){if(null==e)return e;var n=[];return V(e,n,null,t,r),n},forEach:function forEach(e,t,r){if(null==e)return e;U(e,ea,t=Q(null,null,t,r)),R(t)},count:function count(e){return U(e,(function(){return null}),null)},toArray:function toArray(e){var t=[];return V(e,t,null,(function(e){return e})),t},only:function only(e){if(!N(e))throw A(Error(143));return e}},createRef:function createRef(){return{current:null}},Component:D,PureComponent:F,createContext:function createContext(e,t){return void 0===t&&(t=null),(e={$$typeof:f,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:c,_context:e},e.Consumer=e},forwardRef:function forwardRef(e){return{$$typeof:d,render:e}},lazy:function lazy(e){return{$$typeof:m,_ctor:e,_status:-1,_result:null}},memo:function memo(e,t){return{$$typeof:g,type:e,compare:void 0===t?null:t}},useCallback:function useCallback(e,t){return W().useCallback(e,t)},useContext:function useContext(e,t){return W().useContext(e,t)},useEffect:function useEffect(e,t){return W().useEffect(e,t)},useImperativeHandle:function useImperativeHandle(e,t,r){return W().useImperativeHandle(e,t,r)},useDebugValue:function useDebugValue(){},useLayoutEffect:function useLayoutEffect(e,t){return W().useLayoutEffect(e,t)},useMemo:function useMemo(e,t){return W().useMemo(e,t)},useReducer:function useReducer(e,t,r){return W().useReducer(e,t,r)},useRef:function useRef(e){return W().useRef(e)},useState:function useState(e){return W().useState(e)},Fragment:s,Profiler:l,StrictMode:u,Suspense:h,unstable_SuspenseList:p,createElement:M,cloneElement:function cloneElement(e,t,r){if(null===e||void 0===e)throw A(Error(267),e);var i=void 0,o=n({},e.props),s=e.key,u=e.ref,l=e._owner;if(null!=t){void 0!==t.ref&&(u=t.ref,l=k.current),void 0!==t.key&&(s=""+t.key);var c=void 0;for(i in e.type&&e.type.defaultProps&&(c=e.type.defaultProps),t)C.call(t,i)&&!O.hasOwnProperty(i)&&(o[i]=void 0===t[i]&&void 0!==c?c[i]:t[i])}if(1===(i=arguments.length-2))o.children=r;else if(1<i){c=Array(i);for(var f=0;f<i;f++)c[f]=arguments[f+2];o.children=c}return{$$typeof:a,type:e.type,key:s,ref:u,props:o,_owner:l}},createFactory:function createFactory(e){var t=M.bind(null,e);return t.type=e,t},isValidElement:N,version:"16.9.0",unstable_withSuspenseConfig:function unstable_withSuspenseConfig(e,t){var r=w.suspense;w.suspense=void 0===t?null:t;try{e()}finally{w.suspense=r}},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentDispatcher:x,ReactCurrentBatchConfig:w,ReactCurrentOwner:k,IsSomeRendererActing:{current:!1},assign:n}},L={default:I},B=L&&I||L;e.exports=B.default||B},function(r,i,a){"use strict";var o=a(1),s=a(66),u=a(260);function t(e){for(var t=e.message,r="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)r+="&args[]="+encodeURIComponent(arguments[n]);return e.message="Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",e}if(!o)throw t(Error(227));var p=null,m={};function da(){if(p)for(var e in m){var r=m[e],n=p.indexOf(e);if(!(-1<n))throw t(Error(96),e);if(!_[n]){if(!r.extractEvents)throw t(Error(97),e);for(var i in _[n]=r,n=r.eventTypes){var a=void 0,o=n[i],s=r,u=i;if(w.hasOwnProperty(u))throw t(Error(99),u);w[u]=o;var l=o.phasedRegistrationNames;if(l){for(a in l)l.hasOwnProperty(a)&&ha(l[a],s,u);a=!0}else o.registrationName?(ha(o.registrationName,s,u),a=!0):a=!1;if(!a)throw t(Error(98),i,e)}}}}function ha(e,r,n){if(E[e])throw t(Error(100),e);E[e]=r,C[e]=r.eventTypes[n].dependencies}var _=[],w={},E={},C={};function ka(e,t,r,n,i,a,o,s,u){var l=Array.prototype.slice.call(arguments,3);try{t.apply(r,l)}catch(c){this.onError(c)}}var T=!1,A=null,R=!1,P=null,j={onError:function onError(e){T=!0,A=e}};function qa(e,t,r,n,i,a,o,s,u){T=!1,A=null,ka.apply(j,arguments)}var M=null,F=null,I=null;function wa(e,r,n){var i=e.type||"unknown-event";e.currentTarget=I(n),function ra(e,r,n,i,a,o,s,u,l){if(qa.apply(this,arguments),T){if(!T)throw t(Error(198));var c=A;T=!1,A=null,R||(R=!0,P=c)}}(i,r,void 0,e),e.currentTarget=null}function xa(e,r){if(null==r)throw t(Error(30));return null==e?r:Array.isArray(e)?Array.isArray(r)?(e.push.apply(e,r),e):(e.push(r),e):Array.isArray(r)?[e].concat(r):[e,r]}function ya(e,t,r){Array.isArray(e)?e.forEach(t,r):e&&t.call(r,e)}var L=null;function Aa(e){if(e){var t=e._dispatchListeners,r=e._dispatchInstances;if(Array.isArray(t))for(var n=0;n<t.length&&!e.isPropagationStopped();n++)wa(e,t[n],r[n]);else t&&wa(e,t,r);e._dispatchListeners=null,e._dispatchInstances=null,e.isPersistent()||e.constructor.release(e)}}function Ba(e){if(null!==e&&(L=xa(L,e)),e=L,L=null,e){if(ya(e,Aa),L)throw t(Error(95));if(R)throw e=P,R=!1,P=null,e}}var B={injectEventPluginOrder:function injectEventPluginOrder(e){if(p)throw t(Error(101));p=Array.prototype.slice.call(e),da()},injectEventPluginsByName:function injectEventPluginsByName(e){var r,n=!1;for(r in e)if(e.hasOwnProperty(r)){var i=e[r];if(!m.hasOwnProperty(r)||m[r]!==i){if(m[r])throw t(Error(102),r);m[r]=i,n=!0}}n&&da()}};function Da(e,r){var n=e.stateNode;if(!n)return null;var i=M(n);if(!i)return null;n=i[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":(i=!i.disabled)||(i=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!i;break e;default:e=!1}if(e)return null;if(n&&"function"!==typeof n)throw t(Error(231),r,typeof n);return n}var U=Math.random().toString(36).slice(2),q="__reactInternalInstance$"+U,W="__reactEventHandlers$"+U;function Ha(e){if(e[q])return e[q];for(;!e[q];){if(!e.parentNode)return null;e=e.parentNode}return 5===(e=e[q]).tag||6===e.tag?e:null}function Ia(e){return!(e=e[q])||5!==e.tag&&6!==e.tag?null:e}function Ja(e){if(5===e.tag||6===e.tag)return e.stateNode;throw t(Error(33))}function Ka(e){return e[W]||null}function La(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function Ma(e,t,r){(t=Da(e,r.dispatchConfig.phasedRegistrationNames[t]))&&(r._dispatchListeners=xa(r._dispatchListeners,t),r._dispatchInstances=xa(r._dispatchInstances,e))}function Na(e){if(e&&e.dispatchConfig.phasedRegistrationNames){for(var t=e._targetInst,r=[];t;)r.push(t),t=La(t);for(t=r.length;0<t--;)Ma(r[t],"captured",e);for(t=0;t<r.length;t++)Ma(r[t],"bubbled",e)}}function Oa(e,t,r){e&&r&&r.dispatchConfig.registrationName&&(t=Da(e,r.dispatchConfig.registrationName))&&(r._dispatchListeners=xa(r._dispatchListeners,t),r._dispatchInstances=xa(r._dispatchInstances,e))}function Pa(e){e&&e.dispatchConfig.registrationName&&Oa(e._targetInst,null,e)}function Qa(e){ya(e,Na)}var V=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement);function Sa(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Y={animationend:Sa("Animation","AnimationEnd"),animationiteration:Sa("Animation","AnimationIteration"),animationstart:Sa("Animation","AnimationStart"),transitionend:Sa("Transition","TransitionEnd")},$={},X={};function Wa(e){if($[e])return $[e];if(!Y[e])return e;var t,r=Y[e];for(t in r)if(r.hasOwnProperty(t)&&t in X)return $[e]=r[t];return e}V&&(X=document.createElement("div").style,"AnimationEvent"in window||(delete Y.animationend.animation,delete Y.animationiteration.animation,delete Y.animationstart.animation),"TransitionEvent"in window||delete Y.transitionend.transition);var K=Wa("animationend"),Q=Wa("animationiteration"),ee=Wa("animationstart"),re=Wa("transitionend"),ue="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),ce=null,fe=null,de=null;function fb(){if(de)return de;var e,t,r=fe,n=r.length,i="value"in ce?ce.value:ce.textContent,a=i.length;for(e=0;e<n&&r[e]===i[e];e++);var o=n-e;for(t=1;t<=o&&r[n-t]===i[a-t];t++);return de=i.slice(e,1<t?1-t:void 0)}function gb(){return!0}function hb(){return!1}function y(e,t,r,n){for(var i in this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=r,e=this.constructor.Interface)e.hasOwnProperty(i)&&((t=e[i])?this[i]=t(r):"target"===i?this.target=n:this[i]=r[i]);return this.isDefaultPrevented=(null!=r.defaultPrevented?r.defaultPrevented:!1===r.returnValue)?gb:hb,this.isPropagationStopped=hb,this}function jb(e,t,r,n){if(this.eventPool.length){var i=this.eventPool.pop();return this.call(i,e,t,r,n),i}return new this(e,t,r,n)}function kb(e){if(!(e instanceof this))throw t(Error(279));e.destructor(),10>this.eventPool.length&&this.eventPool.push(e)}function ib(e){e.eventPool=[],e.getPooled=jb,e.release=kb}s(y.prototype,{preventDefault:function preventDefault(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=gb)},stopPropagation:function stopPropagation(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=gb)},persist:function persist(){this.isPersistent=gb},isPersistent:hb,destructor:function destructor(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=hb,this._dispatchInstances=this._dispatchListeners=null}}),y.Interface={type:null,target:null,currentTarget:function currentTarget(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function timeStamp(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},y.extend=function(e){function b(){}function c(){return t.apply(this,arguments)}var t=this;b.prototype=t.prototype;var r=new b;return s(r,c.prototype),c.prototype=r,c.prototype.constructor=c,c.Interface=s({},t.Interface,e),c.extend=t.extend,ib(c),c},ib(y);var he=y.extend({data:null}),ge=y.extend({data:null}),ve=[9,13,27,32],ye=V&&"CompositionEvent"in window,_e=null;V&&"documentMode"in document&&(_e=document.documentMode);var xe=V&&"TextEvent"in window&&!_e,Ce=V&&(!ye||_e&&8<_e&&11>=_e),Oe=String.fromCharCode(32),Re={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},Pe=!1;function wb(e,t){switch(e){case"keyup":return-1!==ve.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function xb(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var je=!1;var Me={eventTypes:Re,extractEvents:function extractEvents(e,t,r,n){var i=void 0,a=void 0;if(ye)e:{switch(e){case"compositionstart":i=Re.compositionStart;break e;case"compositionend":i=Re.compositionEnd;break e;case"compositionupdate":i=Re.compositionUpdate;break e}i=void 0}else je?wb(e,r)&&(i=Re.compositionEnd):"keydown"===e&&229===r.keyCode&&(i=Re.compositionStart);return i?(Ce&&"ko"!==r.locale&&(je||i!==Re.compositionStart?i===Re.compositionEnd&&je&&(a=fb()):(fe="value"in(ce=n)?ce.value:ce.textContent,je=!0)),i=he.getPooled(i,t,r,n),a?i.data=a:null!==(a=xb(r))&&(i.data=a),Qa(i),a=i):a=null,(e=xe?function Ab(e,t){switch(e){case"compositionend":return xb(t);case"keypress":return 32!==t.which?null:(Pe=!0,Oe);case"textInput":return(e=t.data)===Oe&&Pe?null:e;default:return null}}(e,r):function Bb(e,t){if(je)return"compositionend"===e||!ye&&wb(e,t)?(e=fb(),de=fe=ce=null,je=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Ce&&"ko"!==t.locale?null:t.data;default:return null}}(e,r))?((t=ge.getPooled(Re.beforeInput,t,r,n)).data=e,Qa(t)):t=null,null===a?t:null===t?a:[a,t]}},Ie=null,Le=null,He=null;function Gb(e){if(e=F(e)){if("function"!==typeof Ie)throw t(Error(280));var r=M(e.stateNode);Ie(e.stateNode,e.type,r)}}function Hb(e){Le?He?He.push(e):He=[e]:Le=e}function Ib(){if(Le){var e=Le,t=He;if(He=Le=null,Gb(e),t)for(e=0;e<t.length;e++)Gb(t[e])}}function Jb(e,t){return e(t)}function Kb(e,t,r,n){return e(t,r,n)}function Lb(){}var $e=Jb,Qe=!1;function Ob(){null===Le&&null===He||(Lb(),Ib())}var Ze={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Qb(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Ze[e.type]:"textarea"===t}function Rb(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}function Sb(e){if(!V)return!1;var t=(e="on"+e)in document;return t||((t=document.createElement("div")).setAttribute(e,"return;"),t="function"===typeof t[e]),t}function Tb(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function Vb(e){e._valueTracker||(e._valueTracker=function Ub(e){var t=Tb(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof r&&"function"===typeof r.get&&"function"===typeof r.set){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function get(){return i.call(this)},set:function set(e){n=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function getValue(){return n},setValue:function setValue(e){n=""+e},stopTracking:function stopTracking(){e._valueTracker=null,delete e[t]}}}}(e))}function Wb(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=Tb(e)?e.checked?"true":"false":e.value),(e=n)!==r&&(t.setValue(e),!0)}var et=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;et.hasOwnProperty("ReactCurrentDispatcher")||(et.ReactCurrentDispatcher={current:null}),et.hasOwnProperty("ReactCurrentBatchConfig")||(et.ReactCurrentBatchConfig={suspense:null});var tt=/^(.*)[\\\/]/,rt="function"===typeof Symbol&&Symbol.for,nt=rt?Symbol.for("react.element"):60103,it=rt?Symbol.for("react.portal"):60106,at=rt?Symbol.for("react.fragment"):60107,ot=rt?Symbol.for("react.strict_mode"):60108,st=rt?Symbol.for("react.profiler"):60114,ut=rt?Symbol.for("react.provider"):60109,lt=rt?Symbol.for("react.context"):60110,ct=rt?Symbol.for("react.concurrent_mode"):60111,ft=rt?Symbol.for("react.forward_ref"):60112,dt=rt?Symbol.for("react.suspense"):60113,ht=rt?Symbol.for("react.suspense_list"):60120,pt=rt?Symbol.for("react.memo"):60115,gt=rt?Symbol.for("react.lazy"):60116;rt&&Symbol.for("react.fundamental"),rt&&Symbol.for("react.responder");var mt="function"===typeof Symbol&&Symbol.iterator;function mc(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=mt&&e[mt]||e["@@iterator"])?e:null}function oc(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case at:return"Fragment";case it:return"Portal";case st:return"Profiler";case ot:return"StrictMode";case dt:return"Suspense";case ht:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case lt:return"Context.Consumer";case ut:return"Context.Provider";case ft:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case pt:return oc(e.type);case gt:if(e=1===e._status?e._result:null)return oc(e)}return null}function pc(e){var t="";do{e:switch(e.tag){case 3:case 4:case 6:case 7:case 10:case 9:var r="";break e;default:var n=e._debugOwner,i=e._debugSource,a=oc(e.type);r=null,n&&(r=oc(n.type)),n=a,a="",i?a=" (at "+i.fileName.replace(tt,"")+":"+i.lineNumber+")":r&&(a=" (created by "+r+")"),r="\n in "+(n||"Unknown")+a}t+=r,e=e.return}while(e);return t}var vt=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,yt=Object.prototype.hasOwnProperty,_t={},bt={};function D(e,t,r,n,i,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a}var xt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){xt[e]=new D(e,0,!1,e,null,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];xt[t]=new D(t,1,!1,e[1],null,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){xt[e]=new D(e,2,!1,e.toLowerCase(),null,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){xt[e]=new D(e,2,!1,e,null,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){xt[e]=new D(e,3,!1,e.toLowerCase(),null,!1)})),["checked","multiple","muted","selected"].forEach((function(e){xt[e]=new D(e,3,!0,e,null,!1)})),["capture","download"].forEach((function(e){xt[e]=new D(e,4,!1,e,null,!1)})),["cols","rows","size","span"].forEach((function(e){xt[e]=new D(e,6,!1,e,null,!1)})),["rowSpan","start"].forEach((function(e){xt[e]=new D(e,5,!1,e.toLowerCase(),null,!1)}));var wt=/[\-:]([a-z])/g;function yc(e){return e[1].toUpperCase()}function zc(e,t,r,n){var i=xt.hasOwnProperty(t)?xt[t]:null;(null!==i?0===i.type:!n&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(function wc(e,t,r,n){if(null===t||"undefined"===typeof t||function vc(e,t,r,n){if(null!==r&&0===r.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!n&&(null!==r?!r.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,r,n))return!0;if(n)return!1;if(null!==r)switch(r.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,r,i,n)&&(r=null),n||null===i?function uc(e){return!!yt.call(bt,e)||!yt.call(_t,e)&&(vt.test(e)?bt[e]=!0:(_t[e]=!0,!1))}(t)&&(null===r?e.removeAttribute(t):e.setAttribute(t,""+r)):i.mustUseProperty?e[i.propertyName]=null===r?3!==i.type&&"":r:(t=i.attributeName,n=i.attributeNamespace,null===r?e.removeAttribute(t):(r=3===(i=i.type)||4===i&&!0===r?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}function Ac(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function Bc(e,t){var r=t.checked;return s({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=r?r:e._wrapperState.initialChecked})}function Cc(e,t){var r=null==t.defaultValue?"":t.defaultValue,n=null!=t.checked?t.checked:t.defaultChecked;r=Ac(null!=t.value?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function Dc(e,t){null!=(t=t.checked)&&zc(e,"checked",t,!1)}function Ec(e,t){Dc(e,t);var r=Ac(t.value),n=t.type;if(null!=r)"number"===n?(0===r&&""===e.value||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if("submit"===n||"reset"===n)return void e.removeAttribute("value");t.hasOwnProperty("value")?Fc(e,t.type,r):t.hasOwnProperty("defaultValue")&&Fc(e,t.type,Ac(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function Gc(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!("submit"!==n&&"reset"!==n||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}""!==(r=e.name)&&(e.name=""),e.defaultChecked=!e.defaultChecked,e.defaultChecked=!!e._wrapperState.initialChecked,""!==r&&(e.name=r)}function Fc(e,t,r){"number"===t&&e.ownerDocument.activeElement===e||(null==r?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(wt,yc);xt[t]=new D(t,1,!1,e,null,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(wt,yc);xt[t]=new D(t,1,!1,e,"http://www.w3.org/1999/xlink",!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(wt,yc);xt[t]=new D(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)})),["tabIndex","crossOrigin"].forEach((function(e){xt[e]=new D(e,1,!1,e.toLowerCase(),null,!1)})),xt.xlinkHref=new D("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach((function(e){xt[e]=new D(e,1,!1,e.toLowerCase(),null,!0)}));var kt={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"blur change click focus input keydown keyup selectionchange".split(" ")}};function Ic(e,t,r){return(e=y.getPooled(kt.change,e,t,r)).type="change",Hb(r),Qa(e),e}var St=null,Et=null;function Lc(e){Ba(e)}function Mc(e){if(Wb(Ja(e)))return e}function Nc(e,t){if("change"===e)return t}var Ct=!1;function Pc(){St&&(St.detachEvent("onpropertychange",Qc),Et=St=null)}function Qc(e){if("value"===e.propertyName&&Mc(Et))if(e=Ic(Et,e,Rb(e)),Qe)Ba(e);else{Qe=!0;try{Jb(Lc,e)}finally{Qe=!1,Ob()}}}function Rc(e,t,r){"focus"===e?(Pc(),Et=r,(St=t).attachEvent("onpropertychange",Qc)):"blur"===e&&Pc()}function Sc(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Mc(Et)}function Tc(e,t){if("click"===e)return Mc(t)}function Uc(e,t){if("input"===e||"change"===e)return Mc(t)}V&&(Ct=Sb("input")&&(!document.documentMode||9<document.documentMode));var Tt={eventTypes:kt,_isInputEventSupported:Ct,extractEvents:function extractEvents(e,t,r,n){var i=t?Ja(t):window,a=void 0,o=void 0,s=i.nodeName&&i.nodeName.toLowerCase();if("select"===s||"input"===s&&"file"===i.type?a=Nc:Qb(i)?Ct?a=Uc:(a=Sc,o=Rc):(s=i.nodeName)&&"input"===s.toLowerCase()&&("checkbox"===i.type||"radio"===i.type)&&(a=Tc),a&&(a=a(e,t)))return Ic(a,r,n);o&&o(e,i,t),"blur"===e&&(e=i._wrapperState)&&e.controlled&&"number"===i.type&&Fc(i,"number",i.value)}},Ot=y.extend({view:null,detail:null}),At={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Yc(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=At[e])&&!!t[e]}function Zc(){return Yc}var Rt=0,Dt=0,Pt=!1,jt=!1,Mt=Ot.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:Zc,button:null,buttons:null,relatedTarget:function relatedTarget(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},movementX:function movementX(e){if("movementX"in e)return e.movementX;var t=Rt;return Rt=e.screenX,Pt?"mousemove"===e.type?e.screenX-t:0:(Pt=!0,0)},movementY:function movementY(e){if("movementY"in e)return e.movementY;var t=Dt;return Dt=e.screenY,jt?"mousemove"===e.type?e.screenY-t:0:(jt=!0,0)}}),Ft=Mt.extend({pointerId:null,width:null,height:null,pressure:null,tangentialPressure:null,tiltX:null,tiltY:null,twist:null,pointerType:null,isPrimary:null}),It={mouseEnter:{registrationName:"onMouseEnter",dependencies:["mouseout","mouseover"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["mouseout","mouseover"]},pointerEnter:{registrationName:"onPointerEnter",dependencies:["pointerout","pointerover"]},pointerLeave:{registrationName:"onPointerLeave",dependencies:["pointerout","pointerover"]}},Lt={eventTypes:It,extractEvents:function extractEvents(e,t,r,n){var i="mouseover"===e||"pointerover"===e,a="mouseout"===e||"pointerout"===e;if(i&&(r.relatedTarget||r.fromElement)||!a&&!i)return null;if(i=n.window===n?n:(i=n.ownerDocument)?i.defaultView||i.parentWindow:window,a?(a=t,t=(t=r.relatedTarget||r.toElement)?Ha(t):null):a=null,a===t)return null;var o=void 0,s=void 0,u=void 0,l=void 0;"mouseout"===e||"mouseover"===e?(o=Mt,s=It.mouseLeave,u=It.mouseEnter,l="mouse"):"pointerout"!==e&&"pointerover"!==e||(o=Ft,s=It.pointerLeave,u=It.pointerEnter,l="pointer");var c=null==a?i:Ja(a);if(i=null==t?i:Ja(t),(e=o.getPooled(s,a,r,n)).type=l+"leave",e.target=c,e.relatedTarget=i,(r=o.getPooled(u,t,r,n)).type=l+"enter",r.target=i,r.relatedTarget=c,n=t,a&&n)e:{for(i=n,l=0,o=t=a;o;o=La(o))l++;for(o=0,u=i;u;u=La(u))o++;for(;0<l-o;)t=La(t),l--;for(;0<o-l;)i=La(i),o--;for(;l--;){if(t===i||t===i.alternate)break e;t=La(t),i=La(i)}t=null}else t=null;for(i=t,t=[];a&&a!==i&&(null===(l=a.alternate)||l!==i);)t.push(a),a=La(a);for(a=[];n&&n!==i&&(null===(l=n.alternate)||l!==i);)a.push(n),n=La(n);for(n=0;n<t.length;n++)Oa(t[n],"bubbled",e);for(n=a.length;0<n--;)Oa(a[n],"captured",r);return[e,r]}};function hd(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t}var Nt=Object.prototype.hasOwnProperty;function jd(e,t){if(hd(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++)if(!Nt.call(t,r[n])||!hd(e[r[n]],t[r[n]]))return!1;return!0}function kd(e,t){return{responder:e,props:t}}function ld(e){var t=e;if(e.alternate)for(;t.return;)t=t.return;else{if(0!==(2&t.effectTag))return 1;for(;t.return;)if(0!==(2&(t=t.return).effectTag))return 1}return 3===t.tag?2:3}function od(e){if(2!==ld(e))throw t(Error(188))}function qd(e){if(!(e=function pd(e){var r=e.alternate;if(!r){if(3===(r=ld(e)))throw t(Error(188));return 1===r?null:e}for(var n=e,i=r;;){var a=n.return;if(null===a)break;var o=a.alternate;if(null===o){if(null!==(i=a.return)){n=i;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return od(a),e;if(o===i)return od(a),r;o=o.sibling}throw t(Error(188))}if(n.return!==i.return)n=a,i=o;else{for(var s=!1,u=a.child;u;){if(u===n){s=!0,n=a,i=o;break}if(u===i){s=!0,i=a,n=o;break}u=u.sibling}if(!s){for(u=o.child;u;){if(u===n){s=!0,n=o,i=a;break}if(u===i){s=!0,i=o,n=a;break}u=u.sibling}if(!s)throw t(Error(189))}}if(n.alternate!==i)throw t(Error(190))}if(3!==n.tag)throw t(Error(188));return n.stateNode.current===n?e:r}(e)))return null;for(var r=e;;){if(5===r.tag||6===r.tag)return r;if(r.child)r.child.return=r,r=r.child;else{if(r===e)break;for(;!r.sibling;){if(!r.return||r.return===e)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}}return null}new Map,new Map,new Set,new Map;var Bt=y.extend({animationName:null,elapsedTime:null,pseudoElement:null}),Ut=y.extend({clipboardData:function clipboardData(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),zt=Ot.extend({relatedTarget:null});function ud(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}for(var qt={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Wt={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Gt=Ot.extend({key:function key(e){if(e.key){var t=qt[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=ud(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Wt[e.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:Zc,charCode:function charCode(e){return"keypress"===e.type?ud(e):0},keyCode:function keyCode(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function which(e){return"keypress"===e.type?ud(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),Ht=Mt.extend({dataTransfer:null}),Vt=Ot.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:Zc}),Yt=y.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),$t=Mt.extend({deltaX:function deltaX(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function deltaY(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null}),Xt=[["blur","blur",0],["cancel","cancel",0],["click","click",0],["close","close",0],["contextmenu","contextMenu",0],["copy","copy",0],["cut","cut",0],["auxclick","auxClick",0],["dblclick","doubleClick",0],["dragend","dragEnd",0],["dragstart","dragStart",0],["drop","drop",0],["focus","focus",0],["input","input",0],["invalid","invalid",0],["keydown","keyDown",0],["keypress","keyPress",0],["keyup","keyUp",0],["mousedown","mouseDown",0],["mouseup","mouseUp",0],["paste","paste",0],["pause","pause",0],["play","play",0],["pointercancel","pointerCancel",0],["pointerdown","pointerDown",0],["pointerup","pointerUp",0],["ratechange","rateChange",0],["reset","reset",0],["seeked","seeked",0],["submit","submit",0],["touchcancel","touchCancel",0],["touchend","touchEnd",0],["touchstart","touchStart",0],["volumechange","volumeChange",0],["drag","drag",1],["dragenter","dragEnter",1],["dragexit","dragExit",1],["dragleave","dragLeave",1],["dragover","dragOver",1],["mousemove","mouseMove",1],["mouseout","mouseOut",1],["mouseover","mouseOver",1],["pointermove","pointerMove",1],["pointerout","pointerOut",1],["pointerover","pointerOver",1],["scroll","scroll",1],["toggle","toggle",1],["touchmove","touchMove",1],["wheel","wheel",1],["abort","abort",2],[K,"animationEnd",2],[Q,"animationIteration",2],[ee,"animationStart",2],["canplay","canPlay",2],["canplaythrough","canPlayThrough",2],["durationchange","durationChange",2],["emptied","emptied",2],["encrypted","encrypted",2],["ended","ended",2],["error","error",2],["gotpointercapture","gotPointerCapture",2],["load","load",2],["loadeddata","loadedData",2],["loadedmetadata","loadedMetadata",2],["loadstart","loadStart",2],["lostpointercapture","lostPointerCapture",2],["playing","playing",2],["progress","progress",2],["seeking","seeking",2],["stalled","stalled",2],["suspend","suspend",2],["timeupdate","timeUpdate",2],[re,"transitionEnd",2],["waiting","waiting",2]],Kt={},Jt={},Qt=0;Qt<Xt.length;Qt++){var Zt=Xt[Qt],er=Zt[0],tr=Zt[1],rr=Zt[2],nr="on"+(tr[0].toUpperCase()+tr.slice(1)),ir={phasedRegistrationNames:{bubbled:nr,captured:nr+"Capture"},dependencies:[er],eventPriority:rr};Kt[tr]=ir,Jt[er]=ir}var ar={eventTypes:Kt,getEventPriority:function getEventPriority(e){return void 0!==(e=Jt[e])?e.eventPriority:2},extractEvents:function extractEvents(e,t,r,n){var i=Jt[e];if(!i)return null;switch(e){case"keypress":if(0===ud(r))return null;case"keydown":case"keyup":e=Gt;break;case"blur":case"focus":e=zt;break;case"click":if(2===r.button)return null;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":e=Mt;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":e=Ht;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":e=Vt;break;case K:case Q:case ee:e=Bt;break;case re:e=Yt;break;case"scroll":e=Ot;break;case"wheel":e=$t;break;case"copy":case"cut":case"paste":e=Ut;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":e=Ft;break;default:e=y}return Qa(t=e.getPooled(i,t,r,n)),t}},or=ar.getEventPriority,sr=[];function Pd(e){var t=e.targetInst,r=t;do{if(!r){e.ancestors.push(r);break}var n;for(n=r;n.return;)n=n.return;if(!(n=3!==n.tag?null:n.stateNode.containerInfo))break;e.ancestors.push(r),r=Ha(n)}while(r);for(r=0;r<e.ancestors.length;r++){t=e.ancestors[r];var i=Rb(e.nativeEvent);n=e.topLevelType;for(var a=e.nativeEvent,o=null,s=0;s<_.length;s++){var u=_[s];u&&(u=u.extractEvents(n,t,a,i))&&(o=xa(o,u))}Ba(o)}}var ur=!0;function G(e,t){Rd(t,e,!1)}function Rd(e,t,r){switch(or(t)){case 0:var n=Sd.bind(null,t,1);break;case 1:n=Td.bind(null,t,1);break;default:n=Ud.bind(null,t,1)}r?e.addEventListener(t,n,!0):e.addEventListener(t,n,!1)}function Sd(e,t,r){Qe||Lb();var n=Ud,i=Qe;Qe=!0;try{Kb(n,e,t,r)}finally{(Qe=i)||Ob()}}function Td(e,t,r){Ud(e,t,r)}function Ud(e,t,r){if(ur){if(null===(t=Ha(t=Rb(r)))||"number"!==typeof t.tag||2===ld(t)||(t=null),sr.length){var n=sr.pop();n.topLevelType=e,n.nativeEvent=r,n.targetInst=t,e=n}else e={topLevelType:e,nativeEvent:r,targetInst:t,ancestors:[]};try{if(r=e,Qe)Pd(r);else{Qe=!0;try{$e(Pd,r,void 0)}finally{Qe=!1,Ob()}}}finally{e.topLevelType=null,e.nativeEvent=null,e.targetInst=null,e.ancestors.length=0,10>sr.length&&sr.push(e)}}}var lr=new("function"===typeof WeakMap?WeakMap:Map);function Wd(e){var t=lr.get(e);return void 0===t&&(t=new Set,lr.set(e,t)),t}function Xd(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Yd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Zd(e,t){var r,n=Yd(e);for(e=0;n;){if(3===n.nodeType){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Yd(n)}}function ae(){for(var e=window,t=Xd();t instanceof e.HTMLIFrameElement;){try{var r="string"===typeof t.contentWindow.location.href}catch(n){r=!1}if(!r)break;t=Xd((e=t.contentWindow).document)}return t}function be(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var cr=V&&"documentMode"in document&&11>=document.documentMode,fr={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},dr=null,hr=null,pr=null,gr=!1;function ie(e,t){var r=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;return gr||null==dr||dr!==Xd(r)?null:("selectionStart"in(r=dr)&&be(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},pr&&jd(pr,r)?null:(pr=r,(e=y.getPooled(fr.select,hr,e,t)).type="select",e.target=dr,Qa(e),e))}var mr={eventTypes:fr,extractEvents:function extractEvents(e,t,r,n){var i,a=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;if(!(i=!a)){e:{a=Wd(a),i=C.onSelect;for(var o=0;o<i.length;o++)if(!a.has(i[o])){a=!1;break e}a=!0}i=!a}if(i)return null;switch(a=t?Ja(t):window,e){case"focus":(Qb(a)||"true"===a.contentEditable)&&(dr=a,hr=t,pr=null);break;case"blur":pr=hr=dr=null;break;case"mousedown":gr=!0;break;case"contextmenu":case"mouseup":case"dragend":return gr=!1,ie(r,n);case"selectionchange":if(cr)break;case"keydown":case"keyup":return ie(r,n)}return null}};function le(e,t){return e=s({children:void 0},t),(t=function ke(e){var t="";return o.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(t.children))&&(e.children=t),e}function me(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i<r.length;i++)t["$"+r[i]]=!0;for(r=0;r<e.length;r++)i=t.hasOwnProperty("$"+e[r].value),e[r].selected!==i&&(e[r].selected=i),i&&n&&(e[r].defaultSelected=!0)}else{for(r=""+Ac(r),t=null,i=0;i<e.length;i++){if(e[i].value===r)return e[i].selected=!0,void(n&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function ne(e,r){if(null!=r.dangerouslySetInnerHTML)throw t(Error(91));return s({},r,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function oe(e,r){var n=r.value;if(null==n){if(n=r.defaultValue,null!=(r=r.children)){if(null!=n)throw t(Error(92));if(Array.isArray(r)){if(!(1>=r.length))throw t(Error(93));r=r[0]}n=r}null==n&&(n="")}e._wrapperState={initialValue:Ac(n)}}function pe(e,t){var r=Ac(t.value),n=Ac(t.defaultValue);null!=r&&((r=""+r)!==e.value&&(e.value=r),null==t.defaultValue&&e.defaultValue!==r&&(e.defaultValue=r)),null!=n&&(e.defaultValue=""+n)}function qe(e){var t=e.textContent;t===e._wrapperState.initialValue&&(e.value=t)}B.injectEventPluginOrder("ResponderEventPlugin SimpleEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" ")),M=Ka,F=Ia,I=Ja,B.injectEventPluginsByName({SimpleEventPlugin:ar,EnterLeaveEventPlugin:Lt,ChangeEventPlugin:Tt,SelectEventPlugin:mr,BeforeInputEventPlugin:Me});var vr={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function se(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function te(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?se(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var yr=void 0,_r=function(e){return"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,r,n,i){MSApp.execUnsafeLocalFunction((function(){return e(t,r)}))}:e}((function(e,t){if(e.namespaceURI!==vr.svg||"innerHTML"in e)e.innerHTML=t;else{for((yr=yr||document.createElement("div")).innerHTML="<svg>"+t+"</svg>",t=yr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}}));function we(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&3===r.nodeType)return void(r.nodeValue=t)}e.textContent=t}var br={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},xr=["Webkit","ms","Moz","O"];function ze(e,t,r){return null==t||"boolean"===typeof t||""===t?"":r||"number"!==typeof t||0===t||br.hasOwnProperty(e)&&br[e]?(""+t).trim():t+"px"}function Ae(e,t){for(var r in e=e.style,t)if(t.hasOwnProperty(r)){var n=0===r.indexOf("--"),i=ze(r,t[r],n);"float"===r&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}Object.keys(br).forEach((function(e){xr.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),br[t]=br[e]}))}));var wr=s({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function De(e,r){if(r){if(wr[e]&&(null!=r.children||null!=r.dangerouslySetInnerHTML))throw t(Error(137),e,"");if(null!=r.dangerouslySetInnerHTML){if(null!=r.children)throw t(Error(60));if(!("object"===typeof r.dangerouslySetInnerHTML&&"__html"in r.dangerouslySetInnerHTML))throw t(Error(61))}if(null!=r.style&&"object"!==typeof r.style)throw t(Error(62),"")}}function Ee(e,t){if(-1===e.indexOf("-"))return"string"===typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function Fe(e,t){var r=Wd(e=9===e.nodeType||11===e.nodeType?e:e.ownerDocument);t=C[t];for(var n=0;n<t.length;n++){var i=t[n];if(!r.has(i)){switch(i){case"scroll":Rd(e,"scroll",!0);break;case"focus":case"blur":Rd(e,"focus",!0),Rd(e,"blur",!0),r.add("blur"),r.add("focus");break;case"cancel":case"close":Sb(i)&&Rd(e,i,!0);break;case"invalid":case"submit":case"reset":break;default:-1===ue.indexOf(i)&&G(i,e)}r.add(i)}}}function Ge(){}var kr=null,Sr=null;function Je(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function Ke(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var Er="function"===typeof setTimeout?setTimeout:void 0,Cr="function"===typeof clearTimeout?clearTimeout:void 0;function Ne(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}new Set;var Tr=[],Or=-1;function H(e){0>Or||(e.current=Tr[Or],Tr[Or]=null,Or--)}function J(e,t){Tr[++Or]=e.current,e.current=t}var Ar={},Rr={current:Ar},Dr={current:!1},Pr=Ar;function Se(e,t){var r=e.type.contextTypes;if(!r)return Ar;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i,a={};for(i in r)a[i]=t[i];return n&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function N(e){return null!==(e=e.childContextTypes)&&void 0!==e}function Te(e){H(Dr),H(Rr)}function Ue(e){H(Dr),H(Rr)}function Ve(e,r,n){if(Rr.current!==Ar)throw t(Error(168));J(Rr,r),J(Dr,n)}function We(e,r,n){var i=e.stateNode;if(e=r.childContextTypes,"function"!==typeof i.getChildContext)return n;for(var a in i=i.getChildContext())if(!(a in e))throw t(Error(108),oc(r)||"Unknown",a);return s({},n,i)}function Xe(e){var t=e.stateNode;return t=t&&t.__reactInternalMemoizedMergedChildContext||Ar,Pr=Rr.current,J(Rr,t),J(Dr,Dr.current),!0}function Ye(e,r,n){var i=e.stateNode;if(!i)throw t(Error(169));n?(r=We(e,r,Pr),i.__reactInternalMemoizedMergedChildContext=r,H(Dr),H(Rr),J(Rr,r)):H(Dr),J(Dr,n)}var jr=u.unstable_runWithPriority,Mr=u.unstable_scheduleCallback,Fr=u.unstable_cancelCallback,Ir=u.unstable_shouldYield,Lr=u.unstable_requestPaint,Nr=u.unstable_now,Br=u.unstable_getCurrentPriorityLevel,Ur=u.unstable_ImmediatePriority,zr=u.unstable_UserBlockingPriority,qr=u.unstable_NormalPriority,Wr=u.unstable_LowPriority,Gr=u.unstable_IdlePriority,Hr={},Vr=void 0!==Lr?Lr:function(){},Yr=null,$r=null,Xr=!1,Kr=Nr(),Jr=1e4>Kr?Nr:function(){return Nr()-Kr};function tf(){switch(Br()){case Ur:return 99;case zr:return 98;case qr:return 97;case Wr:return 96;case Gr:return 95;default:throw t(Error(332))}}function uf(e){switch(e){case 99:return Ur;case 98:return zr;case 97:return qr;case 96:return Wr;case 95:return Gr;default:throw t(Error(332))}}function vf(e,t){return e=uf(e),jr(e,t)}function wf(e,t,r){return e=uf(e),Mr(e,t,r)}function xf(e){return null===Yr?(Yr=[e],$r=Mr(Ur,yf)):Yr.push(e),Hr}function O(){null!==$r&&Fr($r),yf()}function yf(){if(!Xr&&null!==Yr){Xr=!0;var e=0;try{var t=Yr;vf(99,(function(){for(;e<t.length;e++){var r=t[e];do{r=r(!0)}while(null!==r)}})),Yr=null}catch(r){throw null!==Yr&&(Yr=Yr.slice(e+1)),Mr(Ur,O),r}finally{Xr=!1}}}function zf(e,t){return 1073741823===t?99:1===t?95:0>=(e=10*(1073741821-t)-10*(1073741821-e))?99:250>=e?98:5250>=e?97:95}function Af(e,t){if(e&&e.defaultProps)for(var r in t=s({},t),e=e.defaultProps)void 0===t[r]&&(t[r]=e[r]);return t}var Qr={current:null},Zr=null,en=null,tn=null;function Gf(){tn=en=Zr=null}function Hf(e,t){var r=e.type._context;J(Qr,r._currentValue),r._currentValue=t}function If(e){var t=Qr.current;H(Qr),e.type._context._currentValue=t}function Jf(e,t){for(;null!==e;){var r=e.alternate;if(e.childExpirationTime<t)e.childExpirationTime=t,null!==r&&r.childExpirationTime<t&&(r.childExpirationTime=t);else{if(!(null!==r&&r.childExpirationTime<t))break;r.childExpirationTime=t}e=e.return}}function Kf(e,t){Zr=e,tn=en=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(e.expirationTime>=t&&(Yn=!0),e.firstContext=null)}function Mf(e,r){if(tn!==e&&!1!==r&&0!==r)if("number"===typeof r&&1073741823!==r||(tn=e,r=1073741823),r={context:e,observedBits:r,next:null},null===en){if(null===Zr)throw t(Error(308));en=r,Zr.dependencies={expirationTime:0,firstContext:r,responders:null}}else en=en.next=r;return e._currentValue}var rn=!1;function Of(e){return{baseState:e,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function Pf(e){return{baseState:e.baseState,firstUpdate:e.firstUpdate,lastUpdate:e.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function Qf(e,t){return{expirationTime:e,suspenseConfig:t,tag:0,payload:null,callback:null,next:null,nextEffect:null}}function Rf(e,t){null===e.lastUpdate?e.firstUpdate=e.lastUpdate=t:(e.lastUpdate.next=t,e.lastUpdate=t)}function Sf(e,t){var r=e.alternate;if(null===r){var n=e.updateQueue,i=null;null===n&&(n=e.updateQueue=Of(e.memoizedState))}else n=e.updateQueue,i=r.updateQueue,null===n?null===i?(n=e.updateQueue=Of(e.memoizedState),i=r.updateQueue=Of(r.memoizedState)):n=e.updateQueue=Pf(i):null===i&&(i=r.updateQueue=Pf(n));null===i||n===i?Rf(n,t):null===n.lastUpdate||null===i.lastUpdate?(Rf(n,t),Rf(i,t)):(Rf(n,t),i.lastUpdate=t)}function Tf(e,t){var r=e.updateQueue;null===(r=null===r?e.updateQueue=Of(e.memoizedState):Uf(e,r)).lastCapturedUpdate?r.firstCapturedUpdate=r.lastCapturedUpdate=t:(r.lastCapturedUpdate.next=t,r.lastCapturedUpdate=t)}function Uf(e,t){var r=e.alternate;return null!==r&&t===r.updateQueue&&(t=e.updateQueue=Pf(t)),t}function Vf(e,t,r,n,i,a){switch(r.tag){case 1:return"function"===typeof(e=r.payload)?e.call(a,n,i):e;case 3:e.effectTag=-2049&e.effectTag|64;case 0:if(null===(i="function"===typeof(e=r.payload)?e.call(a,n,i):e)||void 0===i)break;return s({},n,i);case 2:rn=!0}return n}function Wf(e,t,r,n,i){rn=!1;for(var a=(t=Uf(e,t)).baseState,o=null,s=0,u=t.firstUpdate,l=a;null!==u;){var c=u.expirationTime;c<i?(null===o&&(o=u,a=l),s<c&&(s=c)):(Xf(c,u.suspenseConfig),l=Vf(e,0,u,l,r,n),null!==u.callback&&(e.effectTag|=32,u.nextEffect=null,null===t.lastEffect?t.firstEffect=t.lastEffect=u:(t.lastEffect.nextEffect=u,t.lastEffect=u))),u=u.next}for(c=null,u=t.firstCapturedUpdate;null!==u;){var f=u.expirationTime;f<i?(null===c&&(c=u,null===o&&(a=l)),s<f&&(s=f)):(l=Vf(e,0,u,l,r,n),null!==u.callback&&(e.effectTag|=32,u.nextEffect=null,null===t.lastCapturedEffect?t.firstCapturedEffect=t.lastCapturedEffect=u:(t.lastCapturedEffect.nextEffect=u,t.lastCapturedEffect=u))),u=u.next}null===o&&(t.lastUpdate=null),null===c?t.lastCapturedUpdate=null:e.effectTag|=32,null===o&&null===c&&(a=l),t.baseState=a,t.firstUpdate=o,t.firstCapturedUpdate=c,e.expirationTime=s,e.memoizedState=l}function Yf(e,t,r){null!==t.firstCapturedUpdate&&(null!==t.lastUpdate&&(t.lastUpdate.next=t.firstCapturedUpdate,t.lastUpdate=t.lastCapturedUpdate),t.firstCapturedUpdate=t.lastCapturedUpdate=null),Zf(t.firstEffect,r),t.firstEffect=t.lastEffect=null,Zf(t.firstCapturedEffect,r),t.firstCapturedEffect=t.lastCapturedEffect=null}function Zf(e,r){for(;null!==e;){var n=e.callback;if(null!==n){e.callback=null;var i=r;if("function"!==typeof n)throw t(Error(191),n);n.call(i)}e=e.nextEffect}}var nn=et.ReactCurrentBatchConfig,an=(new o.Component).refs;function bg(e,t,r,n){r=null===(r=r(n,t=e.memoizedState))||void 0===r?t:s({},t,r),e.memoizedState=r,null!==(n=e.updateQueue)&&0===e.expirationTime&&(n.baseState=r)}var on={isMounted:function isMounted(e){return!!(e=e._reactInternalFiber)&&2===ld(e)},enqueueSetState:function enqueueSetState(e,t,r){e=e._reactInternalFiber;var n=cg(),i=nn.suspense;(i=Qf(n=dg(n,e,i),i)).payload=t,void 0!==r&&null!==r&&(i.callback=r),Sf(e,i),eg(e,n)},enqueueReplaceState:function enqueueReplaceState(e,t,r){e=e._reactInternalFiber;var n=cg(),i=nn.suspense;(i=Qf(n=dg(n,e,i),i)).tag=1,i.payload=t,void 0!==r&&null!==r&&(i.callback=r),Sf(e,i),eg(e,n)},enqueueForceUpdate:function enqueueForceUpdate(e,t){e=e._reactInternalFiber;var r=cg(),n=nn.suspense;(n=Qf(r=dg(r,e,n),n)).tag=2,void 0!==t&&null!==t&&(n.callback=t),Sf(e,n),eg(e,r)}};function gg(e,t,r,n,i,a,o){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(n,a,o):!t.prototype||!t.prototype.isPureReactComponent||(!jd(r,n)||!jd(i,a))}function hg(e,t,r){var n=!1,i=Ar,a=t.contextType;return"object"===typeof a&&null!==a?a=Mf(a):(i=N(t)?Pr:Rr.current,a=(n=null!==(n=t.contextTypes)&&void 0!==n)?Se(e,i):Ar),t=new t(r,a),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=on,e.stateNode=t,t._reactInternalFiber=e,n&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function ig(e,t,r,n){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(r,n),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&on.enqueueReplaceState(t,t.state,null)}function jg(e,t,r,n){var i=e.stateNode;i.props=r,i.state=e.memoizedState,i.refs=an;var a=t.contextType;"object"===typeof a&&null!==a?i.context=Mf(a):(a=N(t)?Pr:Rr.current,i.context=Se(e,a)),null!==(a=e.updateQueue)&&(Wf(e,a,r,i,n),i.state=e.memoizedState),"function"===typeof(a=t.getDerivedStateFromProps)&&(bg(e,t,a,r),i.state=e.memoizedState),"function"===typeof t.getDerivedStateFromProps||"function"===typeof i.getSnapshotBeforeUpdate||"function"!==typeof i.UNSAFE_componentWillMount&&"function"!==typeof i.componentWillMount||(t=i.state,"function"===typeof i.componentWillMount&&i.componentWillMount(),"function"===typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&on.enqueueReplaceState(i,i.state,null),null!==(a=e.updateQueue)&&(Wf(e,a,r,i,n),i.state=e.memoizedState)),"function"===typeof i.componentDidMount&&(e.effectTag|=4)}var sn=Array.isArray;function lg(e,r,n){if(null!==(e=n.ref)&&"function"!==typeof e&&"object"!==typeof e){if(n._owner){n=n._owner;var i=void 0;if(n){if(1!==n.tag)throw t(Error(309));i=n.stateNode}if(!i)throw t(Error(147),e);var a=""+e;return null!==r&&null!==r.ref&&"function"===typeof r.ref&&r.ref._stringRef===a?r.ref:((r=function b(e){var b=i.refs;b===an&&(b=i.refs={}),null===e?delete b[a]:b[a]=e})._stringRef=a,r)}if("string"!==typeof e)throw t(Error(284));if(!n._owner)throw t(Error(290),e)}return e}function mg(e,r){if("textarea"!==e.type)throw t(Error(31),"[object Object]"===Object.prototype.toString.call(r)?"object with keys {"+Object.keys(r).join(", ")+"}":r,"")}function ng(r){function b(e,t){if(r){var n=e.lastEffect;null!==n?(n.nextEffect=t,e.lastEffect=t):e.firstEffect=e.lastEffect=t,t.nextEffect=null,t.effectTag=8}}function c(e,t){if(!r)return null;for(;null!==t;)b(e,t),t=t.sibling;return null}function d(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function e(e,t,r){return(e=og(e,t)).index=0,e.sibling=null,e}function f(e,t,n){return e.index=n,r?null!==(n=e.alternate)?(n=n.index)<t?(e.effectTag=2,t):n:(e.effectTag=2,t):t}function h(e){return r&&null===e.alternate&&(e.effectTag=2),e}function g(t,r,n,i){return null===r||6!==r.tag?((r=pg(n,t.mode,i)).return=t,r):((r=e(r,n)).return=t,r)}function k(t,r,n,i){return null!==r&&r.elementType===n.type?((i=e(r,n.props)).ref=lg(t,r,n),i.return=t,i):((i=qg(n.type,n.key,n.props,null,t.mode,i)).ref=lg(t,r,n),i.return=t,i)}function l(t,r,n,i){return null===r||4!==r.tag||r.stateNode.containerInfo!==n.containerInfo||r.stateNode.implementation!==n.implementation?((r=rg(n,t.mode,i)).return=t,r):((r=e(r,n.children||[])).return=t,r)}function n(t,r,n,i,a){return null===r||7!==r.tag?((r=sg(n,t.mode,i,a)).return=t,r):((r=e(r,n)).return=t,r)}function z(e,t,r){if("string"===typeof t||"number"===typeof t)return(t=pg(""+t,e.mode,r)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case nt:return(r=qg(t.type,t.key,t.props,null,e.mode,r)).ref=lg(e,null,t),r.return=e,r;case it:return(t=rg(t,e.mode,r)).return=e,t}if(sn(t)||mc(t))return(t=sg(t,e.mode,r,null)).return=e,t;mg(e,t)}return null}function x(e,t,r,i){var a=null!==t?t.key:null;if("string"===typeof r||"number"===typeof r)return null!==a?null:g(e,t,""+r,i);if("object"===typeof r&&null!==r){switch(r.$$typeof){case nt:return r.key===a?r.type===at?n(e,t,r.props.children,i,a):k(e,t,r,i):null;case it:return r.key===a?l(e,t,r,i):null}if(sn(r)||mc(r))return null!==a?null:n(e,t,r,i,null);mg(e,r)}return null}function v(e,t,r,i,a){if("string"===typeof i||"number"===typeof i)return g(t,e=e.get(r)||null,""+i,a);if("object"===typeof i&&null!==i){switch(i.$$typeof){case nt:return e=e.get(null===i.key?r:i.key)||null,i.type===at?n(t,e,i.props.children,a,i.key):k(t,e,i,a);case it:return l(t,e=e.get(null===i.key?r:i.key)||null,i,a)}if(sn(i)||mc(i))return n(t,e=e.get(r)||null,i,a,null);mg(t,i)}return null}function rb(e,t,n,i){for(var a=null,o=null,s=t,u=t=0,l=null;null!==s&&u<n.length;u++){s.index>u?(l=s,s=null):l=s.sibling;var h=x(e,s,n[u],i);if(null===h){null===s&&(s=l);break}r&&s&&null===h.alternate&&b(e,s),t=f(h,t,u),null===o?a=h:o.sibling=h,o=h,s=l}if(u===n.length)return c(e,s),a;if(null===s){for(;u<n.length;u++)null!==(s=z(e,n[u],i))&&(t=f(s,t,u),null===o?a=s:o.sibling=s,o=s);return a}for(s=d(e,s);u<n.length;u++)null!==(l=v(s,e,u,n[u],i))&&(r&&null!==l.alternate&&s.delete(null===l.key?u:l.key),t=f(l,t,u),null===o?a=l:o.sibling=l,o=l);return r&&s.forEach((function(t){return b(e,t)})),a}function Be(e,n,i,a){var o=mc(i);if("function"!==typeof o)throw t(Error(150));if(null==(i=o.call(i)))throw t(Error(151));for(var s=o=null,u=n,l=n=0,h=null,p=i.next();null!==u&&!p.done;l++,p=i.next()){u.index>l?(h=u,u=null):h=u.sibling;var g=x(e,u,p.value,a);if(null===g){null===u&&(u=h);break}r&&u&&null===g.alternate&&b(e,u),n=f(g,n,l),null===s?o=g:s.sibling=g,s=g,u=h}if(p.done)return c(e,u),o;if(null===u){for(;!p.done;l++,p=i.next())null!==(p=z(e,p.value,a))&&(n=f(p,n,l),null===s?o=p:s.sibling=p,s=p);return o}for(u=d(e,u);!p.done;l++,p=i.next())null!==(p=v(u,e,l,p.value,a))&&(r&&null!==p.alternate&&u.delete(null===p.key?l:p.key),n=f(p,n,l),null===s?o=p:s.sibling=p,s=p);return r&&u.forEach((function(t){return b(e,t)})),o}return function(r,n,i,a){var o="object"===typeof i&&null!==i&&i.type===at&&null===i.key;o&&(i=i.props.children);var s="object"===typeof i&&null!==i;if(s)switch(i.$$typeof){case nt:e:{for(s=i.key,o=n;null!==o;){if(o.key===s){if(7===o.tag?i.type===at:o.elementType===i.type){c(r,o.sibling),(n=e(o,i.type===at?i.props.children:i.props)).ref=lg(r,o,i),n.return=r,r=n;break e}c(r,o);break}b(r,o),o=o.sibling}i.type===at?((n=sg(i.props.children,r.mode,a,i.key)).return=r,r=n):((a=qg(i.type,i.key,i.props,null,r.mode,a)).ref=lg(r,n,i),a.return=r,r=a)}return h(r);case it:e:{for(o=i.key;null!==n;){if(n.key===o){if(4===n.tag&&n.stateNode.containerInfo===i.containerInfo&&n.stateNode.implementation===i.implementation){c(r,n.sibling),(n=e(n,i.children||[])).return=r,r=n;break e}c(r,n);break}b(r,n),n=n.sibling}(n=rg(i,r.mode,a)).return=r,r=n}return h(r)}if("string"===typeof i||"number"===typeof i)return i=""+i,null!==n&&6===n.tag?(c(r,n.sibling),(n=e(n,i)).return=r,r=n):(c(r,n),(n=pg(i,r.mode,a)).return=r,r=n),h(r);if(sn(i))return rb(r,n,i,a);if(mc(i))return Be(r,n,i,a);if(s&&mg(r,i),"undefined"===typeof i&&!o)switch(r.tag){case 1:case 0:throw r=r.type,t(Error(152),r.displayName||r.name||"Component")}return c(r,n)}}var un=ng(!0),ln=ng(!1),cn={},fn={current:cn},dn={current:cn},hn={current:cn};function zg(e){if(e===cn)throw t(Error(174));return e}function Ag(e,t){J(hn,t),J(dn,e),J(fn,cn);var r=t.nodeType;switch(r){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:te(null,"");break;default:t=te(t=(r=8===r?t.parentNode:t).namespaceURI||null,r=r.tagName)}H(fn),J(fn,t)}function Bg(e){H(fn),H(dn),H(hn)}function Cg(e){zg(hn.current);var t=zg(fn.current),r=te(t,e.type);t!==r&&(J(dn,e),J(fn,r))}function Dg(e){dn.current===e&&(H(fn),H(dn))}var pn=1,gn=1,mn=2,vn={current:0};function Hg(e){for(var t=e;null!==t;){if(13===t.tag){if(null!==t.memoizedState)return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(64&t.effectTag))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var yn=0,_n=2,bn=4,xn=8,wn=16,kn=32,Sn=64,En=128,Cn=et.ReactCurrentDispatcher,Tn=0,On=null,An=null,Rn=null,Dn=null,Pn=null,jn=null,Mn=0,Fn=null,In=0,Ln=!1,Nn=null,Bn=0;function bh(){throw t(Error(321))}function ch(e,t){if(null===t)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!hd(e[r],t[r]))return!1;return!0}function dh(e,r,n,i,a,o){if(Tn=o,On=r,Rn=null!==e?e.memoizedState:null,Cn.current=null===Rn?zn:qn,r=n(i,a),Ln){do{Ln=!1,Bn+=1,Rn=null!==e?e.memoizedState:null,jn=Dn,Fn=Pn=An=null,Cn.current=qn,r=n(i,a)}while(Ln);Nn=null,Bn=0}if(Cn.current=Un,(e=On).memoizedState=Dn,e.expirationTime=Mn,e.updateQueue=Fn,e.effectTag|=In,e=null!==An&&null!==An.next,Tn=0,jn=Pn=Dn=Rn=An=On=null,Mn=0,Fn=null,In=0,e)throw t(Error(300));return r}function ih(){Cn.current=Un,Tn=0,jn=Pn=Dn=Rn=An=On=null,Mn=0,Fn=null,In=0,Ln=!1,Nn=null,Bn=0}function jh(){var e={memoizedState:null,baseState:null,queue:null,baseUpdate:null,next:null};return null===Pn?Dn=Pn=e:Pn=Pn.next=e,Pn}function kh(){if(null!==jn)jn=(Pn=jn).next,Rn=null!==(An=Rn)?An.next:null;else{if(null===Rn)throw t(Error(310));var e={memoizedState:(An=Rn).memoizedState,baseState:An.baseState,queue:An.queue,baseUpdate:An.baseUpdate,next:null};Pn=null===Pn?Dn=e:Pn.next=e,Rn=An.next}return Pn}function lh(e,t){return"function"===typeof t?t(e):t}function mh(e){var r=kh(),n=r.queue;if(null===n)throw t(Error(311));if(n.lastRenderedReducer=e,0<Bn){var i=n.dispatch;if(null!==Nn){var a=Nn.get(n);if(void 0!==a){Nn.delete(n);var o=r.memoizedState;do{o=e(o,a.action),a=a.next}while(null!==a);return hd(o,r.memoizedState)||(Yn=!0),r.memoizedState=o,r.baseUpdate===n.last&&(r.baseState=o),n.lastRenderedState=o,[o,i]}}return[r.memoizedState,i]}i=n.last;var s=r.baseUpdate;if(o=r.baseState,null!==s?(null!==i&&(i.next=null),i=s.next):i=null!==i?i.next:null,null!==i){var u=a=null,l=i,c=!1;do{var f=l.expirationTime;f<Tn?(c||(c=!0,u=s,a=o),f>Mn&&(Mn=f)):(Xf(f,l.suspenseConfig),o=l.eagerReducer===e?l.eagerState:e(o,l.action)),s=l,l=l.next}while(null!==l&&l!==i);c||(u=s,a=o),hd(o,r.memoizedState)||(Yn=!0),r.memoizedState=o,r.baseUpdate=u,r.baseState=a,n.lastRenderedState=o}return[r.memoizedState,n.dispatch]}function nh(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},null===Fn?(Fn={lastEffect:null}).lastEffect=e.next=e:null===(t=Fn.lastEffect)?Fn.lastEffect=e.next=e:(r=t.next,t.next=e,e.next=r,Fn.lastEffect=e),e}function oh(e,t,r,n){var i=jh();In|=e,i.memoizedState=nh(t,r,void 0,void 0===n?null:n)}function ph(e,t,r,n){var i=kh();n=void 0===n?null:n;var a=void 0;if(null!==An){var o=An.memoizedState;if(a=o.destroy,null!==n&&ch(n,o.deps))return void nh(yn,r,a,n)}In|=e,i.memoizedState=nh(t,r,a,n)}function qh(e,t){return"function"===typeof t?(e=e(),t(e),function(){t(null)}):null!==t&&void 0!==t?(e=e(),t.current=e,function(){t.current=null}):void 0}function rh(){}function sh(e,r,n){if(!(25>Bn))throw t(Error(301));var i=e.alternate;if(e===On||null!==i&&i===On)if(Ln=!0,e={expirationTime:Tn,suspenseConfig:null,action:n,eagerReducer:null,eagerState:null,next:null},null===Nn&&(Nn=new Map),void 0===(n=Nn.get(r)))Nn.set(r,e);else{for(r=n;null!==r.next;)r=r.next;r.next=e}else{var a=cg(),o=nn.suspense;o={expirationTime:a=dg(a,e,o),suspenseConfig:o,action:n,eagerReducer:null,eagerState:null,next:null};var s=r.last;if(null===s)o.next=o;else{var u=s.next;null!==u&&(o.next=u),s.next=o}if(r.last=o,0===e.expirationTime&&(null===i||0===i.expirationTime)&&null!==(i=r.lastRenderedReducer))try{var l=r.lastRenderedState,c=i(l,n);if(o.eagerReducer=i,o.eagerState=c,hd(c,l))return}catch(f){}eg(e,a)}}var Un={readContext:Mf,useCallback:bh,useContext:bh,useEffect:bh,useImperativeHandle:bh,useLayoutEffect:bh,useMemo:bh,useReducer:bh,useRef:bh,useState:bh,useDebugValue:bh,useResponder:bh},zn={readContext:Mf,useCallback:function useCallback(e,t){return jh().memoizedState=[e,void 0===t?null:t],e},useContext:Mf,useEffect:function useEffect(e,t){return oh(516,En|Sn,e,t)},useImperativeHandle:function useImperativeHandle(e,t,r){return r=null!==r&&void 0!==r?r.concat([e]):null,oh(4,bn|kn,qh.bind(null,t,e),r)},useLayoutEffect:function useLayoutEffect(e,t){return oh(4,bn|kn,e,t)},useMemo:function useMemo(e,t){var r=jh();return t=void 0===t?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function useReducer(e,t,r){var n=jh();return t=void 0!==r?r(t):t,n.memoizedState=n.baseState=t,e=(e=n.queue={last:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=sh.bind(null,On,e),[n.memoizedState,e]},useRef:function useRef(e){return e={current:e},jh().memoizedState=e},useState:function useState(e){var t=jh();return"function"===typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={last:null,dispatch:null,lastRenderedReducer:lh,lastRenderedState:e}).dispatch=sh.bind(null,On,e),[t.memoizedState,e]},useDebugValue:rh,useResponder:kd},qn={readContext:Mf,useCallback:function useCallback(e,t){var r=kh();t=void 0===t?null:t;var n=r.memoizedState;return null!==n&&null!==t&&ch(t,n[1])?n[0]:(r.memoizedState=[e,t],e)},useContext:Mf,useEffect:function useEffect(e,t){return ph(516,En|Sn,e,t)},useImperativeHandle:function useImperativeHandle(e,t,r){return r=null!==r&&void 0!==r?r.concat([e]):null,ph(4,bn|kn,qh.bind(null,t,e),r)},useLayoutEffect:function useLayoutEffect(e,t){return ph(4,bn|kn,e,t)},useMemo:function useMemo(e,t){var r=kh();t=void 0===t?null:t;var n=r.memoizedState;return null!==n&&null!==t&&ch(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)},useReducer:mh,useRef:function useRef(){return kh().memoizedState},useState:function useState(e){return mh(lh)},useDebugValue:rh,useResponder:kd},Wn=null,Gn=null,Hn=!1;function wh(e,t){var r=xh(5,null,null,0);r.elementType="DELETED",r.type="DELETED",r.stateNode=t,r.return=e,r.effectTag=8,null!==e.lastEffect?(e.lastEffect.nextEffect=r,e.lastEffect=r):e.firstEffect=e.lastEffect=r}function yh(e,t){switch(e.tag){case 5:var r=e.type;return null!==(t=1!==t.nodeType||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);case 13:default:return!1}}function zh(e){if(Hn){var t=Gn;if(t){var r=t;if(!yh(e,t)){if(!(t=Ne(r.nextSibling))||!yh(e,t))return e.effectTag|=2,Hn=!1,void(Wn=e);wh(Wn,r)}Wn=e,Gn=Ne(t.firstChild)}else e.effectTag|=2,Hn=!1,Wn=e}}function Ah(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&18!==e.tag;)e=e.return;Wn=e}function Bh(e){if(e!==Wn)return!1;if(!Hn)return Ah(e),Hn=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!Ke(t,e.memoizedProps))for(t=Gn;t;)wh(e,t),t=Ne(t.nextSibling);return Ah(e),Gn=Wn?Ne(e.stateNode.nextSibling):null,!0}function Ch(){Gn=Wn=null,Hn=!1}var Vn=et.ReactCurrentOwner,Yn=!1;function S(e,t,r,n){t.child=null===e?ln(t,null,r,n):un(t,e.child,r,n)}function Eh(e,t,r,n,i){r=r.render;var a=t.ref;return Kf(t,i),n=dh(e,t,r,n,a,i),null===e||Yn?(t.effectTag|=1,S(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=i&&(e.expirationTime=0),Fh(e,t,i))}function Gh(e,t,r,n,i,a){if(null===e){var o=r.type;return"function"!==typeof o||Hh(o)||void 0!==o.defaultProps||null!==r.compare||void 0!==r.defaultProps?((e=qg(r.type,null,n,null,t.mode,a)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,Ih(e,t,o,n,i,a))}return o=e.child,i<a&&(i=o.memoizedProps,(r=null!==(r=r.compare)?r:jd)(i,n)&&e.ref===t.ref)?Fh(e,t,a):(t.effectTag|=1,(e=og(o,n)).ref=t.ref,e.return=t,t.child=e)}function Ih(e,t,r,n,i,a){return null!==e&&jd(e.memoizedProps,n)&&e.ref===t.ref&&(Yn=!1,i<a)?Fh(e,t,a):Jh(e,t,r,n,a)}function Kh(e,t){var r=t.ref;(null===e&&null!==r||null!==e&&e.ref!==r)&&(t.effectTag|=128)}function Jh(e,t,r,n,i){var a=N(r)?Pr:Rr.current;return a=Se(t,a),Kf(t,i),r=dh(e,t,r,n,a,i),null===e||Yn?(t.effectTag|=1,S(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=i&&(e.expirationTime=0),Fh(e,t,i))}function Lh(e,t,r,n,i){if(N(r)){var a=!0;Xe(t)}else a=!1;if(Kf(t,i),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),hg(t,r,n),jg(t,r,n,i),n=!0;else if(null===e){var o=t.stateNode,s=t.memoizedProps;o.props=s;var u=o.context,l=r.contextType;"object"===typeof l&&null!==l?l=Mf(l):l=Se(t,l=N(r)?Pr:Rr.current);var c=r.getDerivedStateFromProps,f="function"===typeof c||"function"===typeof o.getSnapshotBeforeUpdate;f||"function"!==typeof o.UNSAFE_componentWillReceiveProps&&"function"!==typeof o.componentWillReceiveProps||(s!==n||u!==l)&&ig(t,o,n,l),rn=!1;var d=t.memoizedState;u=o.state=d;var h=t.updateQueue;null!==h&&(Wf(t,h,n,o,i),u=t.memoizedState),s!==n||d!==u||Dr.current||rn?("function"===typeof c&&(bg(t,r,c,n),u=t.memoizedState),(s=rn||gg(t,r,s,n,d,u,l))?(f||"function"!==typeof o.UNSAFE_componentWillMount&&"function"!==typeof o.componentWillMount||("function"===typeof o.componentWillMount&&o.componentWillMount(),"function"===typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"===typeof o.componentDidMount&&(t.effectTag|=4)):("function"===typeof o.componentDidMount&&(t.effectTag|=4),t.memoizedProps=n,t.memoizedState=u),o.props=n,o.state=u,o.context=l,n=s):("function"===typeof o.componentDidMount&&(t.effectTag|=4),n=!1)}else o=t.stateNode,s=t.memoizedProps,o.props=t.type===t.elementType?s:Af(t.type,s),u=o.context,"object"===typeof(l=r.contextType)&&null!==l?l=Mf(l):l=Se(t,l=N(r)?Pr:Rr.current),(f="function"===typeof(c=r.getDerivedStateFromProps)||"function"===typeof o.getSnapshotBeforeUpdate)||"function"!==typeof o.UNSAFE_componentWillReceiveProps&&"function"!==typeof o.componentWillReceiveProps||(s!==n||u!==l)&&ig(t,o,n,l),rn=!1,u=t.memoizedState,d=o.state=u,null!==(h=t.updateQueue)&&(Wf(t,h,n,o,i),d=t.memoizedState),s!==n||u!==d||Dr.current||rn?("function"===typeof c&&(bg(t,r,c,n),d=t.memoizedState),(c=rn||gg(t,r,s,n,u,d,l))?(f||"function"!==typeof o.UNSAFE_componentWillUpdate&&"function"!==typeof o.componentWillUpdate||("function"===typeof o.componentWillUpdate&&o.componentWillUpdate(n,d,l),"function"===typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(n,d,l)),"function"===typeof o.componentDidUpdate&&(t.effectTag|=4),"function"===typeof o.getSnapshotBeforeUpdate&&(t.effectTag|=256)):("function"!==typeof o.componentDidUpdate||s===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=4),"function"!==typeof o.getSnapshotBeforeUpdate||s===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=256),t.memoizedProps=n,t.memoizedState=d),o.props=n,o.state=d,o.context=l,n=c):("function"!==typeof o.componentDidUpdate||s===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=4),"function"!==typeof o.getSnapshotBeforeUpdate||s===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=256),n=!1);return Mh(e,t,r,n,a,i)}function Mh(e,t,r,n,i,a){Kh(e,t);var o=0!==(64&t.effectTag);if(!n&&!o)return i&&Ye(t,r,!1),Fh(e,t,a);n=t.stateNode,Vn.current=t;var s=o&&"function"!==typeof r.getDerivedStateFromError?null:n.render();return t.effectTag|=1,null!==e&&o?(t.child=un(t,e.child,null,a),t.child=un(t,null,s,a)):S(e,t,s,a),t.memoizedState=n.state,i&&Ye(t,r,!0),t.child}function Nh(e){var t=e.stateNode;t.pendingContext?Ve(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Ve(0,t.context,!1),Ag(e,t.containerInfo)}var $n={};function Ph(e,t,r){var n,i=t.mode,a=t.pendingProps,o=vn.current,s=null,u=!1;if((n=0!==(64&t.effectTag))||(n=0!==(o&mn)&&(null===e||null!==e.memoizedState)),n?(s=$n,u=!0,t.effectTag&=-65):null!==e&&null===e.memoizedState||void 0===a.fallback||!0===a.unstable_avoidThisFallback||(o|=gn),J(vn,o&=pn),null===e)if(u){if(a=a.fallback,(e=sg(null,i,0,null)).return=t,0===(2&t.mode))for(u=null!==t.memoizedState?t.child.child:t.child,e.child=u;null!==u;)u.return=e,u=u.sibling;(r=sg(a,i,r,null)).return=t,e.sibling=r,i=e}else i=r=ln(t,null,a.children,r);else{if(null!==e.memoizedState)if(i=(o=e.child).sibling,u){if(a=a.fallback,(r=og(o,o.pendingProps)).return=t,0===(2&t.mode)&&(u=null!==t.memoizedState?t.child.child:t.child)!==o.child)for(r.child=u;null!==u;)u.return=r,u=u.sibling;(a=og(i,a,i.expirationTime)).return=t,r.sibling=a,i=r,r.childExpirationTime=0,r=a}else i=r=un(t,o.child,a.children,r);else if(o=e.child,u){if(u=a.fallback,(a=sg(null,i,0,null)).return=t,a.child=o,null!==o&&(o.return=a),0===(2&t.mode))for(o=null!==t.memoizedState?t.child.child:t.child,a.child=o;null!==o;)o.return=a,o=o.sibling;(r=sg(u,i,r,null)).return=t,a.sibling=r,r.effectTag|=2,i=a,a.childExpirationTime=0}else r=i=un(t,o,a.children,r);t.stateNode=e.stateNode}return t.memoizedState=s,t.child=i,r}function Qh(e,t,r,n,i){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,last:n,tail:r,tailExpiration:0,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.last=n,a.tail=r,a.tailExpiration=0,a.tailMode=i)}function Rh(e,t,r){var n=t.pendingProps,i=n.revealOrder,a=n.tail;if(S(e,t,n.children,r),0!==((n=vn.current)&mn))n=n&pn|mn,t.effectTag|=64;else{if(null!==e&&0!==(64&e.effectTag))e:for(e=t.child;null!==e;){if(13===e.tag){if(null!==e.memoizedState){e.expirationTime<r&&(e.expirationTime=r);var o=e.alternate;null!==o&&o.expirationTime<r&&(o.expirationTime=r),Jf(e.return,r)}}else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=pn}if(J(vn,n),0===(2&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(r=t.child,i=null;null!==r;)null!==(n=r.alternate)&&null===Hg(n)&&(i=r),r=r.sibling;null===(r=i)?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),Qh(t,!1,i,r,a);break;case"backwards":for(r=null,i=t.child,t.child=null;null!==i;){if(null!==(n=i.alternate)&&null===Hg(n)){t.child=i;break}n=i.sibling,i.sibling=r,r=i,i=n}Qh(t,!0,r,null,a);break;case"together":Qh(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Fh(e,r,n){if(null!==e&&(r.dependencies=e.dependencies),r.childExpirationTime<n)return null;if(null!==e&&r.child!==e.child)throw t(Error(153));if(null!==r.child){for(n=og(e=r.child,e.pendingProps,e.expirationTime),r.child=n,n.return=r;null!==e.sibling;)e=e.sibling,(n=n.sibling=og(e,e.pendingProps,e.expirationTime)).return=r;n.sibling=null}return r.child}function Sh(e){e.effectTag|=4}var Xn=void 0,Kn=void 0,Jn=void 0,Qn=void 0;function $h(e,t){switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;null!==t;)null!==t.alternate&&(r=t),t=t.sibling;null===r?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;null!==r;)null!==r.alternate&&(n=r),r=r.sibling;null===n?t||null===e.tail?e.tail=null:e.tail.sibling=null:n.sibling=null}}function ai(e){switch(e.tag){case 1:N(e.type)&&Te();var r=e.effectTag;return 2048&r?(e.effectTag=-2049&r|64,e):null;case 3:if(Bg(),Ue(),0!==(64&(r=e.effectTag)))throw t(Error(285));return e.effectTag=-2049&r|64,e;case 5:return Dg(e),null;case 13:return H(vn),2048&(r=e.effectTag)?(e.effectTag=-2049&r|64,e):null;case 18:return null;case 19:return H(vn),null;case 4:return Bg(),null;case 10:return If(e),null;default:return null}}function bi(e,t){return{value:e,source:t,stack:pc(t)}}Xn=function Th(e,t){for(var r=t.child;null!==r;){if(5===r.tag||6===r.tag)e.appendChild(r.stateNode);else if(20===r.tag)e.appendChild(r.stateNode.instance);else if(4!==r.tag&&null!==r.child){r.child.return=r,r=r.child;continue}if(r===t)break;for(;null===r.sibling;){if(null===r.return||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}},Kn=function Uh(){},Jn=function Vh(e,t,r,n,i){var a=e.memoizedProps;if(a!==n){var o=t.stateNode;switch(zg(fn.current),e=null,r){case"input":a=Bc(o,a),n=Bc(o,n),e=[];break;case"option":a=le(o,a),n=le(o,n),e=[];break;case"select":a=s({},a,{value:void 0}),n=s({},n,{value:void 0}),e=[];break;case"textarea":a=ne(o,a),n=ne(o,n),e=[];break;default:"function"!==typeof a.onClick&&"function"===typeof n.onClick&&(o.onclick=Ge)}De(r,n),o=r=void 0;var u=null;for(r in a)if(!n.hasOwnProperty(r)&&a.hasOwnProperty(r)&&null!=a[r])if("style"===r){var l=a[r];for(o in l)l.hasOwnProperty(o)&&(u||(u={}),u[o]="")}else"dangerouslySetInnerHTML"!==r&&"children"!==r&&"suppressContentEditableWarning"!==r&&"suppressHydrationWarning"!==r&&"autoFocus"!==r&&(E.hasOwnProperty(r)?e||(e=[]):(e=e||[]).push(r,null));for(r in n){var c=n[r];if(l=null!=a?a[r]:void 0,n.hasOwnProperty(r)&&c!==l&&(null!=c||null!=l))if("style"===r)if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(u||(u={}),u[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(u||(u={}),u[o]=c[o])}else u||(e||(e=[]),e.push(r,u)),u=c;else"dangerouslySetInnerHTML"===r?(c=c?c.__html:void 0,l=l?l.__html:void 0,null!=c&&l!==c&&(e=e||[]).push(r,""+c)):"children"===r?l===c||"string"!==typeof c&&"number"!==typeof c||(e=e||[]).push(r,""+c):"suppressContentEditableWarning"!==r&&"suppressHydrationWarning"!==r&&(E.hasOwnProperty(r)?(null!=c&&Fe(i,r),e||l===c||(e=[])):(e=e||[]).push(r,c))}u&&(e=e||[]).push("style",u),i=e,(t.updateQueue=i)&&Sh(t)}},Qn=function Wh(e,t,r,n){r!==n&&Sh(t)};var Zn="function"===typeof WeakSet?WeakSet:Set;function di(e,t){var r=t.source,n=t.stack;null===n&&null!==r&&(n=pc(r)),null!==r&&oc(r.type),t=t.value,null!==e&&1===e.tag&&oc(e.type);try{console.error(t)}catch(i){setTimeout((function(){throw i}))}}function gi(e){var t=e.ref;if(null!==t)if("function"===typeof t)try{t(null)}catch(r){fi(e,r)}else t.current=null}function hi(e,t,r){if(null!==(r=null!==(r=r.updateQueue)?r.lastEffect:null)){var n=r=r.next;do{if((n.tag&e)!==yn){var i=n.destroy;n.destroy=void 0,void 0!==i&&i()}(n.tag&t)!==yn&&(i=n.create,n.destroy=i()),n=n.next}while(n!==r)}}function ii(e,t){switch("function"===typeof oa&&oa(e),e.tag){case 0:case 11:case 14:case 15:var r=e.updateQueue;if(null!==r&&null!==(r=r.lastEffect)){var n=r.next;vf(97<t?97:t,(function(){var t=n;do{var r=t.destroy;if(void 0!==r){var i=e;try{r()}catch(a){fi(i,a)}}t=t.next}while(t!==n)}))}break;case 1:gi(e),"function"===typeof(t=e.stateNode).componentWillUnmount&&function ei(e,t){try{t.props=e.memoizedProps,t.state=e.memoizedState,t.componentWillUnmount()}catch(r){fi(e,r)}}(e,t);break;case 5:gi(e);break;case 4:ki(e,t)}}function li(e,t){for(var r=e;;)if(ii(r,t),null!==r.child&&4!==r.tag)r.child.return=r,r=r.child;else{if(r===e)break;for(;null===r.sibling;){if(null===r.return||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}}function mi(e){return 5===e.tag||3===e.tag||4===e.tag}function ni(e){e:{for(var r=e.return;null!==r;){if(mi(r)){var n=r;break e}r=r.return}throw t(Error(160))}switch(r=n.stateNode,n.tag){case 5:var i=!1;break;case 3:case 4:r=r.containerInfo,i=!0;break;default:throw t(Error(161))}16&n.effectTag&&(we(r,""),n.effectTag&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||mi(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.effectTag)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.effectTag)){n=n.stateNode;break e}}for(var a=e;;){var o=5===a.tag||6===a.tag;if(o||20===a.tag){var s=o?a.stateNode:a.stateNode.instance;if(n)if(i){var u=s;s=n,8===(o=r).nodeType?o.parentNode.insertBefore(u,s):o.insertBefore(u,s)}else r.insertBefore(s,n);else i?(8===(u=r).nodeType?(o=u.parentNode).insertBefore(s,u):(o=u).appendChild(s),null!==(u=u._reactRootContainer)&&void 0!==u||null!==o.onclick||(o.onclick=Ge)):r.appendChild(s)}else if(4!==a.tag&&null!==a.child){a.child.return=a,a=a.child;continue}if(a===e)break;for(;null===a.sibling;){if(null===a.return||a.return===e)return;a=a.return}a.sibling.return=a.return,a=a.sibling}}function ki(e,r){for(var n=e,i=!1,a=void 0,o=void 0;;){if(!i){i=n.return;e:for(;;){if(null===i)throw t(Error(160));switch(a=i.stateNode,i.tag){case 5:o=!1;break e;case 3:case 4:a=a.containerInfo,o=!0;break e}i=i.return}i=!0}if(5===n.tag||6===n.tag)if(li(n,r),o){var s=a,u=n.stateNode;8===s.nodeType?s.parentNode.removeChild(u):s.removeChild(u)}else a.removeChild(n.stateNode);else if(20===n.tag)u=n.stateNode.instance,li(n,r),o?8===(s=a).nodeType?s.parentNode.removeChild(u):s.removeChild(u):a.removeChild(u);else if(4===n.tag){if(null!==n.child){a=n.stateNode.containerInfo,o=!0,n.child.return=n,n=n.child;continue}}else if(ii(n,r),null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return;4===(n=n.return).tag&&(i=!1)}n.sibling.return=n.return,n=n.sibling}}function oi(e,r){switch(r.tag){case 0:case 11:case 14:case 15:hi(bn,xn,r);break;case 1:break;case 5:var n=r.stateNode;if(null!=n){var i=r.memoizedProps,a=null!==e?e.memoizedProps:i;e=r.type;var o=r.updateQueue;if(r.updateQueue=null,null!==o){for(n[W]=i,"input"===e&&"radio"===i.type&&null!=i.name&&Dc(n,i),Ee(e,a),r=Ee(e,i),a=0;a<o.length;a+=2){var s=o[a],u=o[a+1];"style"===s?Ae(n,u):"dangerouslySetInnerHTML"===s?_r(n,u):"children"===s?we(n,u):zc(n,s,u,r)}switch(e){case"input":Ec(n,i);break;case"textarea":pe(n,i);break;case"select":r=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!i.multiple,null!=(e=i.value)?me(n,!!i.multiple,e,!1):r!==!!i.multiple&&(null!=i.defaultValue?me(n,!!i.multiple,i.defaultValue,!0):me(n,!!i.multiple,i.multiple?[]:"",!1))}}}break;case 6:if(null===r.stateNode)throw t(Error(162));r.stateNode.nodeValue=r.memoizedProps;break;case 3:case 12:break;case 13:if(n=r,null===r.memoizedState?i=!1:(i=!0,n=r.child,Ni=Jr()),null!==n)e:for(e=n;;){if(5===e.tag)o=e.stateNode,i?"function"===typeof(o=o.style).setProperty?o.setProperty("display","none","important"):o.display="none":(o=e.stateNode,a=void 0!==(a=e.memoizedProps.style)&&null!==a&&a.hasOwnProperty("display")?a.display:null,o.style.display=ze("display",a));else if(6===e.tag)e.stateNode.nodeValue=i?"":e.memoizedProps;else{if(13===e.tag&&null!==e.memoizedState){(o=e.child.sibling).return=e,e=o;continue}if(null!==e.child){e.child.return=e,e=e.child;continue}}if(e===n)break e;for(;null===e.sibling;){if(null===e.return||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}qi(r);break;case 19:qi(r);break;case 17:case 20:break;default:throw t(Error(163))}}function qi(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var r=e.stateNode;null===r&&(r=e.stateNode=new Zn),t.forEach((function(t){var n=ri.bind(null,e,t);r.has(t)||(r.add(t),t.then(n,n))}))}}var si="function"===typeof WeakMap?WeakMap:Map;function ti(e,t,r){(r=Qf(r,null)).tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){zi||(zi=!0,Wi=n),di(e,t)},r}function wi(e,t,r){(r=Qf(r,null)).tag=3;var n=e.type.getDerivedStateFromError;if("function"===typeof n){var i=t.value;r.payload=function(){return di(e,t),n(i)}}var a=e.stateNode;return null!==a&&"function"===typeof a.componentDidCatch&&(r.callback=function(){"function"!==typeof n&&(null===Gi?Gi=new Set([this]):Gi.add(this),di(e,t));var r=t.stack;this.componentDidCatch(t.value,{componentStack:null!==r?r:""})}),r}var ui=Math.ceil,ci=et.ReactCurrentDispatcher,pi=et.ReactCurrentOwner,vi=0,yi=8,_i=16,xi=32,Si=0,Ei=1,Ci=2,Ti=3,Oi=4,Ai=vi,Ri=null,Di=null,Pi=0,ji=Si,Mi=1073741823,Fi=1073741823,Ii=null,Li=!1,Ni=0,Bi=500,Ui=null,zi=!1,Wi=null,Gi=null,Hi=!1,Vi=null,Xi=90,Ki=0,Ji=null,Qi=0,ea=null,ta=0;function cg(){return(Ai&(_i|xi))!==vi?1073741821-(Jr()/10|0):0!==ta?ta:ta=1073741821-(Jr()/10|0)}function dg(e,r,n){if(0===(2&(r=r.mode)))return 1073741823;var i=tf();if(0===(4&r))return 99===i?1073741823:1073741822;if((Ai&_i)!==vi)return Pi;if(null!==n)e=1073741821-25*(1+((1073741821-e+(0|n.timeoutMs||5e3)/10)/25|0));else switch(i){case 99:e=1073741823;break;case 98:e=1073741821-10*(1+((1073741821-e+15)/10|0));break;case 97:case 96:e=1073741821-25*(1+((1073741821-e+500)/25|0));break;case 95:e=1;break;default:throw t(Error(326))}return null!==Ri&&e===Pi&&--e,e}var na=0;function eg(e,r){if(50<Qi)throw Qi=0,ea=null,t(Error(185));if(null!==(e=Yi(e,r))){e.pingTime=0;var n=tf();if(1073741823===r)if((Ai&yi)!==vi&&(Ai&(_i|xi))===vi)for(var i=Z(e,1073741823,!0);null!==i;)i=i(!0);else Zi(e,99,1073741823),Ai===vi&&O();else Zi(e,n,r);(4&Ai)===vi||98!==n&&99!==n||(null===Ji?Ji=new Map([[e,r]]):(void 0===(n=Ji.get(e))||n>r)&&Ji.set(e,r))}}function Yi(e,t){e.expirationTime<t&&(e.expirationTime=t);var r=e.alternate;null!==r&&r.expirationTime<t&&(r.expirationTime=t);var n=e.return,i=null;if(null===n&&3===e.tag)i=e.stateNode;else for(;null!==n;){if(r=n.alternate,n.childExpirationTime<t&&(n.childExpirationTime=t),null!==r&&r.childExpirationTime<t&&(r.childExpirationTime=t),null===n.return&&3===n.tag){i=n.stateNode;break}n=n.return}return null!==i&&(t>i.firstPendingTime&&(i.firstPendingTime=t),0===(e=i.lastPendingTime)||t<e)&&(i.lastPendingTime=t),i}function Zi(e,t,r){if(e.callbackExpirationTime<r){var n=e.callbackNode;null!==n&&n!==Hr&&Fr(n),e.callbackExpirationTime=r,1073741823===r?e.callbackNode=xf($i.bind(null,e,Z.bind(null,e,r))):(n=null,1!==r&&(n={timeout:10*(1073741821-r)-Jr()}),e.callbackNode=wf(t,$i.bind(null,e,Z.bind(null,e,r)),n))}}function $i(e,t,r){var n=e.callbackNode,i=null;try{return null!==(i=t(r))?$i.bind(null,e,i):null}finally{null===i&&n===e.callbackNode&&(e.callbackNode=null,e.callbackExpirationTime=0)}}function aj(){(Ai&(1|_i|xi))===vi&&(function bj(){if(null!==Ji){var e=Ji;Ji=null,e.forEach((function(e,t){xf(Z.bind(null,t,e))})),O()}}(),cj())}function ej(e,t){var r=Ai;Ai|=1;try{return e(t)}finally{(Ai=r)===vi&&O()}}function fj(e,t,r,n){var i=Ai;Ai|=4;try{return vf(98,e.bind(null,t,r,n))}finally{(Ai=i)===vi&&O()}}function gj(e,t){var r=Ai;Ai&=-2,Ai|=yi;try{return e(t)}finally{(Ai=r)===vi&&O()}}function hj(e,t){e.finishedWork=null,e.finishedExpirationTime=0;var r=e.timeoutHandle;if(-1!==r&&(e.timeoutHandle=-1,Cr(r)),null!==Di)for(r=Di.return;null!==r;){var n=r;switch(n.tag){case 1:var i=n.type.childContextTypes;null!==i&&void 0!==i&&Te();break;case 3:Bg(),Ue();break;case 5:Dg(n);break;case 4:Bg();break;case 13:case 19:H(vn);break;case 10:If(n)}r=r.return}Ri=e,Di=og(e.current,null),Pi=t,ji=Si,Fi=Mi=1073741823,Ii=null,Li=!1}function Z(e,r,n){if((Ai&(_i|xi))!==vi)throw t(Error(327));if(e.firstPendingTime<r)return null;if(n&&e.finishedExpirationTime===r)return ij.bind(null,e);if(cj(),e!==Ri||r!==Pi)hj(e,r);else if(ji===Ti)if(Li)hj(e,r);else{var i=e.lastPendingTime;if(i<r)return Z.bind(null,e,i)}if(null!==Di){i=Ai,Ai|=_i;var a=ci.current;if(null===a&&(a=Un),ci.current=Un,n){if(1073741823!==r){var o=cg();if(o<r)return Ai=i,Gf(),ci.current=a,Z.bind(null,e,o)}}else ta=0;for(;;)try{if(n)for(;null!==Di;)Di=jj(Di);else for(;null!==Di&&!Ir();)Di=jj(Di);break}catch(g){if(Gf(),ih(),null===(o=Di)||null===o.return)throw hj(e,r),Ai=i,g;e:{var s=e,u=o.return,l=o,c=g,f=Pi;if(l.effectTag|=1024,l.firstEffect=l.lastEffect=null,null!==c&&"object"===typeof c&&"function"===typeof c.then){var d=c,h=0!==(vn.current&gn);c=u;do{var p;if((p=13===c.tag)&&(null!==c.memoizedState?p=!1:p=void 0!==(p=c.memoizedProps).fallback&&(!0!==p.unstable_avoidThisFallback||!h)),p){if(null===(u=c.updateQueue)?((u=new Set).add(d),c.updateQueue=u):u.add(d),0===(2&c.mode)){c.effectTag|=64,l.effectTag&=-1957,1===l.tag&&(null===l.alternate?l.tag=17:((f=Qf(1073741823,null)).tag=2,Sf(l,f))),l.expirationTime=1073741823;break e}l=s,s=f,null===(h=l.pingCache)?(h=l.pingCache=new si,u=new Set,h.set(d,u)):void 0===(u=h.get(d))&&(u=new Set,h.set(d,u)),u.has(s)||(u.add(s),l=kj.bind(null,l,d,s),d.then(l,l)),c.effectTag|=2048,c.expirationTime=f;break e}c=c.return}while(null!==c);c=Error((oc(l.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display."+pc(l))}ji!==Oi&&(ji=Ei),c=bi(c,l),l=u;do{switch(l.tag){case 3:l.effectTag|=2048,l.expirationTime=f,Tf(l,f=ti(l,c,f));break e;case 1:if(d=c,s=l.type,u=l.stateNode,0===(64&l.effectTag)&&("function"===typeof s.getDerivedStateFromError||null!==u&&"function"===typeof u.componentDidCatch&&(null===Gi||!Gi.has(u)))){l.effectTag|=2048,l.expirationTime=f,Tf(l,f=wi(l,d,f));break e}}l=l.return}while(null!==l)}Di=lj(o)}if(Ai=i,Gf(),ci.current=a,null!==Di)return Z.bind(null,e,r)}if(e.finishedWork=e.current.alternate,e.finishedExpirationTime=r,function dj(e,t){var r=e.firstBatch;return!!(null!==r&&r._defer&&r._expirationTime>=t)&&(wf(97,(function(){return r._onComplete(),null})),!0)}(e,r))return null;switch(Ri=null,ji){case Si:throw t(Error(328));case Ei:return(i=e.lastPendingTime)<r?Z.bind(null,e,i):n?ij.bind(null,e):(hj(e,r),xf(Z.bind(null,e,r)),null);case Ci:return 1073741823===Mi&&!n&&10<(n=Ni+Bi-Jr())?Li?(hj(e,r),Z.bind(null,e,r)):(i=e.lastPendingTime)<r?Z.bind(null,e,i):(e.timeoutHandle=Er(ij.bind(null,e),n),null):ij.bind(null,e);case Ti:if(!n){if(Li)return hj(e,r),Z.bind(null,e,r);if((n=e.lastPendingTime)<r)return Z.bind(null,e,n);if(1073741823!==Fi?n=10*(1073741821-Fi)-Jr():1073741823===Mi?n=0:(n=10*(1073741821-Mi)-5e3,0>(n=(i=Jr())-n)&&(n=0),(r=10*(1073741821-r)-i)<(n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*ui(n/1960))-n)&&(n=r)),10<n)return e.timeoutHandle=Er(ij.bind(null,e),n),null}return ij.bind(null,e);case Oi:return!n&&1073741823!==Mi&&null!==Ii&&(i=Mi,0>=(r=0|(a=Ii).busyMinDurationMs)?r=0:(n=0|a.busyDelayMs,r=(i=Jr()-(10*(1073741821-i)-(0|a.timeoutMs||5e3)))<=n?0:n+r-i),10<r)?(e.timeoutHandle=Er(ij.bind(null,e),r),null):ij.bind(null,e);default:throw t(Error(329))}}function Xf(e,t){e<Mi&&1<e&&(Mi=e),null!==t&&e<Fi&&1<e&&(Fi=e,Ii=t)}function jj(e){var t=ia(e.alternate,e,Pi);return e.memoizedProps=e.pendingProps,null===t&&(t=lj(e)),pi.current=null,t}function lj(e){Di=e;do{var r=Di.alternate;if(e=Di.return,0===(1024&Di.effectTag)){e:{var n=r,i=Pi,a=(r=Di).pendingProps;switch(r.tag){case 2:case 16:break;case 15:case 0:break;case 1:N(r.type)&&Te();break;case 3:Bg(),Ue(),(i=r.stateNode).pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),null!==n&&null!==n.child||(Bh(r),r.effectTag&=-3),Kn(r);break;case 5:Dg(r),i=zg(hn.current);var o=r.type;if(null!==n&&null!=r.stateNode)Jn(n,r,o,a,i),n.ref!==r.ref&&(r.effectTag|=128);else if(a){var u=zg(fn.current);if(Bh(r)){a=void 0,o=(n=r).stateNode;var l=n.type,c=n.memoizedProps;switch(o[q]=n,o[W]=c,l){case"iframe":case"object":case"embed":G("load",o);break;case"video":case"audio":for(var f=0;f<ue.length;f++)G(ue[f],o);break;case"source":G("error",o);break;case"img":case"image":case"link":G("error",o),G("load",o);break;case"form":G("reset",o),G("submit",o);break;case"details":G("toggle",o);break;case"input":Cc(o,c),G("invalid",o),Fe(i,"onChange");break;case"select":o._wrapperState={wasMultiple:!!c.multiple},G("invalid",o),Fe(i,"onChange");break;case"textarea":oe(o,c),G("invalid",o),Fe(i,"onChange")}for(a in De(l,c),f=null,c)c.hasOwnProperty(a)&&(u=c[a],"children"===a?"string"===typeof u?o.textContent!==u&&(f=["children",u]):"number"===typeof u&&o.textContent!==""+u&&(f=["children",""+u]):E.hasOwnProperty(a)&&null!=u&&Fe(i,a));switch(l){case"input":Vb(o),Gc(o,c,!0);break;case"textarea":Vb(o),qe(o);break;case"select":case"option":break;default:"function"===typeof c.onClick&&(o.onclick=Ge)}i=f,n.updateQueue=i,null!==i&&Sh(r)}else{c=o,n=a,l=r,f=9===i.nodeType?i:i.ownerDocument,u===vr.html&&(u=se(c)),u===vr.html?"script"===c?((c=f.createElement("div")).innerHTML="<script><\/script>",f=c.removeChild(c.firstChild)):"string"===typeof n.is?f=f.createElement(c,{is:n.is}):(f=f.createElement(c),"select"===c&&(c=f,n.multiple?c.multiple=!0:n.size&&(c.size=n.size))):f=f.createElementNS(u,c),(c=f)[q]=l,c[W]=n,Xn(n=c,r,!1,!1),l=n;var d=i,h=Ee(o,a);switch(o){case"iframe":case"object":case"embed":G("load",l),i=a;break;case"video":case"audio":for(i=0;i<ue.length;i++)G(ue[i],l);i=a;break;case"source":G("error",l),i=a;break;case"img":case"image":case"link":G("error",l),G("load",l),i=a;break;case"form":G("reset",l),G("submit",l),i=a;break;case"details":G("toggle",l),i=a;break;case"input":Cc(l,a),i=Bc(l,a),G("invalid",l),Fe(d,"onChange");break;case"option":i=le(l,a);break;case"select":l._wrapperState={wasMultiple:!!a.multiple},i=s({},a,{value:void 0}),G("invalid",l),Fe(d,"onChange");break;case"textarea":oe(l,a),i=ne(l,a),G("invalid",l),Fe(d,"onChange");break;default:i=a}De(o,i),c=void 0,f=o,u=l;var p=i;for(c in p)if(p.hasOwnProperty(c)){var g=p[c];"style"===c?Ae(u,g):"dangerouslySetInnerHTML"===c?null!=(g=g?g.__html:void 0)&&_r(u,g):"children"===c?"string"===typeof g?("textarea"!==f||""!==g)&&we(u,g):"number"===typeof g&&we(u,""+g):"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&"autoFocus"!==c&&(E.hasOwnProperty(c)?null!=g&&Fe(d,c):null!=g&&zc(u,c,g,h))}switch(o){case"input":Vb(l),Gc(l,a,!1);break;case"textarea":Vb(l),qe(l);break;case"option":null!=a.value&&l.setAttribute("value",""+Ac(a.value));break;case"select":i=l,l=a,i.multiple=!!l.multiple,null!=(c=l.value)?me(i,!!l.multiple,c,!1):null!=l.defaultValue&&me(i,!!l.multiple,l.defaultValue,!0);break;default:"function"===typeof i.onClick&&(l.onclick=Ge)}Je(o,a)&&Sh(r),r.stateNode=n}null!==r.ref&&(r.effectTag|=128)}else if(null===r.stateNode)throw t(Error(166));break;case 6:if(n&&null!=r.stateNode)Qn(n,r,n.memoizedProps,a);else{if("string"!==typeof a&&null===r.stateNode)throw t(Error(166));n=zg(hn.current),zg(fn.current),Bh(r)?(i=r.stateNode,n=r.memoizedProps,i[q]=r,i.nodeValue!==n&&Sh(r)):(i=r,(n=(9===n.nodeType?n:n.ownerDocument).createTextNode(a))[q]=r,i.stateNode=n)}break;case 11:break;case 13:if(H(vn),a=r.memoizedState,0!==(64&r.effectTag)){r.expirationTime=i;break e}i=null!==a,a=!1,null===n?Bh(r):(a=null!==(o=n.memoizedState),i||null===o||null!==(o=n.child.sibling)&&(null!==(l=r.firstEffect)?(r.firstEffect=o,o.nextEffect=l):(r.firstEffect=r.lastEffect=o,o.nextEffect=null),o.effectTag=8)),i&&!a&&0!==(2&r.mode)&&(null===n&&!0!==r.memoizedProps.unstable_avoidThisFallback||0!==(vn.current&gn)?ji===Si&&(ji=Ci):ji!==Si&&ji!==Ci||(ji=Ti)),(i||a)&&(r.effectTag|=4);break;case 7:case 8:case 12:break;case 4:Bg(),Kn(r);break;case 10:If(r);break;case 9:case 14:break;case 17:N(r.type)&&Te();break;case 18:break;case 19:if(H(vn),null===(a=r.memoizedState))break;if(o=0!==(64&r.effectTag),null===(l=a.rendering)){if(o)$h(a,!1);else if(ji!==Si||null!==n&&0!==(64&n.effectTag))for(n=r.child;null!==n;){if(null!==(l=Hg(n))){for(r.effectTag|=64,$h(a,!1),null!==(n=l.updateQueue)&&(r.updateQueue=n,r.effectTag|=4),r.firstEffect=r.lastEffect=null,n=r.child;null!==n;)o=i,(a=n).effectTag&=2,a.nextEffect=null,a.firstEffect=null,a.lastEffect=null,null===(l=a.alternate)?(a.childExpirationTime=0,a.expirationTime=o,a.child=null,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null):(a.childExpirationTime=l.childExpirationTime,a.expirationTime=l.expirationTime,a.child=l.child,a.memoizedProps=l.memoizedProps,a.memoizedState=l.memoizedState,a.updateQueue=l.updateQueue,o=l.dependencies,a.dependencies=null===o?null:{expirationTime:o.expirationTime,firstContext:o.firstContext,responders:o.responders}),n=n.sibling;J(vn,vn.current&pn|mn),r=r.child;break e}n=n.sibling}}else{if(!o)if(null!==(n=Hg(l))){if(r.effectTag|=64,o=!0,$h(a,!0),null===a.tail&&"hidden"===a.tailMode){null!==(i=n.updateQueue)&&(r.updateQueue=i,r.effectTag|=4),null!==(r=r.lastEffect=a.lastEffect)&&(r.nextEffect=null);break}}else Jr()>a.tailExpiration&&1<i&&(r.effectTag|=64,o=!0,$h(a,!1),r.expirationTime=r.childExpirationTime=i-1);a.isBackwards?(l.sibling=r.child,r.child=l):(null!==(i=a.last)?i.sibling=l:r.child=l,a.last=l)}if(null!==a.tail){0===a.tailExpiration&&(a.tailExpiration=Jr()+500),i=a.tail,a.rendering=i,a.tail=i.sibling,a.lastEffect=r.lastEffect,i.sibling=null,n=vn.current,J(vn,n=o?n&pn|mn:n&pn),r=i;break e}break;case 20:break;default:throw t(Error(156))}r=null}if(i=Di,1===Pi||1!==i.childExpirationTime){for(n=0,a=i.child;null!==a;)(o=a.expirationTime)>n&&(n=o),(l=a.childExpirationTime)>n&&(n=l),a=a.sibling;i.childExpirationTime=n}if(null!==r)return r;null!==e&&0===(1024&e.effectTag)&&(null===e.firstEffect&&(e.firstEffect=Di.firstEffect),null!==Di.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=Di.firstEffect),e.lastEffect=Di.lastEffect),1<Di.effectTag&&(null!==e.lastEffect?e.lastEffect.nextEffect=Di:e.firstEffect=Di,e.lastEffect=Di))}else{if(null!==(r=ai(Di)))return r.effectTag&=1023,r;null!==e&&(e.firstEffect=e.lastEffect=null,e.effectTag|=1024)}if(null!==(r=Di.sibling))return r;Di=e}while(null!==Di);return ji===Si&&(ji=Oi),null}function ij(e){var t=tf();return vf(99,nj.bind(null,e,t)),null!==Vi&&wf(97,(function(){return cj(),null})),null}function nj(e,r){if(cj(),(Ai&(_i|xi))!==vi)throw t(Error(327));var n=e.finishedWork,i=e.finishedExpirationTime;if(null===n)return null;if(e.finishedWork=null,e.finishedExpirationTime=0,n===e.current)throw t(Error(177));e.callbackNode=null,e.callbackExpirationTime=0;var a=n.expirationTime,o=n.childExpirationTime;if(a=o>a?o:a,e.firstPendingTime=a,a<e.lastPendingTime&&(e.lastPendingTime=a),e===Ri&&(Di=Ri=null,Pi=0),1<n.effectTag?null!==n.lastEffect?(n.lastEffect.nextEffect=n,a=n.firstEffect):a=n:a=n.firstEffect,null!==a){o=Ai,Ai|=xi,pi.current=null,kr=ur;var s=ae();if(be(s)){if("selectionStart"in s)var u={start:s.selectionStart,end:s.selectionEnd};else e:{var l=(u=(u=s.ownerDocument)&&u.defaultView||window).getSelection&&u.getSelection();if(l&&0!==l.rangeCount){u=l.anchorNode;var c=l.anchorOffset,f=l.focusNode;l=l.focusOffset;try{u.nodeType,f.nodeType}catch(U){u=null;break e}var d=0,h=-1,p=-1,g=0,m=0,v=s,y=null;t:for(;;){for(var _;v!==u||0!==c&&3!==v.nodeType||(h=d+c),v!==f||0!==l&&3!==v.nodeType||(p=d+l),3===v.nodeType&&(d+=v.nodeValue.length),null!==(_=v.firstChild);)y=v,v=_;for(;;){if(v===s)break t;if(y===u&&++g===c&&(h=d),y===f&&++m===l&&(p=d),null!==(_=v.nextSibling))break;y=(v=y).parentNode}v=_}u=-1===h||-1===p?null:{start:h,end:p}}else u=null}u=u||{start:0,end:0}}else u=null;Sr={focusedElem:s,selectionRange:u},ur=!1,Ui=a;do{try{for(;null!==Ui;){if(0!==(256&Ui.effectTag)){var b=Ui.alternate;switch((s=Ui).tag){case 0:case 11:case 15:hi(_n,yn,s);break;case 1:if(256&s.effectTag&&null!==b){var x=b.memoizedProps,w=b.memoizedState,k=s.stateNode,S=k.getSnapshotBeforeUpdate(s.elementType===s.type?x:Af(s.type,x),w);k.__reactInternalSnapshotBeforeUpdate=S}break;case 3:case 5:case 6:case 4:case 17:break;default:throw t(Error(163))}}Ui=Ui.nextEffect}}catch(U){if(null===Ui)throw t(Error(330));fi(Ui,U),Ui=Ui.nextEffect}}while(null!==Ui);Ui=a;do{try{for(b=r;null!==Ui;){var E=Ui.effectTag;if(16&E&&we(Ui.stateNode,""),128&E){var C=Ui.alternate;if(null!==C){var T=C.ref;null!==T&&("function"===typeof T?T(null):T.current=null)}}switch(14&E){case 2:ni(Ui),Ui.effectTag&=-3;break;case 6:ni(Ui),Ui.effectTag&=-3,oi(Ui.alternate,Ui);break;case 4:oi(Ui.alternate,Ui);break;case 8:ki(x=Ui,b),x.return=null,x.child=null,x.memoizedState=null,x.updateQueue=null,x.dependencies=null;var A=x.alternate;null!==A&&(A.return=null,A.child=null,A.memoizedState=null,A.updateQueue=null,A.dependencies=null)}Ui=Ui.nextEffect}}catch(U){if(null===Ui)throw t(Error(330));fi(Ui,U),Ui=Ui.nextEffect}}while(null!==Ui);if(T=Sr,C=ae(),E=T.focusedElem,b=T.selectionRange,C!==E&&E&&E.ownerDocument&&function $d(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?$d(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}(E.ownerDocument.documentElement,E)){null!==b&&be(E)&&(C=b.start,void 0===(T=b.end)&&(T=C),"selectionStart"in E?(E.selectionStart=C,E.selectionEnd=Math.min(T,E.value.length)):(T=(C=E.ownerDocument||document)&&C.defaultView||window).getSelection&&(T=T.getSelection(),x=E.textContent.length,A=Math.min(b.start,x),b=void 0===b.end?A:Math.min(b.end,x),!T.extend&&A>b&&(x=b,b=A,A=x),x=Zd(E,A),w=Zd(E,b),x&&w&&(1!==T.rangeCount||T.anchorNode!==x.node||T.anchorOffset!==x.offset||T.focusNode!==w.node||T.focusOffset!==w.offset)&&((C=C.createRange()).setStart(x.node,x.offset),T.removeAllRanges(),A>b?(T.addRange(C),T.extend(w.node,w.offset)):(C.setEnd(w.node,w.offset),T.addRange(C))))),C=[];for(T=E;T=T.parentNode;)1===T.nodeType&&C.push({element:T,left:T.scrollLeft,top:T.scrollTop});for("function"===typeof E.focus&&E.focus(),E=0;E<C.length;E++)(T=C[E]).element.scrollLeft=T.left,T.element.scrollTop=T.top}Sr=null,ur=!!kr,kr=null,e.current=n,Ui=a;do{try{for(E=i;null!==Ui;){var R=Ui.effectTag;if(36&R){var D=Ui.alternate;switch(T=E,(C=Ui).tag){case 0:case 11:case 15:hi(wn,kn,C);break;case 1:var P=C.stateNode;if(4&C.effectTag)if(null===D)P.componentDidMount();else{var j=C.elementType===C.type?D.memoizedProps:Af(C.type,D.memoizedProps);P.componentDidUpdate(j,D.memoizedState,P.__reactInternalSnapshotBeforeUpdate)}var M=C.updateQueue;null!==M&&Yf(0,M,P);break;case 3:var F=C.updateQueue;if(null!==F){if(A=null,null!==C.child)switch(C.child.tag){case 5:A=C.child.stateNode;break;case 1:A=C.child.stateNode}Yf(0,F,A)}break;case 5:var I=C.stateNode;null===D&&4&C.effectTag&&(T=I,Je(C.type,C.memoizedProps)&&T.focus());break;case 6:case 4:case 12:break;case 13:case 19:case 17:case 20:break;default:throw t(Error(163))}}if(128&R){var L=Ui.ref;if(null!==L){var N=Ui.stateNode;switch(Ui.tag){case 5:var B=N;break;default:B=N}"function"===typeof L?L(B):L.current=B}}512&R&&(Hi=!0),Ui=Ui.nextEffect}}catch(U){if(null===Ui)throw t(Error(330));fi(Ui,U),Ui=Ui.nextEffect}}while(null!==Ui);Ui=null,Vr(),Ai=o}else e.current=n;if(Hi)Hi=!1,Vi=e,Ki=i,Xi=r;else for(Ui=a;null!==Ui;)r=Ui.nextEffect,Ui.nextEffect=null,Ui=r;if(0!==(r=e.firstPendingTime)?Zi(e,R=zf(R=cg(),r),r):Gi=null,"function"===typeof aa&&aa(n.stateNode,i),1073741823===r?e===ea?Qi++:(Qi=0,ea=e):Qi=0,zi)throw zi=!1,e=Wi,Wi=null,e;return(Ai&yi)!==vi?null:(O(),null)}function cj(){if(null===Vi)return!1;var e=Vi,t=Ki,r=Xi;return Vi=null,Ki=0,Xi=90,vf(97<r?97:r,qj.bind(null,e,t))}function qj(e){if((Ai&(_i|xi))!==vi)throw t(Error(331));var r=Ai;for(Ai|=xi,e=e.current.firstEffect;null!==e;){try{var n=e;if(0!==(512&n.effectTag))switch(n.tag){case 0:case 11:case 15:hi(En,yn,n),hi(yn,Sn,n)}}catch(i){if(null===e)throw t(Error(330));fi(e,i)}n=e.nextEffect,e.nextEffect=null,e=n}return Ai=r,O(),!0}function rj(e,t,r){Sf(e,t=ti(e,t=bi(r,t),1073741823)),null!==(e=Yi(e,1073741823))&&Zi(e,99,1073741823)}function fi(e,t){if(3===e.tag)rj(e,e,t);else for(var r=e.return;null!==r;){if(3===r.tag){rj(r,e,t);break}if(1===r.tag){var n=r.stateNode;if("function"===typeof r.type.getDerivedStateFromError||"function"===typeof n.componentDidCatch&&(null===Gi||!Gi.has(n))){Sf(r,e=wi(r,e=bi(t,e),1073741823)),null!==(r=Yi(r,1073741823))&&Zi(r,99,1073741823);break}}r=r.return}}function kj(e,t,r){var n=e.pingCache;null!==n&&n.delete(t),Ri===e&&Pi===r?ji===Ti||ji===Ci&&1073741823===Mi&&Jr()-Ni<Bi?hj(e,Pi):Li=!0:e.lastPendingTime<r||(0!==(t=e.pingTime)&&t<r||(e.pingTime=r,e.finishedExpirationTime===r&&(e.finishedExpirationTime=0,e.finishedWork=null),Zi(e,t=zf(t=cg(),r),r)))}function ri(e,t){var r=e.stateNode;null!==r&&r.delete(t),r=zf(r=cg(),t=dg(r,e,null)),null!==(e=Yi(e,t))&&Zi(e,r,t)}var ia=void 0;ia=function mj(e,r,n){var i=r.expirationTime;if(null!==e){var a=r.pendingProps;if(e.memoizedProps!==a||Dr.current)Yn=!0;else if(i<n){switch(Yn=!1,r.tag){case 3:Nh(r),Ch();break;case 5:if(Cg(r),4&r.mode&&1!==n&&a.hidden)return r.expirationTime=r.childExpirationTime=1,null;break;case 1:N(r.type)&&Xe(r);break;case 4:Ag(r,r.stateNode.containerInfo);break;case 10:Hf(r,r.memoizedProps.value);break;case 13:if(null!==r.memoizedState)return 0!==(i=r.child.childExpirationTime)&&i>=n?Ph(e,r,n):(J(vn,vn.current&pn),null!==(r=Fh(e,r,n))?r.sibling:null);J(vn,vn.current&pn);break;case 19:if(i=r.childExpirationTime>=n,0!==(64&e.effectTag)){if(i)return Rh(e,r,n);r.effectTag|=64}if(null!==(a=r.memoizedState)&&(a.rendering=null,a.tail=null),J(vn,vn.current),!i)return null}return Fh(e,r,n)}}else Yn=!1;switch(r.expirationTime=0,r.tag){case 2:if(i=r.type,null!==e&&(e.alternate=null,r.alternate=null,r.effectTag|=2),e=r.pendingProps,a=Se(r,Rr.current),Kf(r,n),a=dh(null,r,i,e,a,n),r.effectTag|=1,"object"===typeof a&&null!==a&&"function"===typeof a.render&&void 0===a.$$typeof){if(r.tag=1,ih(),N(i)){var o=!0;Xe(r)}else o=!1;r.memoizedState=null!==a.state&&void 0!==a.state?a.state:null;var s=i.getDerivedStateFromProps;"function"===typeof s&&bg(r,i,s,e),a.updater=on,r.stateNode=a,a._reactInternalFiber=r,jg(r,i,e,n),r=Mh(null,r,i,!0,o,n)}else r.tag=0,S(null,r,a,n),r=r.child;return r;case 16:switch(a=r.elementType,null!==e&&(e.alternate=null,r.alternate=null,r.effectTag|=2),e=r.pendingProps,a=function Bf(e){var t=e._result;switch(e._status){case 1:return t;case 2:case 0:throw t;default:switch(e._status=0,(t=(t=e._ctor)()).then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)})),e._status){case 1:return e._result;case 2:throw e._result}throw e._result=t,t}}(a),r.type=a,o=r.tag=function sj(e){if("function"===typeof e)return Hh(e)?1:0;if(void 0!==e&&null!==e){if((e=e.$$typeof)===ft)return 11;if(e===pt)return 14}return 2}(a),e=Af(a,e),o){case 0:r=Jh(null,r,a,e,n);break;case 1:r=Lh(null,r,a,e,n);break;case 11:r=Eh(null,r,a,e,n);break;case 14:r=Gh(null,r,a,Af(a.type,e),i,n);break;default:throw t(Error(306),a,"")}return r;case 0:return i=r.type,a=r.pendingProps,Jh(e,r,i,a=r.elementType===i?a:Af(i,a),n);case 1:return i=r.type,a=r.pendingProps,Lh(e,r,i,a=r.elementType===i?a:Af(i,a),n);case 3:if(Nh(r),null===(i=r.updateQueue))throw t(Error(282));return a=null!==(a=r.memoizedState)?a.element:null,Wf(r,i,r.pendingProps,null,n),(i=r.memoizedState.element)===a?(Ch(),r=Fh(e,r,n)):(a=r.stateNode,(a=(null===e||null===e.child)&&a.hydrate)&&(Gn=Ne(r.stateNode.containerInfo.firstChild),Wn=r,a=Hn=!0),a?(r.effectTag|=2,r.child=ln(r,null,i,n)):(S(e,r,i,n),Ch()),r=r.child),r;case 5:return Cg(r),null===e&&zh(r),i=r.type,a=r.pendingProps,o=null!==e?e.memoizedProps:null,s=a.children,Ke(i,a)?s=null:null!==o&&Ke(i,o)&&(r.effectTag|=16),Kh(e,r),4&r.mode&&1!==n&&a.hidden?(r.expirationTime=r.childExpirationTime=1,r=null):(S(e,r,s,n),r=r.child),r;case 6:return null===e&&zh(r),null;case 13:return Ph(e,r,n);case 4:return Ag(r,r.stateNode.containerInfo),i=r.pendingProps,null===e?r.child=un(r,null,i,n):S(e,r,i,n),r.child;case 11:return i=r.type,a=r.pendingProps,Eh(e,r,i,a=r.elementType===i?a:Af(i,a),n);case 7:return S(e,r,r.pendingProps,n),r.child;case 8:case 12:return S(e,r,r.pendingProps.children,n),r.child;case 10:e:{if(i=r.type._context,a=r.pendingProps,s=r.memoizedProps,Hf(r,o=a.value),null!==s){var u=s.value;if(0===(o=hd(u,o)?0:0|("function"===typeof i._calculateChangedBits?i._calculateChangedBits(u,o):1073741823))){if(s.children===a.children&&!Dr.current){r=Fh(e,r,n);break e}}else for(null!==(u=r.child)&&(u.return=r);null!==u;){var l=u.dependencies;if(null!==l){s=u.child;for(var c=l.firstContext;null!==c;){if(c.context===i&&0!==(c.observedBits&o)){1===u.tag&&((c=Qf(n,null)).tag=2,Sf(u,c)),u.expirationTime<n&&(u.expirationTime=n),null!==(c=u.alternate)&&c.expirationTime<n&&(c.expirationTime=n),Jf(u.return,n),l.expirationTime<n&&(l.expirationTime=n);break}c=c.next}}else s=10===u.tag&&u.type===r.type?null:u.child;if(null!==s)s.return=u;else for(s=u;null!==s;){if(s===r){s=null;break}if(null!==(u=s.sibling)){u.return=s.return,s=u;break}s=s.return}u=s}}S(e,r,a.children,n),r=r.child}return r;case 9:return a=r.type,i=(o=r.pendingProps).children,Kf(r,n),i=i(a=Mf(a,o.unstable_observedBits)),r.effectTag|=1,S(e,r,i,n),r.child;case 14:return o=Af(a=r.type,r.pendingProps),Gh(e,r,a,o=Af(a.type,o),i,n);case 15:return Ih(e,r,r.type,r.pendingProps,i,n);case 17:return i=r.type,a=r.pendingProps,a=r.elementType===i?a:Af(i,a),null!==e&&(e.alternate=null,r.alternate=null,r.effectTag|=2),r.tag=1,N(i)?(e=!0,Xe(r)):e=!1,Kf(r,n),hg(r,i,a),jg(r,i,a,n),Mh(null,r,i,!0,e,n);case 19:return Rh(e,r,n)}throw t(Error(156))};var aa=null,oa=null;function uj(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childExpirationTime=this.expirationTime=0,this.alternate=null}function xh(e,t,r,n){return new uj(e,t,r,n)}function Hh(e){return!(!(e=e.prototype)||!e.isReactComponent)}function og(e,t){var r=e.alternate;return null===r?((r=xh(e.tag,t,e.key,e.mode)).elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.effectTag=0,r.nextEffect=null,r.firstEffect=null,r.lastEffect=null),r.childExpirationTime=e.childExpirationTime,r.expirationTime=e.expirationTime,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=null===t?null:{expirationTime:t.expirationTime,firstContext:t.firstContext,responders:t.responders},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function qg(e,r,n,i,a,o){var s=2;if(i=e,"function"===typeof e)Hh(e)&&(s=1);else if("string"===typeof e)s=5;else e:switch(e){case at:return sg(n.children,a,o,r);case ct:s=8,a|=7;break;case ot:s=8,a|=1;break;case st:return(e=xh(12,n,r,8|a)).elementType=st,e.type=st,e.expirationTime=o,e;case dt:return(e=xh(13,n,r,a)).type=dt,e.elementType=dt,e.expirationTime=o,e;case ht:return(e=xh(19,n,r,a)).elementType=ht,e.expirationTime=o,e;default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case ut:s=10;break e;case lt:s=9;break e;case ft:s=11;break e;case pt:s=14;break e;case gt:s=16,i=null;break e}throw t(Error(130),null==e?e:typeof e,"")}return(r=xh(s,n,r,a)).elementType=e,r.type=i,r.expirationTime=o,r}function sg(e,t,r,n){return(e=xh(7,e,n,t)).expirationTime=r,e}function pg(e,t,r){return(e=xh(6,e,null,t)).expirationTime=r,e}function rg(e,t,r){return(t=xh(4,null!==e.children?e.children:[],e.key,t)).expirationTime=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function vj(e,t,r){this.tag=t,this.current=null,this.containerInfo=e,this.pingCache=this.pendingChildren=null,this.finishedExpirationTime=0,this.finishedWork=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=r,this.callbackNode=this.firstBatch=null,this.pingTime=this.lastPendingTime=this.firstPendingTime=this.callbackExpirationTime=0}function wj(e,t,r){return e=new vj(e,t,r),t=xh(3,null,null,2===t?7:1===t?3:0),e.current=t,t.stateNode=e}function xj(e,r,n,i,a,o){var s=r.current;e:if(n){t:{if(2!==ld(n=n._reactInternalFiber)||1!==n.tag)throw t(Error(170));var u=n;do{switch(u.tag){case 3:u=u.stateNode.context;break t;case 1:if(N(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break t}}u=u.return}while(null!==u);throw t(Error(171))}if(1===n.tag){var l=n.type;if(N(l)){n=We(n,l,u);break e}}n=u}else n=Ar;return null===r.context?r.context=n:r.pendingContext=n,r=o,(a=Qf(i,a)).payload={element:e},null!==(r=void 0===r?null:r)&&(a.callback=r),Sf(s,a),eg(s,i),i}function yj(e,t,r,n){var i=t.current,a=cg(),o=nn.suspense;return xj(e,t,r,i=dg(a,i,o),o,n)}function zj(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 5:default:return e.child.stateNode}}function Bj(e){var t=1073741821-25*(1+((1073741821-cg()+500)/25|0));t<=na&&--t,this._expirationTime=na=t,this._root=e,this._callbacks=this._next=null,this._hasChildren=this._didComplete=!1,this._children=null,this._defer=!0}function Cj(){this._callbacks=null,this._didCommit=!1,this._onCommit=this._onCommit.bind(this)}function Dj(e,t,r){this._internalRoot=wj(e,t,r)}function Ej(e,t){this._internalRoot=wj(e,2,t)}function Hj(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Jj(t,r,n,i,a){var o=n._reactRootContainer,s=void 0;if(o){if(s=o._internalRoot,"function"===typeof a){var u=a;a=function e(){var t=zj(s);u.call(t)}}yj(r,s,t,a)}else{if(o=n._reactRootContainer=function Ij(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var r;r=e.lastChild;)e.removeChild(r);return new Dj(e,0,t)}(n,i),s=o._internalRoot,"function"===typeof a){var l=a;a=function e(){var t=zj(s);l.call(t)}}gj((function(){yj(r,s,t,a)}))}return zj(s)}function Kj(e,r){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Hj(r))throw t(Error(200));return function Aj(e,t,r){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:it,key:null==n?null:""+n,children:e,containerInfo:t,implementation:r}}(e,r,null,n)}Ie=function Db(e,r,n){switch(r){case"input":if(Ec(e,n),r=n.name,"radio"===n.type&&null!=r){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+r)+'][type="radio"]'),r=0;r<n.length;r++){var i=n[r];if(i!==e&&i.form===e.form){var a=Ka(i);if(!a)throw t(Error(90));Wb(i),Ec(i,a)}}}break;case"textarea":pe(e,n);break;case"select":null!=(r=n.value)&&me(e,!!n.multiple,r,!1)}},Bj.prototype.render=function(e){if(!this._defer)throw t(Error(250));this._hasChildren=!0,this._children=e;var r=this._root._internalRoot,n=this._expirationTime,i=new Cj;return xj(e,r,null,n,null,i._onCommit),i},Bj.prototype.then=function(e){if(this._didComplete)e();else{var t=this._callbacks;null===t&&(t=this._callbacks=[]),t.push(e)}},Bj.prototype.commit=function(){var e=this._root._internalRoot,r=e.firstBatch;if(!this._defer||null===r)throw t(Error(251));if(this._hasChildren){var n=this._expirationTime;if(r!==this){this._hasChildren&&(n=this._expirationTime=r._expirationTime,this.render(this._children));for(var i=null,a=r;a!==this;)i=a,a=a._next;if(null===i)throw t(Error(251));i._next=a._next,this._next=r,e.firstBatch=this}if(this._defer=!1,r=n,(Ai&(_i|xi))!==vi)throw t(Error(253));xf(Z.bind(null,e,r)),O(),r=this._next,this._next=null,null!==(r=e.firstBatch=r)&&r._hasChildren&&r.render(r._children)}else this._next=null,this._defer=!1},Bj.prototype._onComplete=function(){if(!this._didComplete){this._didComplete=!0;var e=this._callbacks;if(null!==e)for(var t=0;t<e.length;t++)(0,e[t])()}},Cj.prototype.then=function(e){if(this._didCommit)e();else{var t=this._callbacks;null===t&&(t=this._callbacks=[]),t.push(e)}},Cj.prototype._onCommit=function(){if(!this._didCommit){this._didCommit=!0;var e=this._callbacks;if(null!==e)for(var r=0;r<e.length;r++){var n=e[r];if("function"!==typeof n)throw t(Error(191),n);n()}}},Ej.prototype.render=Dj.prototype.render=function(e,t){var r=this._internalRoot,n=new Cj;return null!==(t=void 0===t?null:t)&&n.then(t),yj(e,r,null,n._onCommit),n},Ej.prototype.unmount=Dj.prototype.unmount=function(e){var t=this._internalRoot,r=new Cj;return null!==(e=void 0===e?null:e)&&r.then(e),yj(null,t,null,r._onCommit),r},Ej.prototype.createBatch=function(){var e=new Bj(this),t=e._expirationTime,r=this._internalRoot,n=r.firstBatch;if(null===n)r.firstBatch=e,e._next=null;else{for(r=null;null!==n&&n._expirationTime>=t;)r=n,n=n._next;e._next=n,null!==r&&(r._next=e)}return e},Jb=ej,Kb=fj,Lb=aj,$e=function Mb(e,t){var r=Ai;Ai|=2;try{return e(t)}finally{(Ai=r)===vi&&O()}};var sa={createPortal:Kj,findDOMNode:function findDOMNode(e){if(null==e)e=null;else if(1!==e.nodeType){var r=e._reactInternalFiber;if(void 0===r){if("function"===typeof e.render)throw t(Error(188));throw t(Error(268),Object.keys(e))}e=null===(e=qd(r))?null:e.stateNode}return e},hydrate:function hydrate(e,r,n){if(!Hj(r))throw t(Error(200));return Jj(null,e,r,!0,n)},render:function render(e,r,n){if(!Hj(r))throw t(Error(200));return Jj(null,e,r,!1,n)},unstable_renderSubtreeIntoContainer:function unstable_renderSubtreeIntoContainer(e,r,n,i){if(!Hj(n))throw t(Error(200));if(null==e||void 0===e._reactInternalFiber)throw t(Error(38));return Jj(e,r,n,!1,i)},unmountComponentAtNode:function unmountComponentAtNode(e){if(!Hj(e))throw t(Error(40));return!!e._reactRootContainer&&(gj((function(){Jj(null,null,e,!1,(function(){e._reactRootContainer=null}))})),!0)},unstable_createPortal:function unstable_createPortal(){return Kj.apply(void 0,arguments)},unstable_batchedUpdates:ej,unstable_interactiveUpdates:function unstable_interactiveUpdates(e,t,r,n){return aj(),fj(e,t,r,n)},unstable_discreteUpdates:fj,unstable_flushDiscreteUpdates:aj,flushSync:function flushSync(e,r){if((Ai&(_i|xi))!==vi)throw t(Error(187));var n=Ai;Ai|=1;try{return vf(99,e.bind(null,r))}finally{Ai=n,O()}},unstable_createRoot:function Lj(e,r){if(!Hj(e))throw t(Error(299),"unstable_createRoot");return new Ej(e,null!=r&&!0===r.hydrate)},unstable_createSyncRoot:function Mj(e,r){if(!Hj(e))throw t(Error(299),"unstable_createRoot");return new Dj(e,1,null!=r&&!0===r.hydrate)},unstable_flushControlled:function unstable_flushControlled(e){var t=Ai;Ai|=1;try{vf(99,e)}finally{(Ai=t)===vi&&O()}},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{Events:[Ia,Ja,Ka,B.injectEventPluginsByName,w,Qa,function(e){ya(e,Pa)},Hb,Ib,Ud,Ba,cj,{current:!1}]}};!function(e){var t=e.findFiberByHostInstance;(function tj(e){if("undefined"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)return!0;try{var r=t.inject(e);aa=function pj(e){try{t.onCommitFiberRoot(r,e,void 0,64===(64&e.current.effectTag))}catch(n){}},oa=function ji(e){try{t.onCommitFiberUnmount(r,e)}catch(n){}}}catch(n){}return!0})(s({},e,{overrideHookState:null,overrideProps:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:et.ReactCurrentDispatcher,findHostInstanceByFiber:function findHostInstanceByFiber(e){return null===(e=qd(e))?null:e.stateNode},findFiberByHostInstance:function findFiberByHostInstance(e){return t?t(e):null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null}))}({findFiberByHostInstance:Ha,bundleType:0,version:"16.9.0",rendererPackageName:"react-dom"});var ua={default:sa},la=ua&&sa||ua;r.exports=la.default||la},function(e,t,r){"use strict";e.exports=r(261)},function(t,n,i){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a=void 0,o=void 0,s=void 0,u=void 0,l=void 0;if(n.unstable_now=void 0,n.unstable_forceFrameRate=void 0,"undefined"===typeof window||"function"!==typeof MessageChannel){var c=null,f=null,h=function r(){if(null!==c)try{var e=n.unstable_now();c(!0,e),c=null}catch(t){throw setTimeout(r,0),t}};n.unstable_now=function(){return Date.now()},a=function d(e){null!==c?setTimeout(a,0,e):(c=e,setTimeout(h,0))},o=function e(t,r){f=setTimeout(t,r)},s=function g(){clearTimeout(f)},u=function m(){return!1},l=n.unstable_forceFrameRate=function(){}}else{var p=window.performance,v=window.Date,y=window.setTimeout,_=window.clearTimeout,x=window.requestAnimationFrame,w=window.cancelAnimationFrame;"undefined"!==typeof console&&("function"!==typeof x&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!==typeof w&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")),n.unstable_now="object"===typeof p&&"function"===typeof p.now?function(){return p.now()}:function(){return v.now()};var k=!1,S=null,E=-1,C=-1,O=33.33,A=-1,R=-1,D=0,P=!1;u=function m(){return n.unstable_now()>=D},l=function n(){},n.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):0<e?(O=Math.floor(1e3/e),P=!0):(O=33.33,P=!1)};var j=function J(){if(null!==S){var e=n.unstable_now(),t=0<D-e;try{S(t,e)||(S=null)}catch(r){throw F.postMessage(null),r}}},M=new MessageChannel,F=M.port2;M.port1.onmessage=j;a=function _d(e){S=e,k||(k=!0,x((function(e){!function L(e){if(null===S)R=A=-1,k=!1;else{k=!0,x((function(e){_(E),L(e)}));if(E=y((function b(){D=n.unstable_now()+O/2,j(),E=y(b,3*O)}),3*O),-1!==A&&.1<e-A){var t=e-A;!P&&-1!==R&&t<O&&R<O&&(8.33>(O=t<R?R:t)&&(O=8.33)),R=t}A=e,D=e+O,F.postMessage(null)}}(e)})))},o=function e(t,r){C=y((function(){t(n.unstable_now())}),r)},s=function g(){_(C),C=-1}}var I=null,N=null,B=null,z=3,q=!1,G=!1,H=!1;function T(e,t){var r=e.next;if(r===e)I=null;else{e===I&&(I=r);var n=e.previous;n.next=r,r.previous=n}e.next=e.previous=null,r=e.callback,n=z;var i=B;z=e.priorityLevel,B=e;try{var a=e.expirationTime<=t;switch(z){case 1:var o=r(a);break;case 2:case 3:case 4:o=r(a);break;case 5:o=r(a)}}catch(s){throw s}finally{z=n,B=i}if("function"===typeof o)if(t=e.expirationTime,e.callback=o,null===I)I=e.next=e.previous=e;else{o=null,a=I;do{if(t<=a.expirationTime){o=a;break}a=a.next}while(a!==I);null===o?o=I:o===I&&(I=e),(t=o.previous).next=o.previous=e,e.next=o,e.previous=t}}function U(e){if(null!==N&&N.startTime<=e)do{var t=N,r=t.next;if(t===r)N=null;else{N=r;var n=t.previous;n.next=r,r.previous=n}t.next=t.previous=null,V(t,t.expirationTime)}while(null!==N&&N.startTime<=e)}function W(e){H=!1,U(e),G||(null!==I?(G=!0,a(X)):null!==N&&o(W,N.startTime-e))}function X(e,t){G=!1,H&&(H=!1,s()),U(t),q=!0;try{if(e){if(null!==I)do{T(I,t),U(t=n.unstable_now())}while(null!==I&&!u())}else for(;null!==I&&I.expirationTime<=t;)T(I,t),U(t=n.unstable_now());return null!==I||(null!==N&&o(W,N.startTime-t),!1)}finally{q=!1}}function Y(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}function V(e,t){if(null===I)I=e.next=e.previous=e;else{var r=null,n=I;do{if(t<n.expirationTime){r=n;break}n=n.next}while(n!==I);null===r?r=I:r===I&&(I=e),(t=r.previous).next=r.previous=e,e.next=r,e.previous=t}}var $=l;n.unstable_ImmediatePriority=1,n.unstable_UserBlockingPriority=2,n.unstable_NormalPriority=3,n.unstable_IdlePriority=5,n.unstable_LowPriority=4,n.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=z;z=e;try{return t()}finally{z=r}},n.unstable_next=function(e){switch(z){case 1:case 2:case 3:var t=3;break;default:t=z}var r=z;z=t;try{return e()}finally{z=r}},n.unstable_scheduleCallback=function(e,t,r){var i=n.unstable_now();if("object"===typeof r&&null!==r){var u=r.delay;u="number"===typeof u&&0<u?i+u:i,r="number"===typeof r.timeout?r.timeout:Y(e)}else r=Y(e),u=i;if(e={callback:t,priorityLevel:e,startTime:u,expirationTime:r=u+r,next:null,previous:null},u>i){if(r=u,null===N)N=e.next=e.previous=e;else{t=null;var l=N;do{if(r<l.startTime){t=l;break}l=l.next}while(l!==N);null===t?t=N:t===N&&(N=e),(r=t.previous).next=t.previous=e,e.next=t,e.previous=r}null===I&&N===e&&(H?s():H=!0,o(W,u-i))}else V(e,r),G||q||(G=!0,a(X));return e},n.unstable_cancelCallback=function(e){var t=e.next;if(null!==t){if(e===t)e===I?I=null:e===N&&(N=null);else{e===I?I=t:e===N&&(N=t);var r=e.previous;r.next=t,t.previous=r}e.next=e.previous=null}},n.unstable_wrapCallback=function(e){var t=z;return function(){var r=z;z=t;try{return e.apply(this,arguments)}finally{z=r}}},n.unstable_getCurrentPriorityLevel=function(){return z},n.unstable_shouldYield=function(){var e=n.unstable_now();return U(e),null!==B&&null!==I&&I.startTime<=e&&I.expirationTime<B.expirationTime||u()},n.unstable_requestPaint=$,n.unstable_continueExecution=function(){G||q||(G=!0,a(X))},n.unstable_pauseExecution=function(){},n.unstable_getFirstCallbackNode=function(){return I}},function(e,t,r){var n=function(){return this}()||Function("return this")(),i=n.regeneratorRuntime&&Object.getOwnPropertyNames(n).indexOf("regeneratorRuntime")>=0,a=i&&n.regeneratorRuntime;if(n.regeneratorRuntime=void 0,e.exports=r(263),i)n.regeneratorRuntime=a;else try{delete n.regeneratorRuntime}catch(o){n.regeneratorRuntime=void 0}},function(e,t){!function(t){"use strict";var r,n=Object.prototype,i=n.hasOwnProperty,a="function"===typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag",l="object"===typeof e,c=t.regeneratorRuntime;if(c)l&&(e.exports=c);else{(c=t.regeneratorRuntime=l?e.exports:{}).wrap=wrap;var f="suspendedStart",d="suspendedYield",h="executing",p="completed",g={},m={};m[o]=function(){return this};var v=Object.getPrototypeOf,y=v&&v(v(values([])));y&&y!==n&&i.call(y,o)&&(m=y);var _=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(m);GeneratorFunction.prototype=_.constructor=GeneratorFunctionPrototype,GeneratorFunctionPrototype.constructor=GeneratorFunction,GeneratorFunctionPrototype[u]=GeneratorFunction.displayName="GeneratorFunction",c.isGeneratorFunction=function(e){var t="function"===typeof e&&e.constructor;return!!t&&(t===GeneratorFunction||"GeneratorFunction"===(t.displayName||t.name))},c.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,u in e||(e[u]="GeneratorFunction")),e.prototype=Object.create(_),e},c.awrap=function(e){return{__await:e}},defineIteratorMethods(AsyncIterator.prototype),AsyncIterator.prototype[s]=function(){return this},c.AsyncIterator=AsyncIterator,c.async=function(e,t,r,n){var i=new AsyncIterator(wrap(e,t,r,n));return c.isGeneratorFunction(t)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},defineIteratorMethods(_),_[u]="Generator",_[o]=function(){return this},_.toString=function(){return"[object Generator]"},c.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function next(){for(;t.length;){var r=t.pop();if(r in e)return next.value=r,next.done=!1,next}return next.done=!0,next}},c.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(resetTryEntry),!e)for(var t in this)"t"===t.charAt(0)&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=r)},stop:function stop(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function dispatchException(e){if(this.done)throw e;var t=this;function handle(n,i){return o.type="throw",o.arg=e,t.next=n,i&&(t.method="next",t.arg=r),!!i}for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n],o=a.completion;if("root"===a.tryLoc)return handle("end");if(a.tryLoc<=this.prev){var s=i.call(a,"catchLoc"),u=i.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return handle(a.catchLoc,!0);if(this.prev<a.finallyLoc)return handle(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return handle(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return handle(a.finallyLoc)}}}},abrupt:function abrupt(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(o)},complete:function complete(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function finish(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),g}},catch:function _catch(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;resetTryEntry(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(e,t,n){return this.delegate={iterator:values(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=r),g}}}function wrap(e,t,r,n){var i=t&&t.prototype instanceof Generator?t:Generator,a=Object.create(i.prototype),o=new Context(n||[]);return a._invoke=function makeInvokeMethod(e,t,r){var n=f;return function invoke(i,a){if(n===h)throw new Error("Generator is already running");if(n===p){if("throw"===i)throw a;return doneResult()}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var s=maybeInvokeDelegate(o,r);if(s){if(s===g)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var u=tryCatch(e,t,r);if("normal"===u.type){if(n=r.done?p:d,u.arg===g)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=p,r.method="throw",r.arg=u.arg)}}}(e,r,o),a}function tryCatch(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(n){return{type:"throw",arg:n}}}function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}function defineIteratorMethods(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function AsyncIterator(e){var t;this._invoke=function enqueue(r,n){function callInvokeWithMethodAndArg(){return new Promise((function(t,a){!function invoke(t,r,n,a){var o=tryCatch(e[t],e,r);if("throw"!==o.type){var s=o.arg,u=s.value;return u&&"object"===typeof u&&i.call(u,"__await")?Promise.resolve(u.__await).then((function(e){invoke("next",e,n,a)}),(function(e){invoke("throw",e,n,a)})):Promise.resolve(u).then((function(e){s.value=e,n(s)}),a)}a(o.arg)}(r,n,t,a)}))}return t=t?t.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}function maybeInvokeDelegate(e,t){var n=e.iterator[t.method];if(n===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=r,maybeInvokeDelegate(e,t),"throw"===t.method))return g;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var i=tryCatch(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,g;var a=i.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=r),t.delegate=null,g):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,g)}function pushTryEntry(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function resetTryEntry(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function Context(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(pushTryEntry,this),this.reset(!0)}function values(e){if(e){var t=e[o];if(t)return t.call(e);if("function"===typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function next(){for(;++n<e.length;)if(i.call(e,n))return next.value=e[n],next.done=!1,next;return next.value=r,next.done=!0,next};return a.next=a}}return{next:doneResult}}function doneResult(){return{value:r,done:!0}}}(function(){return this}()||Function("return this")())},function(e,t,r){r(140),r(54),r(72),r(275),r(283),r(284),e.exports=r(20).Promise},function(e,t,r){var n=r(99),i=r(100);e.exports=function(e){return function(t,r){var a,o,s=String(i(t)),u=n(r),l=s.length;return u<0||u>=l?e?"":void 0:(a=s.charCodeAt(u))<55296||a>56319||u+1===l||(o=s.charCodeAt(u+1))<56320||o>57343?e?s.charAt(u):a:e?s.slice(u,u+2):o-56320+(a-55296<<10)+65536}}},function(e,t,r){"use strict";var n=r(103),i=r(56),a=r(71),o={};r(43)(o,r(23)("iterator"),(function(){return this})),e.exports=function(e,t,r){e.prototype=n(o,{next:i(1,r)}),a(e,t+" Iterator")}},function(e,t,r){var n=r(35),i=r(30),a=r(104);e.exports=r(39)?Object.defineProperties:function defineProperties(e,t){i(e);for(var r,o=a(t),s=o.length,u=0;s>u;)n.f(e,r=o[u++],t[r]);return e}},function(e,t,r){var n=r(57);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==n(e)?e.split(""):Object(e)}},function(e,t,r){var n=r(49),i=r(105),a=r(270);e.exports=function(e){return function(t,r,o){var s,u=n(t),l=i(u.length),c=a(o,l);if(e&&r!=r){for(;l>c;)if((s=u[c++])!=s)return!0}else for(;l>c;c++)if((e||c in u)&&u[c]===r)return e||c||0;return!e&&-1}}},function(e,t,r){var n=r(99),i=Math.max,a=Math.min;e.exports=function(e,t){return(e=n(e))<0?i(e+t,0):a(e,t)}},function(e,t,r){var n=r(44),i=r(109),a=r(106)("IE_PROTO"),o=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),n(e,a)?e[a]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?o:null}},function(e,t,r){"use strict";var n=r(273),i=r(274),a=r(48),o=r(49);e.exports=r(141)(Array,"Array",(function(e,t){this._t=o(e),this._i=0,this._k=t}),(function(){var e=this._t,t=this._k,r=this._i++;return!e||r>=e.length?(this._t=void 0,i(1)):i(0,"keys"==t?r:"values"==t?e[r]:[r,e[r]])}),"values"),a.Arguments=a.Array,n("keys"),n("values"),n("entries")},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,r){"use strict";var n,i,a,o,s=r(55),u=r(22),l=r(47),c=r(110),f=r(29),d=r(38),h=r(68),p=r(276),g=r(277),m=r(148),v=r(149).set,y=r(279)(),_=r(112),b=r(150),x=r(280),w=r(151),k=u.TypeError,S=u.process,E=S&&S.versions,C=E&&E.v8||"",T=u.Promise,O="process"==c(S),A=function empty(){},R=i=_.f,D=!!function(){try{var e=T.resolve(1),t=(e.constructor={})[r(23)("species")]=function(e){e(A,A)};return(O||"function"==typeof PromiseRejectionEvent)&&e.then(A)instanceof t&&0!==C.indexOf("6.6")&&-1===x.indexOf("Chrome/66")}catch(n){}}(),P=function isThenable(e){var t;return!(!d(e)||"function"!=typeof(t=e.then))&&t},j=function notify(e,t){if(!e._n){e._n=!0;var r=e._c;y((function(){for(var n=e._v,i=1==e._s,a=0,o=function run(t){var r,a,o,s=i?t.ok:t.fail,u=t.resolve,l=t.reject,c=t.domain;try{s?(i||(2==e._h&&I(e),e._h=1),!0===s?r=n:(c&&c.enter(),r=s(n),c&&(c.exit(),o=!0)),r===t.promise?l(k("Promise-chain cycle")):(a=P(r))?a.call(r,u,l):u(r)):l(n)}catch(f){c&&!o&&c.exit(),l(f)}};r.length>a;)o(r[a++]);e._c=[],e._n=!1,t&&!e._h&&M(e)}))}},M=function onUnhandled(e){v.call(u,(function(){var t,r,n,i=e._v,a=F(e);if(a&&(t=b((function(){O?S.emit("unhandledRejection",i,e):(r=u.onunhandledrejection)?r({promise:e,reason:i}):(n=u.console)&&n.error&&n.error("Unhandled promise rejection",i)})),e._h=O||F(e)?2:1),e._a=void 0,a&&t.e)throw t.v}))},F=function isUnhandled(e){return 1!==e._h&&0===(e._a||e._c).length},I=function onHandleUnhandled(e){v.call(u,(function(){var t;O?S.emit("rejectionHandled",e):(t=u.onrejectionhandled)&&t({promise:e,reason:e._v})}))},L=function $reject(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),j(t,!0))},N=function $resolve(e){var t,r=this;if(!r._d){r._d=!0,r=r._w||r;try{if(r===e)throw k("Promise can't be resolved itself");(t=P(e))?y((function(){var n={_w:r,_d:!1};try{t.call(e,l($resolve,n,1),l(L,n,1))}catch(i){L.call(n,i)}})):(r._v=e,r._s=1,j(r,!1))}catch(n){L.call({_w:r,_d:!1},n)}}};D||(T=function Promise(e){p(this,T,"Promise","_h"),h(e),n.call(this);try{e(l(N,this,1),l(L,this,1))}catch(t){L.call(this,t)}},(n=function Promise(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=r(281)(T.prototype,{then:function then(e,t){var r=R(m(this,T));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=O?S.domain:void 0,this._c.push(r),this._a&&this._a.push(r),this._s&&j(this,!1),r.promise},catch:function _catch(e){return this.then(void 0,e)}}),a=function OwnPromiseCapability(){var e=new n;this.promise=e,this.resolve=l(N,e,1),this.reject=l(L,e,1)},_.f=R=function newPromiseCapability(e){return e===T||e===o?new a(e):i(e)}),f(f.G+f.W+f.F*!D,{Promise:T}),r(71)(T,"Promise"),r(282)("Promise"),o=r(20).Promise,f(f.S+f.F*!D,"Promise",{reject:function reject(e){var t=R(this);return(0,t.reject)(e),t.promise}}),f(f.S+f.F*(s||!D),"Promise",{resolve:function resolve(e){return w(s&&this===o?T:this,e)}}),f(f.S+f.F*!(D&&r(152)((function(e){T.all(e).catch(A)}))),"Promise",{all:function all(e){var t=this,r=R(t),n=r.resolve,i=r.reject,a=b((function(){var r=[],a=0,o=1;g(e,!1,(function(e){var s=a++,u=!1;r.push(void 0),o++,t.resolve(e).then((function(e){u||(u=!0,r[s]=e,--o||n(r))}),i)})),--o||n(r)}));return a.e&&i(a.v),r.promise},race:function race(e){var t=this,r=R(t),n=r.reject,i=b((function(){g(e,!1,(function(e){t.resolve(e).then(r.resolve,n)}))}));return i.e&&n(i.v),r.promise}})},function(e,t){e.exports=function(e,t,r,n){if(!(e instanceof t)||void 0!==n&&n in e)throw TypeError(r+": incorrect invocation!");return e}},function(e,t,r){var n=r(47),i=r(146),a=r(147),o=r(30),s=r(105),u=r(111),l={},c={};(t=e.exports=function(e,t,r,f,d){var h,p,g,m,v=d?function(){return e}:u(e),y=n(r,f,t?2:1),_=0;if("function"!=typeof v)throw TypeError(e+" is not iterable!");if(a(v)){for(h=s(e.length);h>_;_++)if((m=t?y(o(p=e[_])[0],p[1]):y(e[_]))===l||m===c)return m}else for(g=v.call(e);!(p=g.next()).done;)if((m=i(g,y,p.value,t))===l||m===c)return m}).BREAK=l,t.RETURN=c},function(e,t){e.exports=function(e,t,r){var n=void 0===r;switch(t.length){case 0:return n?e():e.call(r);case 1:return n?e(t[0]):e.call(r,t[0]);case 2:return n?e(t[0],t[1]):e.call(r,t[0],t[1]);case 3:return n?e(t[0],t[1],t[2]):e.call(r,t[0],t[1],t[2]);case 4:return n?e(t[0],t[1],t[2],t[3]):e.call(r,t[0],t[1],t[2],t[3])}return e.apply(r,t)}},function(e,t,r){var n=r(22),i=r(149).set,a=n.MutationObserver||n.WebKitMutationObserver,o=n.process,s=n.Promise,u="process"==r(57)(o);e.exports=function(){var e,t,r,l=function flush(){var n,i;for(u&&(n=o.domain)&&n.exit();e;){i=e.fn,e=e.next;try{i()}catch(a){throw e?r():t=void 0,a}}t=void 0,n&&n.enter()};if(u)r=function notify(){o.nextTick(l)};else if(!a||n.navigator&&n.navigator.standalone)if(s&&s.resolve){var c=s.resolve(void 0);r=function notify(){c.then(l)}}else r=function notify(){i.call(n,l)};else{var f=!0,d=document.createTextNode("");new a(l).observe(d,{characterData:!0}),r=function notify(){d.data=f=!f}}return function(n){var i={fn:n,next:void 0};t&&(t.next=i),e||(e=i,r()),t=i}}},function(e,t,r){var n=r(22).navigator;e.exports=n&&n.userAgent||""},function(e,t,r){var n=r(43);e.exports=function(e,t,r){for(var i in t)r&&e[i]?e[i]=t[i]:n(e,i,t[i]);return e}},function(e,t,r){"use strict";var n=r(22),i=r(20),a=r(35),o=r(39),s=r(23)("species");e.exports=function(e){var t="function"==typeof i[e]?i[e]:n[e];o&&t&&!t[s]&&a.f(t,s,{configurable:!0,get:function get(){return this}})}},function(e,t,r){"use strict";var n=r(29),i=r(20),a=r(22),o=r(148),s=r(151);n(n.P+n.R,"Promise",{finally:function _finally(e){var t=o(this,i.Promise||a.Promise),r="function"==typeof e;return this.then(r?function(r){return s(t,e()).then((function(){return r}))}:e,r?function(r){return s(t,e()).then((function(){throw r}))}:e)}})},function(e,t,r){"use strict";var n=r(29),i=r(112),a=r(150);n(n.S,"Promise",{try:function _try(e){var t=i.f(this),r=a(e);return(r.e?t.reject:t.resolve)(r.v),t.promise}})},,function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCommaAccessToken=t.logOut=t.isAuthed=void 0;var n=_interopRequireDefault(r(26)),i=_interopRequireDefault(r(27)),a=(t.logOut=function(){var e=(0,i.default)(n.default.mark((function _callee(){return n.default.wrap((function _callee$(e){for(;;)switch(e.prev=e.next){case 0:if(localStorage.removeItem("authorization"),!s){e.next=4;break}return e.next=4,o.default.removeItem("authorization");case 4:case"end":return e.stop()}}),_callee,this)})));return function logOut(){return e.apply(this,arguments)}}(),t.getCommaAccessToken=function(){var e=(0,i.default)(n.default.mark((function _callee2(){var e;return n.default.wrap((function _callee2$(r){for(;;)switch(r.prev=r.next){case 0:if(e=getTokenInternal()){r.next=11;break}return r.prev=2,r.next=5,o.default.getItem("authorization");case 5:e=r.sent,r.next=11;break;case 8:r.prev=8,r.t0=r.catch(2),s=!1;case 11:if(!e){r.next=16;break}if(t.isAuthed=!0,!s){r.next=16;break}return r.next=16,o.default.setItem("authorization",e);case 16:return r.abrupt("return",e);case 17:case"end":return r.stop()}}),_callee2,this,[[2,8]])})));return function getCommaAccessToken(){return e.apply(this,arguments)}}());t.getTokenInternal=getTokenInternal,t.setCommaAccessToken=function setCommaAccessToken(e){return localStorage.setItem("authorization",e),a()};var o=_interopRequireDefault(r(287));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}t.isAuthed=!1;var s=!0;function getTokenInternal(){return"undefined"!==typeof localStorage&&localStorage.authorization?localStorage.authorization:null}},function(e,t,r){(function(t){var r;e.exports=function e(t,n,i){function s(o,u){if(!n[o]){if(!t[o]){if(!u&&"function"==typeof r&&r)return r(o,!0);if(a)return a(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[o]={exports:{}};t[o][0].call(c.exports,(function(e){var r=t[o][1][e];return s(r||e)}),c,c.exports,e,t,n,i)}return n[o].exports}for(var a="function"==typeof r&&r,o=0;o<i.length;o++)s(i[o]);return s}({1:[function(e,r,n){(function(e){"use strict";var t,n,i=e.MutationObserver||e.WebKitMutationObserver;if(i){var a=0,o=new i(nextTick),s=e.document.createTextNode("");o.observe(s,{characterData:!0}),t=function scheduleDrain(){s.data=a=++a%2}}else if(e.setImmediate||"undefined"===typeof e.MessageChannel)t="document"in e&&"onreadystatechange"in e.document.createElement("script")?function scheduleDrain(){var t=e.document.createElement("script");t.onreadystatechange=function(){nextTick(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function scheduleDrain(){setTimeout(nextTick,0)};else{var u=new e.MessageChannel;u.port1.onmessage=nextTick,t=function scheduleDrain(){u.port2.postMessage(0)}}var l=[];function nextTick(){var e,t;n=!0;for(var r=l.length;r;){for(t=l,l=[],e=-1;++e<r;)t[e]();r=l.length}n=!1}r.exports=function immediate(e){1!==l.push(e)||n||t()}}).call(this,"undefined"!==typeof t?t:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{}],2:[function(e,t,r){"use strict";var n=e(1);function INTERNAL(){}var i={},a=["REJECTED"],o=["FULFILLED"],s=["PENDING"];function Promise(e){if("function"!==typeof e)throw new TypeError("resolver must be a function");this.state=s,this.queue=[],this.outcome=void 0,e!==INTERNAL&&safelyResolveThenable(this,e)}function QueueItem(e,t,r){this.promise=e,"function"===typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"===typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function unwrap(e,t,r){n((function(){var n;try{n=t(r)}catch(a){return i.reject(e,a)}n===e?i.reject(e,new TypeError("Cannot resolve promise with itself")):i.resolve(e,n)}))}function getThen(e){var t=e&&e.then;if(e&&("object"===typeof e||"function"===typeof e)&&"function"===typeof t)return function appyThen(){t.apply(e,arguments)}}function safelyResolveThenable(e,t){var r=!1;function onError(t){r||(r=!0,i.reject(e,t))}function onSuccess(t){r||(r=!0,i.resolve(e,t))}var n=tryCatch((function tryToUnwrap(){t(onSuccess,onError)}));"error"===n.status&&onError(n.value)}function tryCatch(e,t){var r={};try{r.value=e(t),r.status="success"}catch(n){r.status="error",r.value=n}return r}t.exports=Promise,Promise.prototype.catch=function(e){return this.then(null,e)},Promise.prototype.then=function(e,t){if("function"!==typeof e&&this.state===o||"function"!==typeof t&&this.state===a)return this;var r=new this.constructor(INTERNAL);return this.state!==s?unwrap(r,this.state===o?e:t,this.outcome):this.queue.push(new QueueItem(r,e,t)),r},QueueItem.prototype.callFulfilled=function(e){i.resolve(this.promise,e)},QueueItem.prototype.otherCallFulfilled=function(e){unwrap(this.promise,this.onFulfilled,e)},QueueItem.prototype.callRejected=function(e){i.reject(this.promise,e)},QueueItem.prototype.otherCallRejected=function(e){unwrap(this.promise,this.onRejected,e)},i.resolve=function(e,t){var r=tryCatch(getThen,t);if("error"===r.status)return i.reject(e,r.value);var n=r.value;if(n)safelyResolveThenable(e,n);else{e.state=o,e.outcome=t;for(var a=-1,s=e.queue.length;++a<s;)e.queue[a].callFulfilled(t)}return e},i.reject=function(e,t){e.state=a,e.outcome=t;for(var r=-1,n=e.queue.length;++r<n;)e.queue[r].callRejected(t);return e},Promise.resolve=function resolve(e){return e instanceof this?e:i.resolve(new this(INTERNAL),e)},Promise.reject=function reject(e){var t=new this(INTERNAL);return i.reject(t,e)},Promise.all=function all(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);for(var a=new Array(r),o=0,s=-1,u=new this(INTERNAL);++s<r;)allResolver(e[s],s);return u;function allResolver(e,s){t.resolve(e).then((function resolveFromAll(e){a[s]=e,++o!==r||n||(n=!0,i.resolve(u,a))}),(function(e){n||(n=!0,i.reject(u,e))}))}},Promise.race=function race(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);for(var a,o=-1,s=new this(INTERNAL);++o<r;)a=e[o],t.resolve(a).then((function(e){n||(n=!0,i.resolve(s,e))}),(function(e){n||(n=!0,i.reject(s,e))}));return s}},{1:1}],3:[function(e,r,n){(function(t){"use strict";"function"!==typeof t.Promise&&(t.Promise=e(2))}).call(this,"undefined"!==typeof t?t:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{2:2}],4:[function(e,t,r){"use strict";var n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function getIDB(){try{if("undefined"!==typeof indexedDB)return indexedDB;if("undefined"!==typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!==typeof mozIndexedDB)return mozIndexedDB;if("undefined"!==typeof OIndexedDB)return OIndexedDB;if("undefined"!==typeof msIndexedDB)return msIndexedDB}catch(e){return}}();function createBlob(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(i){if("TypeError"!==i.name)throw i;for(var r=new("undefined"!==typeof BlobBuilder?BlobBuilder:"undefined"!==typeof MSBlobBuilder?MSBlobBuilder:"undefined"!==typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),n=0;n<e.length;n+=1)r.append(e[n]);return r.getBlob(t.type)}}"undefined"===typeof Promise&&e(3);var a=Promise;function executeCallback(e,t){t&&e.then((function(e){t(null,e)}),(function(e){t(e)}))}function executeTwoCallbacks(e,t,r){"function"===typeof t&&e.then(t),"function"===typeof r&&e.catch(r)}function normalizeKey(e){return"string"!==typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function getCallback(){if(arguments.length&&"function"===typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var o="local-forage-detect-blob-support",s=void 0,u={},l=Object.prototype.toString,c="readonly",f="readwrite";function _checkBlobSupport(e){return"boolean"===typeof s?a.resolve(s):function _checkBlobSupportWithoutCaching(e){return new a((function(t){var r=e.transaction(o,f),n=createBlob([""]);r.objectStore(o).put(n,"key"),r.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},r.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),r=navigator.userAgent.match(/Edge\//);t(r||!e||parseInt(e[1],10)>=43)}})).catch((function(){return!1}))}(e).then((function(e){return s=e}))}function _deferReadiness(e){var t=u[e.name],r={};r.promise=new a((function(e,t){r.resolve=e,r.reject=t})),t.deferredOperations.push(r),t.dbReady?t.dbReady=t.dbReady.then((function(){return r.promise})):t.dbReady=r.promise}function _advanceReadiness(e){var t=u[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function _rejectReadiness(e,t){var r=u[e.name].deferredOperations.pop();if(r)return r.reject(t),r.promise}function _getConnection(e,t){return new a((function(r,n){if(u[e.name]=u[e.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},e.db){if(!t)return r(e.db);_deferReadiness(e),e.db.close()}var a=[e.name];t&&a.push(e.version);var s=i.open.apply(i,a);t&&(s.onupgradeneeded=function(t){var r=s.result;try{r.createObjectStore(e.storeName),t.oldVersion<=1&&r.createObjectStore(o)}catch(n){if("ConstraintError"!==n.name)throw n;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),s.onerror=function(e){e.preventDefault(),n(s.error)},s.onsuccess=function(){r(s.result),_advanceReadiness(e)}}))}function _getOriginalConnection(e){return _getConnection(e,!1)}function _getUpgradedConnection(e){return _getConnection(e,!0)}function _isUpgradeNeeded(e,t){if(!e.db)return!0;var r=!e.db.objectStoreNames.contains(e.storeName),n=e.version<e.db.version,i=e.version>e.db.version;if(n&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),i||r){if(r){var a=e.db.version+1;a>e.version&&(e.version=a)}return!0}return!1}function _decodeBlob(e){return createBlob([function _binStringToArrayBuffer(e){for(var t=e.length,r=new ArrayBuffer(t),n=new Uint8Array(r),i=0;i<t;i++)n[i]=e.charCodeAt(i);return r}(atob(e.data))],{type:e.type})}function _isEncodedBlob(e){return e&&e.__local_forage_encoded_blob}function _fullyReady(e){var t=this,r=t._initReady().then((function(){var e=u[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return executeTwoCallbacks(r,e,e),r}function createTransaction(e,t,r,n){void 0===n&&(n=1);try{var i=e.db.transaction(e.storeName,t);r(null,i)}catch(o){if(n>0&&(!e.db||"InvalidStateError"===o.name||"NotFoundError"===o.name))return a.resolve().then((function(){if(!e.db||"NotFoundError"===o.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),_getUpgradedConnection(e)})).then((function(){return function _tryReconnect(e){_deferReadiness(e);for(var t=u[e.name],r=t.forages,n=0;n<r.length;n++){var i=r[n];i._dbInfo.db&&(i._dbInfo.db.close(),i._dbInfo.db=null)}return e.db=null,_getOriginalConnection(e).then((function(t){return e.db=t,_isUpgradeNeeded(e)?_getUpgradedConnection(e):t})).then((function(n){e.db=t.db=n;for(var i=0;i<r.length;i++)r[i]._dbInfo.db=n})).catch((function(t){throw _rejectReadiness(e,t),t}))}(e).then((function(){createTransaction(e,t,r,n-1)}))})).catch(r);r(o)}}var d={_driver:"asyncStorage",_initStorage:function _initStorage(e){var t=this,r={db:null};if(e)for(var n in e)r[n]=e[n];var i=u[r.name];i||(i={forages:[],db:null,dbReady:null,deferredOperations:[]},u[r.name]=i),i.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=_fullyReady);var o=[];function ignoreErrors(){return a.resolve()}for(var s=0;s<i.forages.length;s++){var l=i.forages[s];l!==t&&o.push(l._initReady().catch(ignoreErrors))}var c=i.forages.slice(0);return a.all(o).then((function(){return r.db=i.db,_getOriginalConnection(r)})).then((function(e){return r.db=e,_isUpgradeNeeded(r,t._defaultConfig.version)?_getUpgradedConnection(r):e})).then((function(e){r.db=i.db=e,t._dbInfo=r;for(var n=0;n<c.length;n++){var a=c[n];a!==t&&(a._dbInfo.db=r.db,a._dbInfo.version=r.version)}}))},_support:function isIndexedDBValid(){try{if(!i)return!1;var e="undefined"!==typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"===typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!e||t)&&"undefined"!==typeof indexedDB&&"undefined"!==typeof IDBKeyRange}catch(r){return!1}}(),iterate:function iterate(e,t){var r=this,n=new a((function(t,n){r.ready().then((function(){createTransaction(r._dbInfo,c,(function(i,a){if(i)return n(i);try{var o=a.objectStore(r._dbInfo.storeName).openCursor(),s=1;o.onsuccess=function(){var r=o.result;if(r){var n=r.value;_isEncodedBlob(n)&&(n=_decodeBlob(n));var i=e(n,r.key,s++);void 0!==i?t(i):r.continue()}else t()},o.onerror=function(){n(o.error)}}catch(u){n(u)}}))})).catch(n)}));return executeCallback(n,t),n},getItem:function getItem(e,t){var r=this;e=normalizeKey(e);var n=new a((function(t,n){r.ready().then((function(){createTransaction(r._dbInfo,c,(function(i,a){if(i)return n(i);try{var o=a.objectStore(r._dbInfo.storeName).get(e);o.onsuccess=function(){var e=o.result;void 0===e&&(e=null),_isEncodedBlob(e)&&(e=_decodeBlob(e)),t(e)},o.onerror=function(){n(o.error)}}catch(s){n(s)}}))})).catch(n)}));return executeCallback(n,t),n},setItem:function setItem(e,t,r){var n=this;e=normalizeKey(e);var i=new a((function(r,i){var o;n.ready().then((function(){return o=n._dbInfo,"[object Blob]"===l.call(t)?_checkBlobSupport(o.db).then((function(e){return e?t:function _encodeBlob(e){return new a((function(t,r){var n=new FileReader;n.onerror=r,n.onloadend=function(r){var n=btoa(r.target.result||"");t({__local_forage_encoded_blob:!0,data:n,type:e.type})},n.readAsBinaryString(e)}))}(t)})):t})).then((function(t){createTransaction(n._dbInfo,f,(function(a,o){if(a)return i(a);try{var s=o.objectStore(n._dbInfo.storeName);null===t&&(t=void 0);var u=s.put(t,e);o.oncomplete=function(){void 0===t&&(t=null),r(t)},o.onabort=o.onerror=function(){var e=u.error?u.error:u.transaction.error;i(e)}}catch(l){i(l)}}))})).catch(i)}));return executeCallback(i,r),i},removeItem:function removeItem(e,t){var r=this;e=normalizeKey(e);var n=new a((function(t,n){r.ready().then((function(){createTransaction(r._dbInfo,f,(function(i,a){if(i)return n(i);try{var o=a.objectStore(r._dbInfo.storeName).delete(e);a.oncomplete=function(){t()},a.onerror=function(){n(o.error)},a.onabort=function(){var e=o.error?o.error:o.transaction.error;n(e)}}catch(s){n(s)}}))})).catch(n)}));return executeCallback(n,t),n},clear:function clear(e){var t=this,r=new a((function(e,r){t.ready().then((function(){createTransaction(t._dbInfo,f,(function(n,i){if(n)return r(n);try{var a=i.objectStore(t._dbInfo.storeName).clear();i.oncomplete=function(){e()},i.onabort=i.onerror=function(){var e=a.error?a.error:a.transaction.error;r(e)}}catch(o){r(o)}}))})).catch(r)}));return executeCallback(r,e),r},length:function length(e){var t=this,r=new a((function(e,r){t.ready().then((function(){createTransaction(t._dbInfo,c,(function(n,i){if(n)return r(n);try{var a=i.objectStore(t._dbInfo.storeName).count();a.onsuccess=function(){e(a.result)},a.onerror=function(){r(a.error)}}catch(o){r(o)}}))})).catch(r)}));return executeCallback(r,e),r},key:function key(e,t){var r=this,n=new a((function(t,n){e<0?t(null):r.ready().then((function(){createTransaction(r._dbInfo,c,(function(i,a){if(i)return n(i);try{var o=a.objectStore(r._dbInfo.storeName),s=!1,u=o.openCursor();u.onsuccess=function(){var r=u.result;r?0===e?t(r.key):s?t(r.key):(s=!0,r.advance(e)):t(null)},u.onerror=function(){n(u.error)}}catch(l){n(l)}}))})).catch(n)}));return executeCallback(n,t),n},keys:function keys(e){var t=this,r=new a((function(e,r){t.ready().then((function(){createTransaction(t._dbInfo,c,(function(n,i){if(n)return r(n);try{var a=i.objectStore(t._dbInfo.storeName).openCursor(),o=[];a.onsuccess=function(){var t=a.result;t?(o.push(t.key),t.continue()):e(o)},a.onerror=function(){r(a.error)}}catch(s){r(s)}}))})).catch(r)}));return executeCallback(r,e),r},dropInstance:function dropInstance(e,t){t=getCallback.apply(this,arguments);var r,n=this.config();if((e="function"!==typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName),e.name){var o=e.name===n.name&&this._dbInfo.db?a.resolve(this._dbInfo.db):_getOriginalConnection(e).then((function(t){var r=u[e.name],n=r.forages;r.db=t;for(var i=0;i<n.length;i++)n[i]._dbInfo.db=t;return t}));r=e.storeName?o.then((function(t){if(t.objectStoreNames.contains(e.storeName)){var r=t.version+1;_deferReadiness(e);var n=u[e.name],o=n.forages;t.close();for(var s=0;s<o.length;s++){var l=o[s];l._dbInfo.db=null,l._dbInfo.version=r}return new a((function(t,n){var a=i.open(e.name,r);a.onerror=function(e){a.result.close(),n(e)},a.onupgradeneeded=function(){a.result.deleteObjectStore(e.storeName)},a.onsuccess=function(){var e=a.result;e.close(),t(e)}})).then((function(e){n.db=e;for(var t=0;t<o.length;t++){var r=o[t];r._dbInfo.db=e,_advanceReadiness(r._dbInfo)}})).catch((function(t){throw(_rejectReadiness(e,t)||a.resolve()).catch((function(){})),t}))}})):o.then((function(t){_deferReadiness(e);var r=u[e.name],n=r.forages;t.close();for(var o=0;o<n.length;o++)n[o]._dbInfo.db=null;return new a((function(t,r){var n=i.deleteDatabase(e.name);n.onerror=n.onblocked=function(e){var t=n.result;t&&t.close(),r(e)},n.onsuccess=function(){var e=n.result;e&&e.close(),t(e)}})).then((function(e){r.db=e;for(var t=0;t<n.length;t++)_advanceReadiness(n[t]._dbInfo)})).catch((function(t){throw(_rejectReadiness(e,t)||a.resolve()).catch((function(){})),t}))}))}else r=a.reject("Invalid arguments");return executeCallback(r,t),r}},h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p="~~local_forage_type~",g=/^~~local_forage_type~([^~]+)~/,m="__lfsc__:",v=m.length,y="arbf",_="blob",b="si08",x="ui08",w="uic8",k="si16",S="si32",E="ur16",C="ui32",T="fl32",O="fl64",A=v+y.length,R=Object.prototype.toString;function stringToBuffer(e){var t,r,n,i,a,o=.75*e.length,s=e.length,u=0;"="===e[e.length-1]&&(o--,"="===e[e.length-2]&&o--);var l=new ArrayBuffer(o),c=new Uint8Array(l);for(t=0;t<s;t+=4)r=h.indexOf(e[t]),n=h.indexOf(e[t+1]),i=h.indexOf(e[t+2]),a=h.indexOf(e[t+3]),c[u++]=r<<2|n>>4,c[u++]=(15&n)<<4|i>>2,c[u++]=(3&i)<<6|63&a;return l}function bufferToString(e){var t,r=new Uint8Array(e),n="";for(t=0;t<r.length;t+=3)n+=h[r[t]>>2],n+=h[(3&r[t])<<4|r[t+1]>>4],n+=h[(15&r[t+1])<<2|r[t+2]>>6],n+=h[63&r[t+2]];return r.length%3===2?n=n.substring(0,n.length-1)+"=":r.length%3===1&&(n=n.substring(0,n.length-2)+"=="),n}var D={serialize:function serialize(e,t){var r="";if(e&&(r=R.call(e)),e&&("[object ArrayBuffer]"===r||e.buffer&&"[object ArrayBuffer]"===R.call(e.buffer))){var n,i=m;e instanceof ArrayBuffer?(n=e,i+=y):(n=e.buffer,"[object Int8Array]"===r?i+=b:"[object Uint8Array]"===r?i+=x:"[object Uint8ClampedArray]"===r?i+=w:"[object Int16Array]"===r?i+=k:"[object Uint16Array]"===r?i+=E:"[object Int32Array]"===r?i+=S:"[object Uint32Array]"===r?i+=C:"[object Float32Array]"===r?i+=T:"[object Float64Array]"===r?i+=O:t(new Error("Failed to get type for BinaryArray"))),t(i+bufferToString(n))}else if("[object Blob]"===r){var a=new FileReader;a.onload=function(){var r=p+e.type+"~"+bufferToString(this.result);t(m+_+r)},a.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(o){console.error("Couldn't convert value into a JSON string: ",e),t(null,o)}},deserialize:function deserialize(e){if(e.substring(0,v)!==m)return JSON.parse(e);var t,r=e.substring(A),n=e.substring(v,A);if(n===_&&g.test(r)){var i=r.match(g);t=i[1],r=r.substring(i[0].length)}var a=stringToBuffer(r);switch(n){case y:return a;case _:return createBlob([a],{type:t});case b:return new Int8Array(a);case x:return new Uint8Array(a);case w:return new Uint8ClampedArray(a);case k:return new Int16Array(a);case E:return new Uint16Array(a);case S:return new Int32Array(a);case C:return new Uint32Array(a);case T:return new Float32Array(a);case O:return new Float64Array(a);default:throw new Error("Unkown type: "+n)}},stringToBuffer:stringToBuffer,bufferToString:bufferToString};function createDbTable(e,t,r,n){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,n)}function tryExecuteSql(e,t,r,n,i,a){e.executeSql(r,n,i,(function(e,o){o.code===o.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,s){s.rows.length?a(e,o):createDbTable(e,t,(function(){e.executeSql(r,n,i,a)}),a)}),a):a(e,o)}),a)}function _setItem(e,t,r,n){var i=this;e=normalizeKey(e);var o=new a((function(a,o){i.ready().then((function(){void 0===t&&(t=null);var s=t,u=i._dbInfo;u.serializer.serialize(t,(function(t,l){l?o(l):u.db.transaction((function(r){tryExecuteSql(r,u,"INSERT OR REPLACE INTO "+u.storeName+" (key, value) VALUES (?, ?)",[e,t],(function(){a(s)}),(function(e,t){o(t)}))}),(function(t){if(t.code===t.QUOTA_ERR){if(n>0)return void a(_setItem.apply(i,[e,s,r,n-1]));o(t)}}))}))})).catch(o)}));return executeCallback(o,r),o}var P={_driver:"webSQLStorage",_initStorage:function _initStorage$1(e){var t=this,r={db:null};if(e)for(var n in e)r[n]="string"!==typeof e[n]?e[n].toString():e[n];var i=new a((function(e,n){try{r.db=openDatabase(r.name,String(r.version),r.description,r.size)}catch(i){return n(i)}r.db.transaction((function(i){createDbTable(i,r,(function(){t._dbInfo=r,e()}),(function(e,t){n(t)}))}),n)}));return r.serializer=D,i},_support:function isWebSQLValid(){return"function"===typeof openDatabase}(),iterate:function iterate$1(e,t){var r=this,n=new a((function(t,n){r.ready().then((function(){var i=r._dbInfo;i.db.transaction((function(r){tryExecuteSql(r,i,"SELECT * FROM "+i.storeName,[],(function(r,n){for(var a=n.rows,o=a.length,s=0;s<o;s++){var u=a.item(s),l=u.value;if(l&&(l=i.serializer.deserialize(l)),void 0!==(l=e(l,u.key,s+1)))return void t(l)}t()}),(function(e,t){n(t)}))}))})).catch(n)}));return executeCallback(n,t),n},getItem:function getItem$1(e,t){var r=this;e=normalizeKey(e);var n=new a((function(t,n){r.ready().then((function(){var i=r._dbInfo;i.db.transaction((function(r){tryExecuteSql(r,i,"SELECT * FROM "+i.storeName+" WHERE key = ? LIMIT 1",[e],(function(e,r){var n=r.rows.length?r.rows.item(0).value:null;n&&(n=i.serializer.deserialize(n)),t(n)}),(function(e,t){n(t)}))}))})).catch(n)}));return executeCallback(n,t),n},setItem:function setItem$1(e,t,r){return _setItem.apply(this,[e,t,r,1])},removeItem:function removeItem$1(e,t){var r=this;e=normalizeKey(e);var n=new a((function(t,n){r.ready().then((function(){var i=r._dbInfo;i.db.transaction((function(r){tryExecuteSql(r,i,"DELETE FROM "+i.storeName+" WHERE key = ?",[e],(function(){t()}),(function(e,t){n(t)}))}))})).catch(n)}));return executeCallback(n,t),n},clear:function clear$1(e){var t=this,r=new a((function(e,r){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){tryExecuteSql(t,n,"DELETE FROM "+n.storeName,[],(function(){e()}),(function(e,t){r(t)}))}))})).catch(r)}));return executeCallback(r,e),r},length:function length$1(e){var t=this,r=new a((function(e,r){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){tryExecuteSql(t,n,"SELECT COUNT(key) as c FROM "+n.storeName,[],(function(t,r){var n=r.rows.item(0).c;e(n)}),(function(e,t){r(t)}))}))})).catch(r)}));return executeCallback(r,e),r},key:function key$1(e,t){var r=this,n=new a((function(t,n){r.ready().then((function(){var i=r._dbInfo;i.db.transaction((function(r){tryExecuteSql(r,i,"SELECT key FROM "+i.storeName+" WHERE id = ? LIMIT 1",[e+1],(function(e,r){var n=r.rows.length?r.rows.item(0).key:null;t(n)}),(function(e,t){n(t)}))}))})).catch(n)}));return executeCallback(n,t),n},keys:function keys$1(e){var t=this,r=new a((function(e,r){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){tryExecuteSql(t,n,"SELECT key FROM "+n.storeName,[],(function(t,r){for(var n=[],i=0;i<r.rows.length;i++)n.push(r.rows.item(i).key);e(n)}),(function(e,t){r(t)}))}))})).catch(r)}));return executeCallback(r,e),r},dropInstance:function dropInstance$1(e,t){t=getCallback.apply(this,arguments);var r=this.config();(e="function"!==typeof e&&e||{}).name||(e.name=e.name||r.name,e.storeName=e.storeName||r.storeName);var n,i=this;return executeCallback(n=e.name?new a((function(t){var n;n=e.name===r.name?i._dbInfo.db:openDatabase(e.name,"","",0),e.storeName?t({db:n,storeNames:[e.storeName]}):t(function getAllStoreNames(e){return new a((function(t,r){e.transaction((function(n){n.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(r,n){for(var i=[],a=0;a<n.rows.length;a++)i.push(n.rows.item(a).name);t({db:e,storeNames:i})}),(function(e,t){r(t)}))}),(function(e){r(e)}))}))}(n))})).then((function(e){return new a((function(t,r){e.db.transaction((function(n){function dropTable(e){return new a((function(t,r){n.executeSql("DROP TABLE IF EXISTS "+e,[],(function(){t()}),(function(e,t){r(t)}))}))}for(var i=[],o=0,s=e.storeNames.length;o<s;o++)i.push(dropTable(e.storeNames[o]));a.all(i).then((function(){t()})).catch((function(e){r(e)}))}),(function(e){r(e)}))}))})):a.reject("Invalid arguments"),t),n}};function _getKeyPrefix(e,t){var r=e.name+"/";return e.storeName!==t.storeName&&(r+=e.storeName+"/"),r}function _isLocalStorageUsable(){return!function checkIfLocalStorageThrows(){try{return localStorage.setItem("_localforage_support_test",!0),localStorage.removeItem("_localforage_support_test"),!1}catch(e){return!0}}()||localStorage.length>0}var j={_driver:"localStorageWrapper",_initStorage:function _initStorage$2(e){var t={};if(e)for(var r in e)t[r]=e[r];return t.keyPrefix=_getKeyPrefix(e,this._defaultConfig),_isLocalStorageUsable()?(this._dbInfo=t,t.serializer=D,a.resolve()):a.reject()},_support:function isLocalStorageValid(){try{return"undefined"!==typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}(),iterate:function iterate$2(e,t){var r=this,n=r.ready().then((function(){for(var t=r._dbInfo,n=t.keyPrefix,i=n.length,a=localStorage.length,o=1,s=0;s<a;s++){var u=localStorage.key(s);if(0===u.indexOf(n)){var l=localStorage.getItem(u);if(l&&(l=t.serializer.deserialize(l)),void 0!==(l=e(l,u.substring(i),o++)))return l}}}));return executeCallback(n,t),n},getItem:function getItem$2(e,t){var r=this;e=normalizeKey(e);var n=r.ready().then((function(){var t=r._dbInfo,n=localStorage.getItem(t.keyPrefix+e);return n&&(n=t.serializer.deserialize(n)),n}));return executeCallback(n,t),n},setItem:function setItem$2(e,t,r){var n=this;e=normalizeKey(e);var i=n.ready().then((function(){void 0===t&&(t=null);var r=t;return new a((function(i,a){var o=n._dbInfo;o.serializer.serialize(t,(function(t,n){if(n)a(n);else try{localStorage.setItem(o.keyPrefix+e,t),i(r)}catch(s){"QuotaExceededError"!==s.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==s.name||a(s),a(s)}}))}))}));return executeCallback(i,r),i},removeItem:function removeItem$2(e,t){var r=this;e=normalizeKey(e);var n=r.ready().then((function(){var t=r._dbInfo;localStorage.removeItem(t.keyPrefix+e)}));return executeCallback(n,t),n},clear:function clear$2(e){var t=this,r=t.ready().then((function(){for(var e=t._dbInfo.keyPrefix,r=localStorage.length-1;r>=0;r--){var n=localStorage.key(r);0===n.indexOf(e)&&localStorage.removeItem(n)}}));return executeCallback(r,e),r},length:function length$2(e){var t=this.keys().then((function(e){return e.length}));return executeCallback(t,e),t},key:function key$2(e,t){var r=this,n=r.ready().then((function(){var t,n=r._dbInfo;try{t=localStorage.key(e)}catch(i){t=null}return t&&(t=t.substring(n.keyPrefix.length)),t}));return executeCallback(n,t),n},keys:function keys$2(e){var t=this,r=t.ready().then((function(){for(var e=t._dbInfo,r=localStorage.length,n=[],i=0;i<r;i++){var a=localStorage.key(i);0===a.indexOf(e.keyPrefix)&&n.push(a.substring(e.keyPrefix.length))}return n}));return executeCallback(r,e),r},dropInstance:function dropInstance$2(e,t){if(t=getCallback.apply(this,arguments),!(e="function"!==typeof e&&e||{}).name){var r=this.config();e.name=e.name||r.name,e.storeName=e.storeName||r.storeName}var n,i=this;return executeCallback(n=e.name?new a((function(t){e.storeName?t(_getKeyPrefix(e,i._defaultConfig)):t(e.name+"/")})).then((function(e){for(var t=localStorage.length-1;t>=0;t--){var r=localStorage.key(t);0===r.indexOf(e)&&localStorage.removeItem(r)}})):a.reject("Invalid arguments"),t),n}},M=function sameValue(e,t){return e===t||"number"===typeof e&&"number"===typeof t&&isNaN(e)&&isNaN(t)},F=function includes(e,t){for(var r=e.length,n=0;n<r;){if(M(e[n],t))return!0;n++}return!1},I=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},L={},N={},B={INDEXEDDB:d,WEBSQL:P,LOCALSTORAGE:j},U=[B.INDEXEDDB._driver,B.WEBSQL._driver,B.LOCALSTORAGE._driver],z=["dropInstance"],q=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(z),W={description:"",driver:U.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function callWhenReady(e,t){e[t]=function(){var r=arguments;return e.ready().then((function(){return e[t].apply(e,r)}))}}function extend(){for(var e=1;e<arguments.length;e++){var t=arguments[e];if(t)for(var r in t)t.hasOwnProperty(r)&&(I(t[r])?arguments[0][r]=t[r].slice():arguments[0][r]=t[r])}return arguments[0]}var G=new(function(){function LocalForage(e){for(var t in function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,LocalForage),B)if(B.hasOwnProperty(t)){var r=B[t],n=r._driver;this[t]=n,L[n]||this.defineDriver(r)}this._defaultConfig=extend({},W),this._config=extend({},this._defaultConfig,e),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch((function(){}))}return LocalForage.prototype.config=function config(e){if("object"===("undefined"===typeof e?"undefined":n(e))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in e){if("storeName"===t&&(e[t]=e[t].replace(/\W/g,"_")),"version"===t&&"number"!==typeof e[t])return new Error("Database version must be a number.");this._config[t]=e[t]}return!("driver"in e&&e.driver)||this.setDriver(this._config.driver)}return"string"===typeof e?this._config[e]:this._config},LocalForage.prototype.defineDriver=function defineDriver(e,t,r){var n=new a((function(t,r){try{var n=e._driver,i=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)return void r(i);for(var o=q.concat("_initStorage"),s=0,u=o.length;s<u;s++){var l=o[s];if((!F(z,l)||e[l])&&"function"!==typeof e[l])return void r(i)}!function configureMissingMethods(){for(var t=function methodNotImplementedFactory(e){return function(){var t=new Error("Method "+e+" is not implemented by the current driver"),r=a.reject(t);return executeCallback(r,arguments[arguments.length-1]),r}},r=0,n=z.length;r<n;r++){var i=z[r];e[i]||(e[i]=t(i))}}();var c=function setDriverSupport(r){L[n]&&console.info("Redefining LocalForage driver: "+n),L[n]=e,N[n]=r,t()};"_support"in e?e._support&&"function"===typeof e._support?e._support().then(c,r):c(!!e._support):c(!0)}catch(f){r(f)}}));return executeTwoCallbacks(n,t,r),n},LocalForage.prototype.driver=function driver(){return this._driver||null},LocalForage.prototype.getDriver=function getDriver(e,t,r){var n=L[e]?a.resolve(L[e]):a.reject(new Error("Driver not found."));return executeTwoCallbacks(n,t,r),n},LocalForage.prototype.getSerializer=function getSerializer(e){var t=a.resolve(D);return executeTwoCallbacks(t,e),t},LocalForage.prototype.ready=function ready(e){var t=this,r=t._driverSet.then((function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready}));return executeTwoCallbacks(r,e,e),r},LocalForage.prototype.setDriver=function setDriver(e,t,r){var n=this;I(e)||(e=[e]);var i=this._getSupportedDrivers(e);function setDriverToConfig(){n._config.driver=n.driver()}function extendSelfWithDriver(e){return n._extend(e),setDriverToConfig(),n._ready=n._initStorage(n._config),n._ready}var o=null!==this._driverSet?this._driverSet.catch((function(){return a.resolve()})):a.resolve();return this._driverSet=o.then((function(){var e=i[0];return n._dbInfo=null,n._ready=null,n.getDriver(e).then((function(e){n._driver=e._driver,setDriverToConfig(),n._wrapLibraryMethodsWithReady(),n._initDriver=function initDriver(e){return function(){var t=0;return function driverPromiseLoop(){for(;t<e.length;){var r=e[t];return t++,n._dbInfo=null,n._ready=null,n.getDriver(r).then(extendSelfWithDriver).catch(driverPromiseLoop)}setDriverToConfig();var i=new Error("No available storage method found.");return n._driverSet=a.reject(i),n._driverSet}()}}(i)}))})).catch((function(){setDriverToConfig();var e=new Error("No available storage method found.");return n._driverSet=a.reject(e),n._driverSet})),executeTwoCallbacks(this._driverSet,t,r),this._driverSet},LocalForage.prototype.supports=function supports(e){return!!N[e]},LocalForage.prototype._extend=function _extend(e){extend(this,e)},LocalForage.prototype._getSupportedDrivers=function _getSupportedDrivers(e){for(var t=[],r=0,n=e.length;r<n;r++){var i=e[r];this.supports(i)&&t.push(i)}return t},LocalForage.prototype._wrapLibraryMethodsWithReady=function _wrapLibraryMethodsWithReady(){for(var e=0,t=q.length;e<t;e++)callWhenReady(this,q[e])},LocalForage.prototype.createInstance=function createInstance(e){return new LocalForage(e)},LocalForage}());t.exports=G},{3:3}]},{},[4])(4)}).call(this,r(18))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.oauthRedirectLink=t.OAUTH_PARAMS=t.REDIRECT_URI=t.GOOGLE_URL_ROOT=t.GOOGLE_CLIENT_ID=t.GOOGLE_AUTH_ENDPOINT=void 0;var n=_interopRequireDefault(r(153)),i=_interopRequireDefault(r(113));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var a=t.GOOGLE_AUTH_ENDPOINT="https://accounts.google.com/o/oauth2/auth",o=t.GOOGLE_CLIENT_ID="45471411055-ornt4svd2miog6dnopve7qtmh5mnu6id.apps.googleusercontent.com",s=(t.GOOGLE_URL_ROOT="https://www.googleapis.com/","http://127.0.0.1");n.default.location&&(s=n.default.location.origin);var u=t.REDIRECT_URI=s+"/auth/g/redirect",l=t.OAUTH_PARAMS={type:"web_server",client_id:o,redirect_uri:u,response_type:"code",scope:"https://www.googleapis.com/auth/userinfo.email",prompt:"select_account"};t.oauthRedirectLink=[a,i.default.stringify(l)].join("?")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getProfile=function getProfile(e){var t=e||"me";return n.get("v1/"+t+"/")};var n=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(36))},function(e,t,r){var n=r(291),i=r(293),a=r(66),o=r(294),s=r(295),u="application/json",l=function noop(){};e.exports=function xhrRequest(e,t,r){if(!e||"string"!==typeof e)throw new TypeError("must specify a URL");"function"===typeof t&&(r=t,t={});if(r&&"function"!==typeof r)throw new TypeError("expected cb to be undefined or a function");r=r||l;var c=(t=t||{}).json?"json":"text",f=(t=a({responseType:c},t)).headers||{},d=(t.method||"GET").toUpperCase(),h=t.query;h&&("string"!==typeof h&&(h=n.stringify(h)),e=i(e,h));"json"===t.responseType&&o(f,"Accept",u);t.json&&"GET"!==d&&"HEAD"!==d&&(o(f,"Content-Type",u),t.body=JSON.stringify(t.body));return t.method=d,t.url=e,t.headers=f,delete t.query,delete t.json,s(t,r)}},function(e,t,r){"use strict";var n=r(154),i=r(66),a=r(292);function encode(e,t){return t.encode?t.strict?n(e):encodeURIComponent(e):e}function extract(e){var t=e.indexOf("?");return-1===t?"":e.slice(t+1)}function parse(e,t){var r=function parserForArrayFormat(e){var t;switch(e.arrayFormat){case"index":return function(e,r,n){t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===n[e]&&(n[e]={}),n[e][t[1]]=r):n[e]=r};case"bracket":return function(e,r,n){t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==n[e]?n[e]=[].concat(n[e],r):n[e]=[r]:n[e]=r};default:return function(e,t,r){void 0!==r[e]?r[e]=[].concat(r[e],t):r[e]=t}}}(t=i({arrayFormat:"none"},t)),n=Object.create(null);return"string"!==typeof e?n:(e=e.trim().replace(/^[?#&]/,""))?(e.split("&").forEach((function(e){var t=e.replace(/\+/g," ").split("="),i=t.shift(),o=t.length>0?t.join("="):void 0;o=void 0===o?null:a(o),r(a(i),o,n)})),Object.keys(n).sort().reduce((function(e,t){var r=n[t];return Boolean(r)&&"object"===typeof r&&!Array.isArray(r)?e[t]=function keysSorter(e){return Array.isArray(e)?e.sort():"object"===typeof e?keysSorter(Object.keys(e)).sort((function(e,t){return Number(e)-Number(t)})).map((function(t){return e[t]})):e}(r):e[t]=r,e}),Object.create(null))):n}t.extract=extract,t.parse=parse,t.stringify=function(e,t){!1===(t=i({encode:!0,strict:!0,arrayFormat:"none"},t)).sort&&(t.sort=function(){});var r=function encoderForArrayFormat(e){switch(e.arrayFormat){case"index":return function(t,r,n){return null===r?[encode(t,e),"[",n,"]"].join(""):[encode(t,e),"[",encode(n,e),"]=",encode(r,e)].join("")};case"bracket":return function(t,r){return null===r?encode(t,e):[encode(t,e),"[]=",encode(r,e)].join("")};default:return function(t,r){return null===r?encode(t,e):[encode(t,e),"=",encode(r,e)].join("")}}}(t);return e?Object.keys(e).sort(t.sort).map((function(n){var i=e[n];if(void 0===i)return"";if(null===i)return encode(n,t);if(Array.isArray(i)){var a=[];return i.slice().forEach((function(e){void 0!==e&&a.push(r(n,e,a.length))})),a.join("&")}return encode(n,t)+"="+encode(i,t)})).filter((function(e){return e.length>0})).join("&"):""},t.parseUrl=function(e,t){return{url:e.split("?")[0]||"",query:parse(extract(e),t)}}},function(e,t,r){"use strict";var n=new RegExp("%[a-f0-9]{2}","gi"),i=new RegExp("(%[a-f0-9]{2})+","gi");function decodeComponents(e,t){try{return decodeURIComponent(e.join(""))}catch(i){}if(1===e.length)return e;t=t||1;var r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],decodeComponents(r),decodeComponents(n))}function decode(e){try{return decodeURIComponent(e)}catch(i){for(var t=e.match(n),r=1;r<t.length;r++)t=(e=decodeComponents(t,r).join("")).match(n);return e}}e.exports=function(e){if("string"!==typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function customDecodeURIComponent(e){for(var r={"%FE%FF":"\ufffd\ufffd","%FF%FE":"\ufffd\ufffd"},n=i.exec(e);n;){try{r[n[0]]=decodeURIComponent(n[0])}catch(t){var a=decode(n[0]);a!==n[0]&&(r[n[0]]=a)}n=i.exec(e)}r["%C2"]="\ufffd";for(var o=Object.keys(r),s=0;s<o.length;s++){var u=o[s];e=e.replace(new RegExp(u,"g"),r[u])}return e}(e)}}},function(e,t){e.exports=function urlSetQuery(e,t){if(t){t=(t=t.trim().replace(/^(\?|#|&)/,""))?"?"+t:t;var r=e.split(/[\?\#]/)[0];t&&/\:\/\/[^\/]*$/.test(r)&&(r+="/");var n=e.match(/(\#.*)$/);e=r+t,n&&(e+=n[0])}return e}},function(e,t){e.exports=function ensureHeader(e,t,r){var n=t.toLowerCase();e[t]||e[n]||(e[t]=r)}},function(e,t,r){var n=r(296),i=r(315),a=function noop(){};e.exports=function xhrRequest(e,t){delete e.uri;var r=!1;"json"===e.responseType&&(e.responseType="text",r=!0);var o=n(e,(function xhrRequestResult(n,o,s){if(r&&!n)try{var u=o.rawRequest.responseText;s=JSON.parse(u)}catch(l){n=l}o=i(e,o),t(n,n?null:s,o),t=a})),s=o.onabort;return o.onabort=function(){var e=s.apply(o,Array.prototype.slice.call(arguments));return t(new Error("XHR Aborted")),t=a,e},o}},function(e,t,r){"use strict";var n=r(297),i=r(155),a=r(298),o=r(75);function initParams(e,t,r){var n=e;return i(t)?(r=t,"string"===typeof e&&(n={uri:e})):n=o(t,{uri:e}),n.callback=r,n}function createXHR(e,t,r){return _createXHR(t=initParams(e,t,r))}function _createXHR(e){if("undefined"===typeof e.callback)throw new Error("callback argument missing");var t=!1,r=function cbOnce(r,n,i){t||(t=!0,e.callback(r,n,i))};function getBody(){var e=void 0;if(e=o.response?o.response:o.responseText||function getXml(e){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch(r){}return null}(o),h)try{e=JSON.parse(e)}catch(t){}return e}function errorFunc(e){return clearTimeout(s),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,r(e,p)}function loadFunc(){if(!i){var t;clearTimeout(s),t=e.useXDR&&void 0===o.status?200:1223===o.status?204:o.status;var n=p,c=null;return 0!==t?(n={body:getBody(),statusCode:t,method:l,headers:{},url:u,rawRequest:o},o.getAllResponseHeaders&&(n.headers=a(o.getAllResponseHeaders()))):c=new Error("Internal XMLHttpRequest Error"),r(c,n,n.body)}}var n,i,o=e.xhr||null;o||(o=e.cors||e.useXDR?new createXHR.XDomainRequest:new createXHR.XMLHttpRequest);var s,u=o.url=e.uri||e.url,l=o.method=e.method||"GET",c=e.body||e.data,f=o.headers=e.headers||{},d=!!e.sync,h=!1,p={body:void 0,headers:{},statusCode:0,method:l,url:u,rawRequest:o};if("json"in e&&!1!==e.json&&(h=!0,f.accept||f.Accept||(f.Accept="application/json"),"GET"!==l&&"HEAD"!==l&&(f["content-type"]||f["Content-Type"]||(f["Content-Type"]="application/json"),c=JSON.stringify(!0===e.json?c:e.json))),o.onreadystatechange=function readystatechange(){4===o.readyState&&setTimeout(loadFunc,0)},o.onload=loadFunc,o.onerror=errorFunc,o.onprogress=function(){},o.onabort=function(){i=!0},o.ontimeout=errorFunc,o.open(l,u,!d,e.username,e.password),d||(o.withCredentials=!!e.withCredentials),!d&&e.timeout>0&&(s=setTimeout((function(){if(!i){i=!0,o.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",errorFunc(e)}}),e.timeout)),o.setRequestHeader)for(n in f)f.hasOwnProperty(n)&&o.setRequestHeader(n,f[n]);else if(e.headers&&!function isEmpty(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(o.responseType=e.responseType),"beforeSend"in e&&"function"===typeof e.beforeSend&&e.beforeSend(o),o.send(c||null),o}e.exports=createXHR,e.exports.default=createXHR,createXHR.XMLHttpRequest=n.XMLHttpRequest||function noop(){},createXHR.XDomainRequest="withCredentials"in new createXHR.XMLHttpRequest?createXHR.XMLHttpRequest:n.XDomainRequest,function forEachArray(e,t){for(var r=0;r<e.length;r++)t(e[r])}(["get","put","post","patch","head","delete"],(function(e){createXHR["delete"===e?"del":e]=function(t,r,n){return(r=initParams(t,r,n)).method=e.toUpperCase(),_createXHR(r)}}))},function(e,t,r){(function(t){var r;r="undefined"!==typeof window?window:"undefined"!==typeof t?t:"undefined"!==typeof self?self:{},e.exports=r}).call(this,r(18))},function(e,t,r){var n=r(299),i=r(314);e.exports=function(e){if(!e)return{};var t={};return i(n(e).split("\n"),(function(e){var r=e.indexOf(":"),i=n(e.slice(0,r)).toLowerCase(),a=n(e.slice(r+1));"undefined"===typeof t[i]?t[i]=a:!function isArray(e){return"[object Array]"===Object.prototype.toString.call(e)}(t[i])?t[i]=[t[i],a]:t[i].push(a)})),t}},function(e,t,r){"use strict";var n=r(73),i=r(156),a=r(158),o=r(159),s=r(313),u=n.call(Function.call,o());i(u,{getPolyfill:o,implementation:a,shim:s}),e.exports=u},function(e,t,r){"use strict";var n="Function.prototype.bind called on incompatible ",i=Array.prototype.slice,a=Object.prototype.toString;e.exports=function bind(e){var t=this;if("function"!==typeof t||"[object Function]"!==a.call(t))throw new TypeError(n+t);for(var r,o=i.call(arguments,1),s=function binder(){if(this instanceof r){var n=t.apply(this,o.concat(i.call(arguments)));return Object(n)===n?n:this}return t.apply(e,o.concat(i.call(arguments)))},u=Math.max(0,t.length-o.length),l=[],c=0;c<u;c++)l.push("$"+c);if(r=Function("binder","return function ("+l.join(",")+"){ return binder.apply(this,arguments); }")(s),t.prototype){var f=function Empty(){};f.prototype=t.prototype,r.prototype=new f,f.prototype=null}return r}},function(e,t,r){"use strict";var n=Array.prototype.slice,i=r(157),a=Object.keys,o=a?function keys(e){return a(e)}:r(302),s=Object.keys;o.shim=function shimObjectKeys(){Object.keys?function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2)||(Object.keys=function keys(e){return i(e)?s(n.call(e)):s(e)}):Object.keys=o;return Object.keys||o},e.exports=o},function(e,t,r){"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,a=Object.prototype.toString,o=r(157),s=Object.prototype.propertyIsEnumerable,u=!s.call({toString:null},"toString"),l=s.call((function(){}),"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function equalsConstructorPrototype(e){var t=e.constructor;return t&&t.prototype===e},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},h=function(){if("undefined"===typeof window)return!1;for(var e in window)try{if(!d["$"+e]&&i.call(window,e)&&null!==window[e]&&"object"===typeof window[e])try{f(window[e])}catch(t){return!0}}catch(t){return!0}return!1}();n=function keys(e){var t=null!==e&&"object"===typeof e,r="[object Function]"===a.call(e),n=o(e),s=t&&"[object String]"===a.call(e),d=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var p=l&&r;if(s&&e.length>0&&!i.call(e,0))for(var g=0;g<e.length;++g)d.push(String(g));if(n&&e.length>0)for(var m=0;m<e.length;++m)d.push(String(m));else for(var v in e)p&&"prototype"===v||!i.call(e,v)||d.push(String(v));if(u)for(var y=function equalsConstructorPrototypeIfNotBuggy(e){if("undefined"===typeof window||!h)return f(e);try{return f(e)}catch(t){return!1}}(e),_=0;_<c.length;++_)y&&"constructor"===c[_]||!i.call(e,c[_])||d.push(c[_]);return d}}e.exports=n},function(e,t,r){"use strict";var n=r(74),i=n("%Object%"),a=n("%TypeError%"),o=n("%String%"),s=n("%Number%"),u=r(304),l=r(305),c=r(306),f=r(307),d=r(308),h=r(309),p=r(116),g=r(310),m=r(115),v=r(312)(o.prototype.slice),y=function isPrefixOf(e,t){return e===t||!(e.length>t.length)&&v(t,0,e.length)===e},_={ToPrimitive:g,ToBoolean:function ToBoolean(e){return!!e},ToNumber:function ToNumber(e){return+e},ToInteger:function ToInteger(e){var t=this.ToNumber(e);return c(t)?0:0!==t&&f(t)?d(t)*Math.floor(Math.abs(t)):t},ToInt32:function ToInt32(e){return this.ToNumber(e)>>0},ToUint32:function ToUint32(e){return this.ToNumber(e)>>>0},ToUint16:function ToUint16(e){var t=this.ToNumber(e);if(c(t)||0===t||!f(t))return 0;var r=d(t)*Math.floor(Math.abs(t));return h(r,65536)},ToString:function ToString(e){return o(e)},ToObject:function ToObject(e){return this.CheckObjectCoercible(e),i(e)},CheckObjectCoercible:function CheckObjectCoercible(e,t){if(null==e)throw new a(t||"Cannot call method on "+e);return e},IsCallable:p,SameValue:function SameValue(e,t){return e===t?0!==e||1/e===1/t:c(e)&&c(t)},Type:function Type(e){return null===e?"Null":"undefined"===typeof e?"Undefined":"function"===typeof e||"object"===typeof e?"Object":"number"===typeof e?"Number":"boolean"===typeof e?"Boolean":"string"===typeof e?"String":void 0},IsPropertyDescriptor:function IsPropertyDescriptor(e){return l(this,e)},IsAccessorDescriptor:function IsAccessorDescriptor(e){return"undefined"!==typeof e&&(u(this,"Property Descriptor","Desc",e),!(!m(e,"[[Get]]")&&!m(e,"[[Set]]")))},IsDataDescriptor:function IsDataDescriptor(e){return"undefined"!==typeof e&&(u(this,"Property Descriptor","Desc",e),!(!m(e,"[[Value]]")&&!m(e,"[[Writable]]")))},IsGenericDescriptor:function IsGenericDescriptor(e){return"undefined"!==typeof e&&(u(this,"Property Descriptor","Desc",e),!this.IsAccessorDescriptor(e)&&!this.IsDataDescriptor(e))},FromPropertyDescriptor:function FromPropertyDescriptor(e){if("undefined"===typeof e)return e;if(u(this,"Property Descriptor","Desc",e),this.IsDataDescriptor(e))return{value:e["[[Value]]"],writable:!!e["[[Writable]]"],enumerable:!!e["[[Enumerable]]"],configurable:!!e["[[Configurable]]"]};if(this.IsAccessorDescriptor(e))return{get:e["[[Get]]"],set:e["[[Set]]"],enumerable:!!e["[[Enumerable]]"],configurable:!!e["[[Configurable]]"]};throw new a("FromPropertyDescriptor must be called with a fully populated Property Descriptor")},ToPropertyDescriptor:function ToPropertyDescriptor(e){if("Object"!==this.Type(e))throw new a("ToPropertyDescriptor requires an object");var t={};if(m(e,"enumerable")&&(t["[[Enumerable]]"]=this.ToBoolean(e.enumerable)),m(e,"configurable")&&(t["[[Configurable]]"]=this.ToBoolean(e.configurable)),m(e,"value")&&(t["[[Value]]"]=e.value),m(e,"writable")&&(t["[[Writable]]"]=this.ToBoolean(e.writable)),m(e,"get")){var r=e.get;if("undefined"!==typeof r&&!this.IsCallable(r))throw new TypeError("getter must be a function");t["[[Get]]"]=r}if(m(e,"set")){var n=e.set;if("undefined"!==typeof n&&!this.IsCallable(n))throw new a("setter must be a function");t["[[Set]]"]=n}if((m(t,"[[Get]]")||m(t,"[[Set]]"))&&(m(t,"[[Value]]")||m(t,"[[Writable]]")))throw new a("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t},"Abstract Equality Comparison":function AbstractEqualityComparison(e,t){var r=this.Type(e),n=this.Type(t);return r===n?e===t:null==e&&null==t||("Number"===r&&"String"===n?this["Abstract Equality Comparison"](e,this.ToNumber(t)):"String"===r&&"Number"===n?this["Abstract Equality Comparison"](this.ToNumber(e),t):"Boolean"===r?this["Abstract Equality Comparison"](this.ToNumber(e),t):"Boolean"===n?this["Abstract Equality Comparison"](e,this.ToNumber(t)):"String"!==r&&"Number"!==r||"Object"!==n?"Object"===r&&("String"===n||"Number"===n)&&this["Abstract Equality Comparison"](this.ToPrimitive(e),t):this["Abstract Equality Comparison"](e,this.ToPrimitive(t)))},"Strict Equality Comparison":function StrictEqualityComparison(e,t){var r=this.Type(e);return r===this.Type(t)&&("Undefined"===r||"Null"===r||e===t)},"Abstract Relational Comparison":function AbstractRelationalComparison(e,t,r){if("Boolean"!==this.Type(r))throw new a("Assertion failed: LeftFirst argument must be a Boolean");var n,i;if(r?(n=this.ToPrimitive(e,s),i=this.ToPrimitive(t,s)):(i=this.ToPrimitive(t,s),n=this.ToPrimitive(e,s)),!("String"===this.Type(n)&&"String"===this.Type(i))){var o=this.ToNumber(n),u=this.ToNumber(i);if(c(o)||c(u))return;return(!f(o)||!f(u)||o!==u)&&((0!==o||0!==u)&&(o!==1/0&&(u===1/0||u!==-1/0&&(o===-1/0||o<u))))}return!y(i,n)&&(!!y(n,i)||n<i)}};e.exports=_},function(e,t,r){"use strict";var n=r(74),i=n("%TypeError%"),a=n("%SyntaxError%"),o=r(115),s={"Property Descriptor":function isPropertyDescriptor(e,t){if("Object"!==e.Type(t))return!1;var r={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in t)if(o(t,n)&&!r[n])return!1;var a=o(t,"[[Value]]"),s=o(t,"[[Get]]")||o(t,"[[Set]]");if(a&&s)throw new i("Property Descriptors may not be both accessor and data descriptors");return!0}};e.exports=function assertRecord(e,t,r,n){var o=s[t];if("function"!==typeof o)throw new a("unknown record type: "+t);if(!o(e,n))throw new i(r+" must be a "+t)}},function(e,t,r){"use strict";var n=r(74),i=r(115),a=n("%TypeError%");e.exports=function IsPropertyDescriptor(e,t){if("Object"!==e.Type(t))return!1;var r={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in t)if(i(t,n)&&!r[n])return!1;if(e.IsDataDescriptor(t)&&e.IsAccessorDescriptor(t))throw new a("Property Descriptors may not be both accessor and data descriptors");return!0}},function(e,t,r){"use strict";e.exports=Number.isNaN||function isNaN(e){return e!==e}},function(e,t,r){"use strict";var n=Number.isNaN||function(e){return e!==e};e.exports=Number.isFinite||function(e){return"number"===typeof e&&!n(e)&&e!==1/0&&e!==-1/0}},function(e,t,r){"use strict";e.exports=function sign(e){return e>=0?1:-1}},function(e,t,r){"use strict";e.exports=function mod(e,t){var r=e%t;return Math.floor(r>=0?r:r+t)}},function(e,t,r){"use strict";var n=Object.prototype.toString,i=r(311),a=r(116),o=function DefaultValue(e){var t;if((t=arguments.length>1?arguments[1]:"[object Date]"===n.call(e)?String:Number)===String||t===Number){var r,o,s=t===String?["toString","valueOf"]:["valueOf","toString"];for(o=0;o<s.length;++o)if(a(e[s[o]])&&(r=e[s[o]](),i(r)))return r;throw new TypeError("No default value")}throw new TypeError("invalid [[DefaultValue]] hint supplied")};e.exports=function ToPrimitive(e){return i(e)?e:arguments.length>1?o(e,arguments[1]):o(e)}},function(e,t){e.exports=function isPrimitive(e){return null===e||"function"!==typeof e&&"object"!==typeof e}},function(e,t,r){"use strict";var n=r(73),i=r(74)("%Function%"),a=i.apply,o=i.call;e.exports=function callBind(){return n.apply(o,arguments)},e.exports.apply=function applyBind(){return n.apply(a,arguments)}},function(e,t,r){"use strict";var n=r(156),i=r(159);e.exports=function shimStringTrim(){var e=i();return n(String.prototype,{trim:e},{trim:function testTrim(){return String.prototype.trim!==e}}),e}},function(e,t,r){"use strict";var n=r(116),i=Object.prototype.toString,a=Object.prototype.hasOwnProperty,o=function forEachArray(e,t,r){for(var n=0,i=e.length;n<i;n++)a.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))},s=function forEachString(e,t,r){for(var n=0,i=e.length;n<i;n++)null==r?t(e.charAt(n),n,e):t.call(r,e.charAt(n),n,e)},u=function forEachObject(e,t,r){for(var n in e)a.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))};e.exports=function forEach(e,t,r){if(!n(t))throw new TypeError("iterator must be a function");var a;arguments.length>=3&&(a=r),"[object Array]"===i.call(e)?o(e,t,a):"string"===typeof e?s(e,t,a):u(e,t,a)}},function(e,t){e.exports=function getResponse(e,t){return t?{statusCode:t.statusCode,headers:t.headers,method:e.method,url:e.url,rawRequest:t.rawRequest?t.rawRequest:t}:null}},function(e,t,r){"use strict";var n=r(317),i=r(318),a=r(161);e.exports=function httpStatusError(e){return n("number"===typeof e,"expected http status number"),a(e)?function createError(e){var t=new Error(i[e]+" ("+e+")");return t.statusCode=e,t}(e):null}},function(e,t,r){"use strict";e.exports=function assertOk(e,t){if(!e)throw new Error(t||"Expected true, got "+e)}},function(e,t){e.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},function(e,t){e.exports=function SafeParseCallback(e,t,r){2===arguments.length&&(r=t,t=null);var n;try{n=JSON.parse(e,t)}catch(i){return r(i)}r(null,n)}},function(e,t,r){"use strict";e.exports=function(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}},function(e,t,r){"use strict";var n=r(322),i=r(323),a=r(334);e.exports=a(i,n.stringify)},function(e,t,r){"use strict";var n=r(154);t.extract=function(e){return e.split("?")[1]||""},t.parse=function(e){return"string"!==typeof e?{}:(e=e.trim().replace(/^(\?|#|&)/,""))?e.split("&").reduce((function(e,t){var r=t.replace(/\+/g," ").split("="),n=r.shift(),i=r.length>0?r.join("="):void 0;return n=decodeURIComponent(n),i=void 0===i?null:decodeURIComponent(i),e.hasOwnProperty(n)?Array.isArray(e[n])?e[n].push(i):e[n]=[e[n],i]:e[n]=i,e}),{}):{}},t.stringify=function(e){return e?Object.keys(e).sort().map((function(t){var r=e[t];return void 0===r?"":null===r?t:Array.isArray(r)?r.slice().sort().map((function(e){return n(t)+"="+n(e)})).join("&"):n(t)+"="+n(r)})).filter((function(e){return e.length>0})).join("&"):""}},function(e,t,r){"use strict";var n=r(324),i=r(325),a=r(328),o=r(329),s=r(160),u=r(330);function flatten(e,t){return a(t,(function(t,r){return[e+"["+t+"]",u(r)]}))}e.exports=function objectQuery(e){return n(e)?function format(e){return i(e,(function(e,t,r){var i=n(t)?flatten:o;return s(e,i(r,t))}),{})}(e):e}},function(e,t,r){"use strict";var n=Object.prototype.toString;e.exports=function(e){var t;return"[object Object]"===n.call(e)&&(null===(t=Object.getPrototypeOf(e))||t===Object.getPrototypeOf({}))}},function(e,t,r){"use strict";var n=r(326);e.exports=function reduce(e,t,r,i){var a=arguments.length>2;return!e||Object.keys(e).length||a?(n(e,(function(e,n,o){a?r=t.call(i,r,e,n,o):(r=e,a=!0)})),r):null}},function(e,t,r){"use strict";var n=r(327),i=Object.prototype.hasOwnProperty;e.exports=function forOwn(e,t,r){n(e,(function(n,a){if(i.call(e,a))return t.call(r,e[a],a,e)}))}},function(e,t,r){"use strict";e.exports=function forIn(e,t,r){for(var n in e)if(!1===t.call(r,e[n],n,e))break}},function(e,t,r){"use strict";e.exports=function(e,t){for(var r={},n=Object.keys(e),i=0;i<n.length;i++){var a=n[i],o=t(a,e[a],e);r[o[0]]=o[1]}return r}},function(e,t,r){"use strict";e.exports=function objectPair(e,t){var r={};return r[e]=t,r}},function(e,t,r){"use strict";var n=r(331),i=r(333);function stringify(e){return i(e,null,"")}e.exports=function print(e){return(function isJson(e){return n(e)||Array.isArray(e)}(e)?stringify:String)(e)}},function(e,t,r){"use strict";var n=r(332);e.exports=function isObject(e){return null!=e&&"object"===typeof e&&!n(e)}},function(e,t){e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},function(e,t){function serializer(e,t){var r=[],n=[];return null==t&&(t=function cycleReplacer(e,t){return r[0]===t?"[Circular ~]":"[Circular ~."+n.slice(0,r.indexOf(t)).join(".")+"]"}),function(i,a){if(r.length>0){var o=r.indexOf(this);~o?r.splice(o+1):r.push(this),~o?n.splice(o,1/0,i):n.push(i),~r.indexOf(a)&&(a=t.call(this,i,a))}else r.push(a);return null==e?a:e.call(this,i,a)}}(e.exports=function stringify(e,t,r,n){return JSON.stringify(e,serializer(t,n),r)}).getSerialize=serializer},function(e,t,r){"use strict";e.exports=function valuePipe(e){if(!e)throw new TypeError("At least one function is required");Array.isArray(e)||(e=Array.prototype.slice.call(arguments));return function valuePipeline(t){for(var r=0;r<e.length;r++)t=e[r](t);return t}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(162));t.createAnnotation=function createAnnotation(e){if((e=a.AnnotationValidator.validate(e)).error)throw e.error;return e=e.value,i.post("v1/annotations/new",e)},t.getAnnotation=function getAnnotation(e){return i.get("v1/annotations/"+e)},t.updateAnnotation=function updateAnnotation(e,t){return i.patch("v1/annotations/"+e,{data:t})},t.listAnnotations=function listAnnotations(e,t,r){if(!r.length)throw new Error("Invalid or empty dongleId");var n=verifyAnnotationStartEnd(e,t),a=n.start,o=n.end;return i.get("v1/devices/"+r+"/annotations/",{from:a,to:o})},t.listMyAnnotations=function listMyAnnotations(e,t){var r=verifyAnnotationStartEnd(e,t),n=r.start,a=r.end;return i.get("v1/me/annotations/",{from:n,to:a})};var i=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(36)),a=r(338);function verifyAnnotationStartEnd(e,t){if(e=Number(e),t=Number(t),!(0,n.default)(e))throw new Error("Invalid start time");if(!(0,n.default)(t))throw new Error("Invalid end time");return{start:e,end:t}}},function(e,t,r){r(337),e.exports=r(20).Number.isFinite},function(e,t,r){var n=r(29),i=r(22).isFinite;n(n.S,"Number",{isFinite:function isFinite(e){return"number"==typeof e&&i(e)}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(339);t.AnnotationValidator=n.object().keys({canonical_segment_name:n.string().required(),offset_nanos_part:n.number().required(),offset_millis:n.number().required(),start_time_utc_millis:n.number().required(),end_time_utc_millis:n.number().required(),type:n.string().required(),data:n.object().keys({reason:n.string().required(),comment:n.string().allow("").optional()})})},function(e,t,r){!function webpackUniversalModuleDefinition(t,r){e.exports=r()}(0,(function(){return function(e){var t={};function __webpack_require__(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,__webpack_require__),n.l=!0,n.exports}return __webpack_require__.m=e,__webpack_require__.c=t,__webpack_require__.i=function(e){return e},__webpack_require__.d=function(e,t,r){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},__webpack_require__.n=function(e){var t=e&&e.__esModule?function getDefault(){return e.default}:function getModuleExports(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=32)}([function(e,t,r){"use strict";(function(e,n){var i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=r(17),o=r(15),s=r(37),u=r(16),l=r(18),c={};t.clone=function(r,n){if("object"!==("undefined"===typeof r?"undefined":i(r))||null===r)return r;var a=(n=n||new Map).get(r);if(a)return a;var o=void 0,s=!1;if(Array.isArray(r))o=[],s=!0;else if(e.isBuffer(r))o=e.from(r);else if(r instanceof Date)o=new Date(r.getTime());else if(r instanceof RegExp)o=new RegExp(r);else{var u=Object.getPrototypeOf(r);u&&u.isImmutable?o=r:(o=Object.create(u),s=!0)}if(n.set(r,o),s)for(var l=Object.getOwnPropertyNames(r),c=0;c<l.length;++c){var f=l[c],d=Object.getOwnPropertyDescriptor(r,f);d&&(d.get||d.set)?Object.defineProperty(o,f,d):o[f]=t.clone(r[f],n)}return o},t.merge=function(r,n,a,o){if(t.assert(r&&"object"===("undefined"===typeof r?"undefined":i(r)),"Invalid target value: must be an object"),t.assert(null===n||void 0===n||"object"===("undefined"===typeof n?"undefined":i(n)),"Invalid source value: must be null, undefined, or an object"),!n)return r;if(Array.isArray(n)){t.assert(Array.isArray(r),"Cannot merge array onto an object"),!1===o&&(r.length=0);for(var s=0;s<n.length;++s)r.push(t.clone(n[s]));return r}for(var u=Object.keys(n),l=0;l<u.length;++l){var c=u[l];if("__proto__"!==c){var f=n[c];f&&"object"===("undefined"===typeof f?"undefined":i(f))?!r[c]||"object"!==i(r[c])||Array.isArray(r[c])!==Array.isArray(f)||f instanceof Date||e.isBuffer(f)||f instanceof RegExp?r[c]=t.clone(f):t.merge(r[c],f,a,o):null!==f&&void 0!==f?r[c]=f:!1!==a&&(r[c]=f)}}return r},t.applyToDefaults=function(e,r,n){if(t.assert(e&&"object"===("undefined"===typeof e?"undefined":i(e)),"Invalid defaults value: must be an object"),t.assert(!r||!0===r||"object"===("undefined"===typeof r?"undefined":i(r)),"Invalid options value: must be true, falsy or an object"),!r)return null;var a=t.clone(e);return!0===r?a:t.merge(a,r,!0===n,!1)},t.cloneWithShallow=function(e,r){if(!e||"object"!==("undefined"===typeof e?"undefined":i(e)))return e;var n=c.store(e,r),a=t.clone(e);return c.restore(a,e,n),a},c.store=function(e,r){for(var n={},i=0;i<r.length;++i){var a=r[i],o=t.reach(e,a);void 0!==o&&(n[a]=o,c.reachSet(e,a,void 0))}return n},c.restore=function(e,t,r){for(var n=Object.keys(r),i=0;i<n.length;++i){var a=n[i];c.reachSet(e,a,r[a]),c.reachSet(t,a,r[a])}},c.reachSet=function(e,t,r){for(var n=t.split("."),i=e,a=0;a<n.length;++a){var o=n[a];a+1===n.length&&(i[o]=r),i=i[o]}},t.applyToDefaultsWithShallow=function(e,r,n){if(t.assert(e&&"object"===("undefined"===typeof e?"undefined":i(e)),"Invalid defaults value: must be an object"),t.assert(!r||!0===r||"object"===("undefined"===typeof r?"undefined":i(r)),"Invalid options value: must be true, falsy or an object"),t.assert(n&&Array.isArray(n),"Invalid keys"),!r)return null;var a=t.cloneWithShallow(e,n);if(!0===r)return a;var o=c.store(r,n);return t.merge(a,r,!1,!1),c.restore(a,r,o),a},t.deepEqual=function(r,n,a,o){a=a||{prototype:!0};var s="undefined"===typeof r?"undefined":i(r);if(s!==("undefined"===typeof n?"undefined":i(n)))return!1;if("object"!==s||null===r||null===n)return r===n?0!==r||1/r===1/n:r!==r&&n!==n;if(-1!==(o=o||[]).indexOf(r))return!0;if(o.push(r),Array.isArray(r)){if(!Array.isArray(n))return!1;if(!a.part&&r.length!==n.length)return!1;for(var u=0;u<r.length;++u){if(a.part){for(var l=!1,c=0;c<n.length;++c)if(t.deepEqual(r[u],n[c],a)){l=!0;break}return l}if(!t.deepEqual(r[u],n[u],a))return!1}return!0}if(e.isBuffer(r)){if(!e.isBuffer(n))return!1;if(r.length!==n.length)return!1;for(var f=0;f<r.length;++f)if(r[f]!==n[f])return!1;return!0}if(r instanceof Date)return n instanceof Date&&r.getTime()===n.getTime();if(r instanceof RegExp)return n instanceof RegExp&&r.toString()===n.toString();if(a.prototype&&Object.getPrototypeOf(r)!==Object.getPrototypeOf(n))return!1;var d=Object.getOwnPropertyNames(r);if(!a.part&&d.length!==Object.getOwnPropertyNames(n).length)return!1;for(var h=0;h<d.length;++h){var p=d[h],g=Object.getOwnPropertyDescriptor(r,p);if(g.get){if(!t.deepEqual(g,Object.getOwnPropertyDescriptor(n,p),a,o))return!1}else if(!t.deepEqual(r[p],n[p],a,o))return!1}return!0},t.unique=function(e,t){var r=void 0;if(t){r=[];var n=new Set;e.forEach((function(e){var i=e[t];n.has(i)||(n.add(i),r.push(e))}))}else r=Array.from(new Set(e));return r},t.mapToObject=function(e,t){if(!e)return null;for(var r={},n=0;n<e.length;++n)t?e[n][t]&&(r[e[n][t]]=!0):r[e[n]]=!0;return r},t.intersect=function(e,r,n){if(!e||!r)return[];for(var i=[],a=Array.isArray(e)?t.mapToObject(e):e,o={},s=0;s<r.length;++s)if(a[r[s]]&&!o[r[s]]){if(n)return r[s];i.push(r[s]),o[r[s]]=!0}return n?null:i},t.contain=function(e,r,n){var a=null;"object"!==("undefined"===typeof e?"undefined":i(e))||"object"!==("undefined"===typeof r?"undefined":i(r))||Array.isArray(e)||Array.isArray(r)?r=[].concat(r):(a=r,r=Object.keys(r)),n=n||{},t.assert("string"===typeof e||"object"===("undefined"===typeof e?"undefined":i(e)),"Reference must be string or an object"),t.assert(r.length,"Values array cannot be empty");var o=void 0,s=void 0;if(n.deep){o=t.deepEqual;var u=n.hasOwnProperty("only"),l=n.hasOwnProperty("part");s={prototype:u?n.only:!!l&&!n.part,part:u?!n.only:!l||n.part}}else o=function compare(e,t){return e===t};for(var c=!1,f=new Array(r.length),d=0;d<f.length;++d)f[d]=0;if("string"===typeof e){for(var h="(",p=0;p<r.length;++p){var g=r[p];t.assert("string"===typeof g,"Cannot compare string reference to non-string value"),h+=(p?"|":"")+t.escapeRegex(g)}var m=new RegExp(h+")","g");c=!!e.replace(m,(function(e,t){var n=r.indexOf(t);return++f[n],""}))}else if(Array.isArray(e))for(var v=0;v<e.length;++v){for(var y=!1,_=0;_<r.length&&!1===y;++_)y=o(r[_],e[v],s)&&_;!1!==y?++f[y]:c=!0}else for(var b=Object.getOwnPropertyNames(e),x=0;x<b.length;++x){var w=b[x],k=r.indexOf(w);if(-1!==k){if(a&&!o(a[w],e[w],s))return!1;++f[k]}else c=!0}for(var S=!1,E=0;E<f.length;++E)if(S=S||!!f[E],n.once&&f[E]>1||!n.part&&!f[E])return!1;return(!n.only||!c)&&S},t.flatten=function(e,r){for(var n=r||[],i=0;i<e.length;++i)Array.isArray(e[i])?t.flatten(e[i],n):n.push(e[i]);return n},t.reach=function(e,r,n){if(!1===r||null===r||"undefined"===typeof r)return e;"string"===typeof(n=n||{})&&(n={separator:n});for(var a=r.split(n.separator||"."),o=e,s=0;s<a.length;++s){var u=a[s];if("-"===u[0]&&Array.isArray(o)&&(u=u.slice(1,u.length),u=o.length-u),!o||"object"!==("undefined"===typeof o?"undefined":i(o))&&"function"!==typeof o||!(u in o)||"object"!==("undefined"===typeof o?"undefined":i(o))&&!1===n.functions){t.assert(!n.strict||s+1===a.length,"Missing segment",u,"in reach path ",r),t.assert("object"===("undefined"===typeof o?"undefined":i(o))||!0===n.functions||"function"!==typeof o,"Invalid segment",u,"in reach path ",r),o=n.default;break}o=o[u]}return o},t.reachTemplate=function(e,r,n){return r.replace(/{([^}]+)}/g,(function(r,i){var a=t.reach(e,i,n);return void 0===a||null===a?"":a}))},t.formatStack=function(e){for(var t=[],r=0;r<e.length;++r){var n=e[r];t.push([n.getFileName(),n.getLineNumber(),n.getColumnNumber(),n.getFunctionName(),n.isConstructor()])}return t},t.formatTrace=function(e){for(var t=[],r=0;r<e.length;++r){var n=e[r];t.push((n[4]?"new ":"")+n[3]+" ("+n[0]+":"+n[1]+":"+n[2]+")")}return t},t.callStack=function(e){var r=Error.prepareStackTrace;Error.prepareStackTrace=function(e,t){return t};var n={};Error.captureStackTrace(n,this);var i=n.stack;return Error.prepareStackTrace=r,t.formatStack(i).slice(1+e)},t.displayStack=function(e){var r=t.callStack(void 0===e?1:e+1);return t.formatTrace(r)},t.abortThrow=!1,t.abort=function(e,r){if("test"===n.env.NODE_ENV||!0===t.abortThrow)throw new Error(e||"Unknown error");var i="";r||(i=t.displayStack(1).join("\n\t")),console.log("ABORT: "+e+"\n\t"+i),n.exit(1)},t.assert=function(e){if(!e){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];if(1===n.length&&n[0]instanceof Error)throw n[0];var o=n.filter((function(e){return""!==e})).map((function(e){return"string"===typeof e?e:e instanceof Error?e.message:t.stringify(e)}));throw new a.AssertionError({message:o.join(" ")||"Unknown error",actual:!1,expected:!0,operator:"==",stackStartFunction:t.assert})}},t.Bench=function(){this.ts=0,this.reset()},t.Bench.prototype.reset=function(){this.ts=t.Bench.now()},t.Bench.prototype.elapsed=function(){return t.Bench.now()-this.ts},t.Bench.now=function(){var e=n.hrtime();return 1e3*e[0]+e[1]/1e6},t.escapeRegex=function(e){return e.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")},t.base64urlEncode=function(r,n){return t.assert("string"===typeof r||e.isBuffer(r),"value must be string or buffer"),(e.isBuffer(r)?r:e.from(r,n||"binary")).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")},t.base64urlDecode=function(t,r){if("string"!==typeof t)throw new Error("Value not a string");if(!/^[\w\-]*$/.test(t))throw new Error("Invalid character");var n=e.from(t,"base64");return"buffer"===r?n:n.toString(r||"binary")},t.escapeHeaderAttribute=function(e){return t.assert(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~\"\\]*$/.test(e),"Bad attribute value ("+e+")"),e.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')},t.escapeHtml=function(e){return l.escapeHtml(e)},t.escapeJavaScript=function(e){return l.escapeJavaScript(e)},t.escapeJson=function(e){return l.escapeJson(e)},t.once=function(e){if(e._hoekOnce)return e;var t=!1,r=function wrapped(){if(!t){t=!0;for(var r=arguments.length,n=Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(null,n)}};return r._hoekOnce=!0,r},t.isInteger=Number.isSafeInteger,t.ignore=function(){},t.inherits=u.inherits,t.format=u.format,t.transform=function(e,r,n){t.assert(null===e||void 0===e||"object"===("undefined"===typeof e?"undefined":i(e))||Array.isArray(e),"Invalid source object: must be null, undefined, an object, or an array");var a="object"===("undefined"===typeof n?"undefined":i(n))&&null!==n&&n.separator||".";if(Array.isArray(e)){for(var o=[],s=0;s<e.length;++s)o.push(t.transform(e[s],r,n));return o}for(var u={},l=Object.keys(r),c=0;c<l.length;++c){var f=l[c],d=f.split(a),h=r[f];t.assert("string"===typeof h,'All mappings must be "." delineated strings');for(var p=void 0,g=u;d.length>1;)g[p=d.shift()]||(g[p]={}),g=g[p];g[p=d.shift()]=t.reach(e,h,n)}return u},t.uniqueFilename=function(e,t){t=t?"."!==t[0]?"."+t:t:"",e=s.resolve(e);var r=[Date.now(),n.pid,o.randomBytes(8).toString("hex")].join("-")+t;return s.join(e,r)},t.stringify=function(){try{for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return JSON.stringify.apply(null,t)}catch(n){return"[Cannot display object: "+n.message+"]"}},t.shallow=function(e){for(var t={},r=Object.keys(e),n=0;n<r.length;++n){var i=r[n];t[i]=e[i]}return t},t.wait=function(e){return new Promise((function(t){return setTimeout(t,e)}))},t.block=function(){return new Promise(t.ignore)}}).call(t,r(3).Buffer,r(7))},function(e,t,r){"use strict";var n=r(0);t.create=function(e,t){n.assert("string"===typeof e,"Invalid reference key:",e);var r=n.clone(t),i=function ref(e,t){return n.reach(ref.isContext?t.context:e,ref.key,r)};return i.isContext=e[0]===(r&&r.contextPrefix||"$"),i.key=i.isContext?e.slice(1):e,i.path=i.key.split(r&&r.separator||"."),i.depth=i.path.length,i.root=i.path[0],i.isJoi=!0,i.toString=function(){return(i.isContext?"context:":"ref:")+i.key},i},t.isRef=function(e){return"function"===typeof e&&e.isJoi},t.push=function(e,r){t.isRef(r)&&!r.isContext&&e.push(r.root)}},function(e,t,r){"use strict";var n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&defineProperties(e.prototype,t),r&&defineProperties(e,r),e}}();var a=r(0),o=r(11),s=r(1),u=r(6),l=null,c=null,f={Set:r(9),defaults:{abortEarly:!0,convert:!0,allowUnknown:!1,skipFunctions:!1,stripUnknown:!1,language:{},presence:"optional",strip:!1,noDefaults:!1,escapeHtml:!1}};e.exports=f.Any=function(){function _class(){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,_class),c=c||r(4),this.isJoi=!0,this._type="any",this._settings=null,this._valids=new f.Set,this._invalids=new f.Set,this._tests=[],this._refs=[],this._flags={},this._description=null,this._unit=null,this._notes=[],this._tags=[],this._examples=[],this._meta=[],this._inner={}}return _class.prototype._init=function _init(){return this},_class.prototype.createError=function createError(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this._flags;return u.create(e,t,r,n,i)},_class.prototype.createOverrideError=function createOverrideError(e,t,r,n,i,a){return u.create(e,t,r,n,this._flags,i,a)},_class.prototype.checkOptions=function checkOptions(e){var t=r(21).options.validate(e);if(t.error)throw new Error(t.error.details[0].message)},_class.prototype.clone=function clone(){var e=Object.create(Object.getPrototypeOf(this));e.isJoi=!0,e._currentJoi=this._currentJoi,e._type=this._type,e._settings=this._settings,e._baseType=this._baseType,e._valids=this._valids.slice(),e._invalids=this._invalids.slice(),e._tests=this._tests.slice(),e._refs=this._refs.slice(),e._flags=a.clone(this._flags),e._description=this._description,e._unit=this._unit,e._notes=this._notes.slice(),e._tags=this._tags.slice(),e._examples=this._examples.slice(),e._meta=this._meta.slice(),e._inner={};for(var t=Object.keys(this._inner),r=0;r<t.length;++r){var n=t[r];e._inner[n]=this._inner[n]?this._inner[n].slice():null}return e},_class.prototype.concat=function concat(e){a.assert(e instanceof f.Any,"Invalid schema object"),a.assert("any"===this._type||"any"===e._type||e._type===this._type,"Cannot merge type",this._type,"with another type:",e._type);var t=this.clone();if("any"===this._type&&"any"!==e._type){for(var r=e.clone(),n=["_settings","_valids","_invalids","_tests","_refs","_flags","_description","_unit","_notes","_tags","_examples","_meta","_inner"],i=0;i<n.length;++i)r[n[i]]=t[n[i]];t=r}t._settings=t._settings?o.concat(t._settings,e._settings):e._settings,t._valids.merge(e._valids,e._invalids),t._invalids.merge(e._invalids,e._valids),t._tests=t._tests.concat(e._tests),t._refs=t._refs.concat(e._refs),a.merge(t._flags,e._flags),t._description=e._description||t._description,t._unit=e._unit||t._unit,t._notes=t._notes.concat(e._notes),t._tags=t._tags.concat(e._tags),t._examples=t._examples.concat(e._examples),t._meta=t._meta.concat(e._meta);for(var s=Object.keys(e._inner),u="object"===t._type,l=0;l<s.length;++l){var c=s[l],d=e._inner[c];if(d){var h=t._inner[c];if(h)if(u&&"children"===c){for(var p={},g=0;g<h.length;++g)p[h[g].key]=g;for(var m=0;m<d.length;++m){var v=d[m].key;p[v]>=0?h[p[v]]={key:v,schema:h[p[v]].schema.concat(d[m].schema)}:h.push(d[m])}}else t._inner[c]=t._inner[c].concat(d);else t._inner[c]=d.slice()}}return t},_class.prototype._test=function _test(e,t,r,n){var i=this.clone();return i._tests.push({func:r,name:e,arg:t,options:n}),i},_class.prototype.options=function options(e){a.assert(!e.context,"Cannot override context"),this.checkOptions(e);var t=this.clone();return t._settings=o.concat(t._settings,e),t},_class.prototype.strict=function strict(e){var t=this.clone(),r=void 0!==e&&!e;return t._settings=o.concat(t._settings,{convert:r}),t},_class.prototype.raw=function raw(e){var t=void 0===e||e;if(this._flags.raw===t)return this;var r=this.clone();return r._flags.raw=t,r},_class.prototype.error=function error(e){a.assert(e&&(e instanceof Error||"function"===typeof e),"Must provide a valid Error object or a function");var t=this.clone();return t._flags.error=e,t},_class.prototype.allow=function allow(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=this.clone();t=a.flatten(t);for(var i=0;i<t.length;++i){var o=t[i];a.assert(void 0!==o,"Cannot call allow/valid/invalid with undefined"),n._invalids.remove(o),n._valids.add(o,n._refs)}return n},_class.prototype.valid=function valid(){var e=this.allow.apply(this,arguments);return e._flags.allowOnly=!0,e},_class.prototype.invalid=function invalid(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=this.clone();t=a.flatten(t);for(var i=0;i<t.length;++i){var o=t[i];a.assert(void 0!==o,"Cannot call allow/valid/invalid with undefined"),n._valids.remove(o),n._invalids.add(o,n._refs)}return n},_class.prototype.required=function required(){if("required"===this._flags.presence)return this;var e=this.clone();return e._flags.presence="required",e},_class.prototype.optional=function optional(){if("optional"===this._flags.presence)return this;var e=this.clone();return e._flags.presence="optional",e},_class.prototype.forbidden=function forbidden(){if("forbidden"===this._flags.presence)return this;var e=this.clone();return e._flags.presence="forbidden",e},_class.prototype.strip=function strip(){if(this._flags.strip)return this;var e=this.clone();return e._flags.strip=!0,e},_class.prototype.applyFunctionToChildren=function applyFunctionToChildren(e,t,r,n){if(1!==(e=[].concat(e)).length||""!==e[0]){n=n?n+".":"";var i=(""===e[0]?e.slice(1):e).map((function(e){return n+e}));throw new Error("unknown key(s) "+i.join(", "))}return this[t].apply(this,r)},_class.prototype.default=function _default(e,t){"function"!==typeof e||s.isRef(e)||(!e.description&&t&&(e.description=t),this._flags.func||a.assert("string"===typeof e.description&&e.description.length>0,"description must be provided when default value is a function"));var r=this.clone();return r._flags.default=e,s.push(r._refs,e),r},_class.prototype.empty=function empty(e){var t=this.clone();return void 0===e?delete t._flags.empty:t._flags.empty=c.schema(this._currentJoi,e),t},_class.prototype.when=function when(e,t){a.assert(t&&"object"===("undefined"===typeof t?"undefined":n(t)),"Invalid options"),a.assert(void 0!==t.then||void 0!==t.otherwise,'options must have at least one of "then" or "otherwise"');var i=t.hasOwnProperty("then")?this.concat(c.schema(this._currentJoi,t.then)):void 0,o=t.hasOwnProperty("otherwise")?this.concat(c.schema(this._currentJoi,t.otherwise)):void 0;l=l||r(10);var s={then:i,otherwise:o};Object.prototype.hasOwnProperty.call(t,"is")&&(s.is=t.is);var u=l.when(e,s);return u._flags.presence="ignore",u._baseType=this,u},_class.prototype.description=function description(e){a.assert(e&&"string"===typeof e,"Description must be a non-empty string");var t=this.clone();return t._description=e,t},_class.prototype.notes=function notes(e){a.assert(e&&("string"===typeof e||Array.isArray(e)),"Notes must be a non-empty string or array");var t=this.clone();return t._notes=t._notes.concat(e),t},_class.prototype.tags=function tags(e){a.assert(e&&("string"===typeof e||Array.isArray(e)),"Tags must be a non-empty string or array");var t=this.clone();return t._tags=t._tags.concat(e),t},_class.prototype.meta=function meta(e){a.assert(void 0!==e,"Meta cannot be undefined");var t=this.clone();return t._meta=t._meta.concat(e),t},_class.prototype.example=function example(){a.assert(1===arguments.length,"Missing example");var e=arguments.length<=0?void 0:arguments[0],t=this.clone();return t._examples.push(e),t},_class.prototype.unit=function unit(e){a.assert(e&&"string"===typeof e,"Unit name must be a non-empty string");var t=this.clone();return t._unit=e,t},_class.prototype._prepareEmptyValue=function _prepareEmptyValue(e){return"string"===typeof e&&this._flags.trim?e.trim():e},_class.prototype._validate=function _validate(e,t,r,n){var i=this,l=e;t=t||{key:"",path:[],parent:null,reference:n},this._settings&&(r=o.concat(r,this._settings));var c=[],d=function finish(){var n=void 0;if(void 0!==e)n=i._flags.raw?l:e;else if(r.noDefaults)n=e;else if(s.isRef(i._flags.default))n=i._flags.default(t.parent,r);else if("function"!==typeof i._flags.default||i._flags.func&&!i._flags.default.description)n=a.clone(i._flags.default);else{var o=void 0;null!==t.parent&&i._flags.default.length>0&&(o=[a.clone(t.parent),r]);var u=f._try(i._flags.default,o);n=u.value,u.error&&c.push(i.createError("any.default",{error:u.error},t,r))}if(c.length&&"function"===typeof i._flags.error){var d=i._flags.error.call(i,c);c="string"===typeof d?[i.createOverrideError("override",{reason:c},t,r,d)]:[].concat(d).map((function(e){return e instanceof Error?e:i.createOverrideError(e.type||"override",e.context,t,r,e.message,e.template)}))}return{value:i._flags.strip?void 0:n,finalValue:n,errors:c.length?c:null}};if(this._coerce){var h=this._coerce.call(this,e,t,r);if(h.errors)return e=h.value,c=c.concat(h.errors),d();e=h.value}this._flags.empty&&!this._flags.empty._validate(this._prepareEmptyValue(e),null,f.defaults).errors&&(e=void 0);var p=this._flags.presence||r.presence;if("optional"===p){if(void 0===e){if(!(this._flags.hasOwnProperty("default")&&void 0===this._flags.default)||"object"!==this._type)return d();e={}}}else{if("required"===p&&void 0===e)return c.push(this.createError("any.required",null,t,r)),d();if("forbidden"===p)return void 0===e?d():(c.push(this.createError("any.unknown",null,t,r)),d())}if(this._valids.has(e,t,r,this._flags.insensitive))return d();if(this._invalids.has(e,t,r,this._flags.insensitive)&&(c.push(this.createError(""===e?"any.empty":"any.invalid",{value:e,invalids:this._invalids.values({stripUndefined:!0})},t,r)),r.abortEarly||void 0===e))return d();if(this._base){var g=this._base.call(this,e,t,r);if(g.errors)return e=g.value,c=c.concat(g.errors),d();if(g.value!==e){if(e=g.value,this._valids.has(e,t,r,this._flags.insensitive))return d();if(this._invalids.has(e,t,r,this._flags.insensitive)&&(c.push(this.createError(""===e?"any.empty":"any.invalid",{value:e,invalids:this._invalids.values({stripUndefined:!0})},t,r)),r.abortEarly))return d()}}if(this._flags.allowOnly&&(c.push(this.createError("any.allowOnly",{value:e,valids:this._valids.values({stripUndefined:!0})},t,r)),r.abortEarly))return d();for(var m=0;m<this._tests.length;++m){var v=this._tests[m].func.call(this,e,t,r);if(v instanceof u.Err){if(c.push(v),r.abortEarly)return d()}else e=v}return d()},_class.prototype._validateWithOptions=function _validateWithOptions(e,t,r){t&&this.checkOptions(t);var n=o.concat(f.defaults,t),i=this._validate(e,null,n),a=u.process(i.errors,e);return r?r(a,i.value):{error:a,value:i.value,then:function then(e,t){return a?Promise.reject(a).catch(t):Promise.resolve(i.value).then(e)},catch:function _catch(e){return a?Promise.reject(a).catch(e):Promise.resolve(i.value)}}},_class.prototype.validate=function validate(e,t,r){return"function"===typeof t?this._validateWithOptions(e,null,t):this._validateWithOptions(e,t,r)},_class.prototype.describe=function describe(){var e=this,t={type:this._type},r=Object.keys(this._flags);if(r.length)if(["empty","default","lazy","label"].some((function(t){return e._flags.hasOwnProperty(t)}))){t.flags={};for(var n=0;n<r.length;++n){var i=r[n];"empty"===i?t.flags[i]=this._flags[i].describe():"default"===i?s.isRef(this._flags[i])?t.flags[i]=this._flags[i].toString():"function"===typeof this._flags[i]?t.flags[i]={description:this._flags[i].description,function:this._flags[i]}:t.flags[i]=this._flags[i]:"lazy"===i||"label"===i||(t.flags[i]=this._flags[i])}}else t.flags=this._flags;this._settings&&(t.options=a.clone(this._settings)),this._baseType&&(t.base=this._baseType.describe()),this._description&&(t.description=this._description),this._notes.length&&(t.notes=this._notes),this._tags.length&&(t.tags=this._tags),this._meta.length&&(t.meta=this._meta),this._examples.length&&(t.examples=this._examples),this._unit&&(t.unit=this._unit);var o=this._valids.values();o.length&&(t.valids=o.map((function(e){return s.isRef(e)?e.toString():e})));var u=this._invalids.values();u.length&&(t.invalids=u.map((function(e){return s.isRef(e)?e.toString():e}))),t.rules=[];for(var l=0;l<this._tests.length;++l){var c=this._tests[l],f={name:c.name};void 0!==c.arg&&(f.arg=s.isRef(c.arg)?c.arg.toString():c.arg);var d=c.options;if(d){if(d.hasRef){f.arg={};for(var h=Object.keys(c.arg),p=0;p<h.length;++p){var g=h[p],m=c.arg[g];f.arg[g]=s.isRef(m)?m.toString():m}}"string"===typeof d.description?f.description=d.description:"function"===typeof d.description&&(f.description=d.description(f.arg))}t.rules.push(f)}t.rules.length||delete t.rules;var v=this._getLabel();return v&&(t.label=v),t},_class.prototype.label=function label(e){a.assert(e&&"string"===typeof e,"Label name must be a non-empty string");var t=this.clone();return t._flags.label=e,t},_class.prototype._getLabel=function _getLabel(e){return this._flags.label||e},i(_class,[{key:"schemaType",get:function get(){return this._type}}]),_class}(),f.Any.prototype.isImmutable=!0,f.Any.prototype.only=f.Any.prototype.equal=f.Any.prototype.valid,f.Any.prototype.disallow=f.Any.prototype.not=f.Any.prototype.invalid,f.Any.prototype.exist=f.Any.prototype.required,f._try=function(e,t){var r=void 0,n=void 0;try{n=e.apply(null,t)}catch(i){r=i}return{value:n,error:r}}},function(e,t,r){"use strict";(function(e){var n=r(33),i=r(34),a=r(35);function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(e,t){if(kMaxLength()<t)throw new RangeError("Invalid typed array length");return Buffer.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=Buffer.prototype:(null===e&&(e=new Buffer(t)),e.length=t),e}function Buffer(e,t,r){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer))return new Buffer(e,t,r);if("number"===typeof e){if("string"===typeof t)throw new Error("If encoding is specified then the first argument must be a string");return allocUnsafe(this,e)}return from(this,e,t,r)}function from(e,t,r,n){if("number"===typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!==typeof ArrayBuffer&&t instanceof ArrayBuffer?function fromArrayBuffer(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);Buffer.TYPED_ARRAY_SUPPORT?(e=t).__proto__=Buffer.prototype:e=fromArrayLike(e,t);return e}(e,t,r,n):"string"===typeof t?function fromString(e,t,r){"string"===typeof r&&""!==r||(r="utf8");if(!Buffer.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|byteLength(t,r),i=(e=createBuffer(e,n)).write(t,r);i!==n&&(e=e.slice(0,i));return e}(e,t,r):function fromObject(e,t){if(Buffer.isBuffer(t)){var r=0|checked(t.length);return 0===(e=createBuffer(e,r)).length?e:(t.copy(e,0,0,r),e)}if(t){if("undefined"!==typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!==typeof t.length||function isnan(e){return e!==e}(t.length)?createBuffer(e,0):fromArrayLike(e,t);if("Buffer"===t.type&&a(t.data))return fromArrayLike(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function assertSize(e){if("number"!==typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function allocUnsafe(e,t){if(assertSize(t),e=createBuffer(e,t<0?0:0|checked(t)),!Buffer.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function fromArrayLike(e,t){var r=t.length<0?0:0|checked(t.length);e=createBuffer(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function checked(e){if(e>=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return 0|e}function byteLength(e,t){if(Buffer.isBuffer(e))return e.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!==typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return utf8ToBytes(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return base64ToBytes(e).length;default:if(n)return utf8ToBytes(e).length;t=(""+t).toLowerCase(),n=!0}}function slowToString(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return hexSlice(this,t,r);case"utf8":case"utf-8":return utf8Slice(this,t,r);case"ascii":return asciiSlice(this,t,r);case"latin1":case"binary":return latin1Slice(this,t,r);case"base64":return base64Slice(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function swap(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function bidirectionalIndexOf(e,t,r,n,i){if(0===e.length)return-1;if("string"===typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"===typeof t&&(t=Buffer.from(t,n)),Buffer.isBuffer(t))return 0===t.length?-1:arrayIndexOf(e,t,r,n,i);if("number"===typeof t)return t&=255,Buffer.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):arrayIndexOf(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(e,t,r,n,i){var a,o=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,u/=2,r/=2}function read(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var l=-1;for(a=r;a<s;a++)if(read(e,a)===read(t,-1===l?0:a-l)){if(-1===l&&(l=a),a-l+1===u)return l*o}else-1!==l&&(a-=a-l),l=-1}else for(r+u>s&&(r=s-u),a=r;a>=0;a--){for(var c=!0,f=0;f<u;f++)if(read(e,a+f)!==read(t,f)){c=!1;break}if(c)return a}return-1}function hexWrite(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var a=t.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o<n;++o){var s=parseInt(t.substr(2*o,2),16);if(isNaN(s))return o;e[r+o]=s}return o}function utf8Write(e,t,r,n){return blitBuffer(utf8ToBytes(t,e.length-r),e,r,n)}function asciiWrite(e,t,r,n){return blitBuffer(function asciiToBytes(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function latin1Write(e,t,r,n){return asciiWrite(e,t,r,n)}function base64Write(e,t,r,n){return blitBuffer(base64ToBytes(t),e,r,n)}function ucs2Write(e,t,r,n){return blitBuffer(function utf16leToBytes(e,t){for(var r,n,i,a=[],o=0;o<e.length&&!((t-=2)<0);++o)r=e.charCodeAt(o),n=r>>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function base64Slice(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function utf8Slice(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var a,s,u,l,c=e[i],f=null,d=c>239?4:c>223?3:c>191?2:1;if(i+d<=r)switch(d){case 1:c<128&&(f=c);break;case 2:128===(192&(a=e[i+1]))&&(l=(31&c)<<6|63&a)>127&&(f=l);break;case 3:a=e[i+1],s=e[i+2],128===(192&a)&&128===(192&s)&&(l=(15&c)<<12|(63&a)<<6|63&s)>2047&&(l<55296||l>57343)&&(f=l);break;case 4:a=e[i+1],s=e[i+2],u=e[i+3],128===(192&a)&&128===(192&s)&&128===(192&u)&&(l=(15&c)<<18|(63&a)<<12|(63&s)<<6|63&u)>65535&&l<1114112&&(f=l)}null===f?(f=65533,d=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=d}return function decodeCodePointsArray(e){var t=e.length;if(t<=o)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=o));return r}(n)}t.Buffer=Buffer,t.SlowBuffer=function SlowBuffer(e){+e!=e&&(e=0);return Buffer.alloc(+e)},t.INSPECT_MAX_BYTES=50,Buffer.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function typedArraySupport(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function foo(){return 42}},42===e.foo()&&"function"===typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(t){return!1}}(),t.kMaxLength=kMaxLength(),Buffer.poolSize=8192,Buffer._augment=function(e){return e.__proto__=Buffer.prototype,e},Buffer.from=function(e,t,r){return from(null,e,t,r)},Buffer.TYPED_ARRAY_SUPPORT&&(Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,"undefined"!==typeof Symbol&&Symbol.species&&Buffer[Symbol.species]===Buffer&&Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:!0})),Buffer.alloc=function(e,t,r){return function alloc(e,t,r,n){return assertSize(t),t<=0?createBuffer(e,t):void 0!==r?"string"===typeof n?createBuffer(e,t).fill(r,n):createBuffer(e,t).fill(r):createBuffer(e,t)}(null,e,t,r)},Buffer.allocUnsafe=function(e){return allocUnsafe(null,e)},Buffer.allocUnsafeSlow=function(e){return allocUnsafe(null,e)},Buffer.isBuffer=function isBuffer(e){return!(null==e||!e._isBuffer)},Buffer.compare=function compare(e,t){if(!Buffer.isBuffer(e)||!Buffer.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},Buffer.isEncoding=function isEncoding(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Buffer.concat=function concat(e,t){if(!a(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return Buffer.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=Buffer.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var o=e[r];if(!Buffer.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},Buffer.byteLength=byteLength,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function swap16(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)swap(this,t,t+1);return this},Buffer.prototype.swap32=function swap32(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)swap(this,t,t+3),swap(this,t+1,t+2);return this},Buffer.prototype.swap64=function swap64(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)swap(this,t,t+7),swap(this,t+1,t+6),swap(this,t+2,t+5),swap(this,t+3,t+4);return this},Buffer.prototype.toString=function toString(){var e=0|this.length;return 0===e?"":0===arguments.length?utf8Slice(this,0,e):slowToString.apply(this,arguments)},Buffer.prototype.equals=function equals(e){if(!Buffer.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===Buffer.compare(this,e)},Buffer.prototype.inspect=function inspect(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},Buffer.prototype.compare=function compare(e,t,r,n,i){if(!Buffer.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),u=this.slice(n,i),l=e.slice(t,r),c=0;c<s;++c)if(u[c]!==l[c]){a=u[c],o=l[c];break}return a<o?-1:o<a?1:0},Buffer.prototype.includes=function includes(e,t,r){return-1!==this.indexOf(e,t,r)},Buffer.prototype.indexOf=function indexOf(e,t,r){return bidirectionalIndexOf(this,e,t,r,!0)},Buffer.prototype.lastIndexOf=function lastIndexOf(e,t,r){return bidirectionalIndexOf(this,e,t,r,!1)},Buffer.prototype.write=function write(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"===typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return hexWrite(this,e,t,r);case"utf8":case"utf-8":return utf8Write(this,e,t,r);case"ascii":return asciiWrite(this,e,t,r);case"latin1":case"binary":return latin1Write(this,e,t,r);case"base64":return base64Write(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var o=4096;function asciiSlice(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function latin1Slice(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function hexSlice(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",a=t;a<r;++a)i+=toHex(e[a]);return i}function utf16leSlice(e,t,r){for(var n=e.slice(t,r),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+256*n[a+1]);return i}function checkOffset(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function checkInt(e,t,r,n,i,a){if(!Buffer.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function objectWriteUInt16(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-r,2);i<a;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function objectWriteUInt32(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-r,4);i<a;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function checkIEEE754(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function writeFloat(e,t,r,n,a){return a||checkIEEE754(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function writeDouble(e,t,r,n,a){return a||checkIEEE754(e,0,r,8),i.write(e,t,r,n,52,8),r+8}Buffer.prototype.slice=function slice(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),Buffer.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=Buffer.prototype;else{var i=t-e;r=new Buffer(i,void 0);for(var a=0;a<i;++a)r[a]=this[a+e]}return r},Buffer.prototype.readUIntLE=function readUIntLE(e,t,r){e|=0,t|=0,r||checkOffset(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return n},Buffer.prototype.readUIntBE=function readUIntBE(e,t,r){e|=0,t|=0,r||checkOffset(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},Buffer.prototype.readUInt8=function readUInt8(e,t){return t||checkOffset(e,1,this.length),this[e]},Buffer.prototype.readUInt16LE=function readUInt16LE(e,t){return t||checkOffset(e,2,this.length),this[e]|this[e+1]<<8},Buffer.prototype.readUInt16BE=function readUInt16BE(e,t){return t||checkOffset(e,2,this.length),this[e]<<8|this[e+1]},Buffer.prototype.readUInt32LE=function readUInt32LE(e,t){return t||checkOffset(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Buffer.prototype.readUInt32BE=function readUInt32BE(e,t){return t||checkOffset(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Buffer.prototype.readIntLE=function readIntLE(e,t,r){e|=0,t|=0,r||checkOffset(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},Buffer.prototype.readIntBE=function readIntBE(e,t,r){e|=0,t|=0,r||checkOffset(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},Buffer.prototype.readInt8=function readInt8(e,t){return t||checkOffset(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Buffer.prototype.readInt16LE=function readInt16LE(e,t){t||checkOffset(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt16BE=function readInt16BE(e,t){t||checkOffset(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt32LE=function readInt32LE(e,t){return t||checkOffset(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Buffer.prototype.readInt32BE=function readInt32BE(e,t){return t||checkOffset(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Buffer.prototype.readFloatLE=function readFloatLE(e,t){return t||checkOffset(e,4,this.length),i.read(this,e,!0,23,4)},Buffer.prototype.readFloatBE=function readFloatBE(e,t){return t||checkOffset(e,4,this.length),i.read(this,e,!1,23,4)},Buffer.prototype.readDoubleLE=function readDoubleLE(e,t){return t||checkOffset(e,8,this.length),i.read(this,e,!0,52,8)},Buffer.prototype.readDoubleBE=function readDoubleBE(e,t){return t||checkOffset(e,8,this.length),i.read(this,e,!1,52,8)},Buffer.prototype.writeUIntLE=function writeUIntLE(e,t,r,n){(e=+e,t|=0,r|=0,n)||checkInt(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a<r&&(i*=256);)this[t+a]=e/i&255;return t+r},Buffer.prototype.writeUIntBE=function writeUIntBE(e,t,r,n){(e=+e,t|=0,r|=0,n)||checkInt(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},Buffer.prototype.writeUInt8=function writeUInt8(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,1,255,0),Buffer.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},Buffer.prototype.writeUInt16LE=function writeUInt16LE(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):objectWriteUInt16(this,e,t,!0),t+2},Buffer.prototype.writeUInt16BE=function writeUInt16BE(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):objectWriteUInt16(this,e,t,!1),t+2},Buffer.prototype.writeUInt32LE=function writeUInt32LE(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):objectWriteUInt32(this,e,t,!0),t+4},Buffer.prototype.writeUInt32BE=function writeUInt32BE(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):objectWriteUInt32(this,e,t,!1),t+4},Buffer.prototype.writeIntLE=function writeIntLE(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);checkInt(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a<r&&(o*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},Buffer.prototype.writeIntBE=function writeIntBE(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);checkInt(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},Buffer.prototype.writeInt8=function writeInt8(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},Buffer.prototype.writeInt16LE=function writeInt16LE(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):objectWriteUInt16(this,e,t,!0),t+2},Buffer.prototype.writeInt16BE=function writeInt16BE(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):objectWriteUInt16(this,e,t,!1),t+2},Buffer.prototype.writeInt32LE=function writeInt32LE(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):objectWriteUInt32(this,e,t,!0),t+4},Buffer.prototype.writeInt32BE=function writeInt32BE(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):objectWriteUInt32(this,e,t,!1),t+4},Buffer.prototype.writeFloatLE=function writeFloatLE(e,t,r){return writeFloat(this,e,t,!0,r)},Buffer.prototype.writeFloatBE=function writeFloatBE(e,t,r){return writeFloat(this,e,t,!1,r)},Buffer.prototype.writeDoubleLE=function writeDoubleLE(e,t,r){return writeDouble(this,e,t,!0,r)},Buffer.prototype.writeDoubleBE=function writeDoubleBE(e,t,r){return writeDouble(this,e,t,!1,r)},Buffer.prototype.copy=function copy(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,a=n-r;if(this===e&&r<t&&t<n)for(i=a-1;i>=0;--i)e[i+t]=this[i+r];else if(a<1e3||!Buffer.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+a),t);return a},Buffer.prototype.fill=function fill(e,t,r,n){if("string"===typeof e){if("string"===typeof t?(n=t,t=0,r=this.length):"string"===typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!==typeof n)throw new TypeError("encoding must be a string");if("string"===typeof n&&!Buffer.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"===typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var a;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"===typeof e)for(a=t;a<r;++a)this[a]=e;else{var o=Buffer.isBuffer(e)?e:utf8ToBytes(new Buffer(e,n).toString()),s=o.length;for(a=0;a<r-t;++a)this[a+t]=o[a%s]}return this};var s=/[^+\/0-9A-Za-z-_]/g;function toHex(e){return e<16?"0"+e.toString(16):e.toString(16)}function utf8ToBytes(e,t){var r;t=t||1/0;for(var n=e.length,i=null,a=[],o=0;o<n;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function base64ToBytes(e){return n.toByteArray(function base64clean(e){if((e=function stringtrim(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(s,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function blitBuffer(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}}).call(t,r(5))},function(e,t,r){"use strict";var n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=r(0),a=r(1);t.schema=function(e,t){return void 0!==t&&null!==t&&"object"===("undefined"===typeof t?"undefined":n(t))?t.isJoi?t:Array.isArray(t)?e.alternatives().try(t):t instanceof RegExp?e.string().regex(t):t instanceof Date?e.date().valid(t):e.object().keys(t):"string"===typeof t?e.string().valid(t):"number"===typeof t?e.number().valid(t):"boolean"===typeof t?e.boolean().valid(t):a.isRef(t)?e.valid(t):(i.assert(null===t,"Invalid schema content:",t),e.valid(null))},t.ref=function(e){return a.isRef(e)?e:a.create(e)}},function(e,t){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(n){"object"===typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";var n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var i=r(0),a=r(20),o={annotations:Symbol("joi-annotations"),stringify:function(e,r){var i="undefined"===typeof e?"undefined":n(e);if(null===e)return"null";if("string"===i)return e;if(e instanceof t.Err||"function"===i||"symbol"===i)return e.toString();if("object"===i){if(Array.isArray(e)){for(var a="",s=0;s<e.length;++s)a=a+(a.length?", ":"")+o.stringify(e[s],r);return r?"["+a+"]":a}return e.toString()}return JSON.stringify(e)}};t.Err=function(){function _class(e,t,r,n,i,o,s){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,_class),this.isJoi=!0,this.type=e,this.context=t||{},this.context.key=r.path[r.path.length-1],this.context.label=r.key,this.path=r.path,this.options=n,this.flags=i,this.message=o,this.template=s;var u=this.options.language;this.flags.label?this.context.label=this.flags.label:!u||""!==this.context.label&&null!==this.context.label||(this.context.label=u.root||a.errors.root)}return _class.prototype.toString=function toString(){var e=this;if(this.message)return this.message;var t=void 0;this.template&&(t=this.template);var r=this.options.language;if(void 0===(t=t||i.reach(r,this.type)||i.reach(a.errors,this.type)))return'Error code "'+this.type+'" is not defined, your custom type is missing the correct language definition';var n=i.reach(r,"messages.wrapArrays");if("boolean"!==typeof n&&(n=a.errors.messages.wrapArrays),null===t){var s=o.stringify(this.context.reason,n);return n?s.slice(1,-1):s}var u=/\{\{\!?label\}\}/.test(t),l=t.length>2&&"!"===t[0]&&"!"===t[1];if(l&&(t=t.slice(2)),!u&&!l){var c=i.reach(r,"key");t="string"===typeof c?c+t:i.reach(a.errors,"key")+t}return t.replace(/\{\{(\!?)([^}]+)\}\}/g,(function(t,r,a){var s=i.reach(e.context,a),u=o.stringify(s,n);return r&&e.options.escapeHtml?i.escapeHtml(u):u}))},_class}(),t.create=function(e,r,n,i,a,o,s){return new t.Err(e,r,n,i,a,o,s)},t.process=function(e,t){if(!e||!e.length)return null;var r="",n=[],i=function processErrors(e,t){for(var i=0;i<e.length;++i){var a=e[i];if(a instanceof Error)return a;if(a.flags.error&&"function"!==typeof a.flags.error)return a.flags.error;var o=void 0;if(void 0===t&&(o=a.toString(),r=r+(r?". ":"")+o),a.context.reason&&a.context.reason.length){var s=processErrors(a.context.reason,a.path);if(s)return s}else n.push({message:o||a.toString(),path:a.path,type:a.type,context:a.context})}}(e);if(i)return i;var a=new Error(r);return a.isJoi=!0,a.name="ValidationError",a.details=n,a._object=t,a.annotate=o.annotate,a},o.safeStringify=function(e,t){return JSON.stringify(e,o.serializer(),t)},o.serializer=function(){var e=[],t=[],r=function cycleReplacer(r,n){return t[0]===n?"[Circular ~]":"[Circular ~."+e.slice(0,t.indexOf(n)).join(".")+"]"};return function(i,a){if(t.length>0){var s=t.indexOf(this);~s?(t.length=s+1,e.length=s+1,e[s]=i):(t.push(this),e.push(i)),~t.indexOf(a)&&(a=r.call(this,i,a))}else t.push(a);if(a){var u=a[o.annotations];if(u){if(Array.isArray(a)){for(var l=[],c=0;c<a.length;++c)u.errors[c]&&l.push("_$idx$_"+u.errors[c].sort().join(", ")+"_$end$_"),l.push(a[c]);a=l}else{for(var f=Object.keys(u.errors),d=0;d<f.length;++d){var h=f[d];a[h+"_$key$_"+u.errors[h].sort().join(", ")+"_$end$_"]=a[h],a[h]=void 0}for(var p=Object.keys(u.missing),g=0;g<p.length;++g){var m=p[g];a["_$miss$_"+m+"|"+u.missing[m]+"_$end$_"]="__missing__"}}return a}}return a===1/0||a===-1/0||Number.isNaN(a)||"function"===typeof a||"symbol"===("undefined"===typeof a?"undefined":n(a))?"["+a.toString()+"]":a}},o.annotate=function(e){var t=e?"":"\x1b[31m",r=e?"":"\x1b[41m",a=e?"":"\x1b[0m";if("object"!==n(this._object))return this.details[0].message;for(var s=i.clone(this._object||{}),u=this.details.length-1;u>=0;--u)for(var l=u+1,c=this.details[u],f=c.path,d=s,h=0;;++h){var p=f[h];if(d.isImmutable&&(d=d.clone()),!(h+1<f.length&&d[p]&&"string"!==typeof d[p])){var g=d[o.annotations]=d[o.annotations]||{errors:{},missing:{}},m=d[p],v=p||c.context.label;void 0!==m?(g.errors[v]=g.errors[v]||[],g.errors[v].push(l)):g.missing[v]=l;break}d=d[p]}var y=/_\$key\$_([, \d]+)_\$end\$_\"/g,_=/\"_\$miss\$_([^\|]+)\|(\d+)_\$end\$_\"\: \"__missing__\"/g,b=/\s*\"_\$idx\$_([, \d]+)_\$end\$_\",?\n(.*)/g,x=/"\[(NaN|Symbol.*|-?Infinity|function.*|\(.*)\]"/g,w=o.safeStringify(s,2).replace(y,(function(e,r){return'" '+t+"["+r+"]"+a})).replace(_,(function(e,n,i){return r+'"'+n+'"'+a+t+" ["+i+"]: -- missing --"+a})).replace(b,(function(e,r,n){return"\n"+n+" "+t+"["+r+"]"+a})).replace(x,(function(e,t){return t}));w=w+"\n"+t;for(var k=0;k<this.details.length;++k){w=w+"\n["+(k+1)+"] "+this.details[k].message}return w+=a}},function(e,t){var r,n,i=e.exports={};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(e){if(r===setTimeout)return setTimeout(e,0);if((r===defaultSetTimout||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"===typeof setTimeout?setTimeout:defaultSetTimout}catch(e){r=defaultSetTimout}try{n="function"===typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){n=defaultClearTimeout}}();var a,o=[],s=!1,u=-1;function cleanUpNextTick(){s&&a&&(s=!1,a.length?o=a.concat(o):u=-1,o.length&&drainQueue())}function drainQueue(){if(!s){var e=runTimeout(cleanUpNextTick);s=!0;for(var t=o.length;t;){for(a=o,o=[];++u<t;)a&&a[u].run();u=-1,t=o.length}a=null,s=!1,function runClearTimeout(e){if(n===clearTimeout)return clearTimeout(e);if((n===defaultClearTimeout||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{return n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function Item(e,t){this.fun=e,this.array=t}function noop(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];o.push(new Item(e,t)),1!==o.length||s||runTimeout(drainQueue)},Item.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=noop,i.addListener=noop,i.once=noop,i.off=noop,i.removeListener=noop,i.removeAllListeners=noop,i.emit=noop,i.prependListener=noop,i.prependOnceListener=noop,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,r){"use strict";var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function _inherits(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):function _defaults(e,t){for(var r=Object.getOwnPropertyNames(t),n=0;n<r.length;n++){var i=r[n],a=Object.getOwnPropertyDescriptor(t,i);a&&a.configurable&&void 0===e[i]&&Object.defineProperty(e,i,a)}return e}(e,t))}var i=r(0),a=r(2),o=r(4),s=r(6),u=r(26),l=r(1),c=r(11),f={alternatives:r(10),array:r(22),boolean:r(24),binary:r(23),date:r(12),func:r(25),number:r(27),object:r(13),string:r(28)};f.callWithDefaults=function(e,t){var r;return i.assert(this,"Must be invoked on a Joi instance."),this._defaults&&(e=this._defaults(e)),e._currentJoi=this,(r=e)._init.apply(r,function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}(t))},f.root=function(){var e=new a,t=e.clone();return a.prototype._currentJoi=t,t._currentJoi=t,t.any=function(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return i.assert(0===r.length,"Joi.any() does not allow arguments."),f.callWithDefaults.call(this,e,r)},t.alternatives=t.alt=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return f.callWithDefaults.call(this,f.alternatives,t)},t.array=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return i.assert(0===t.length,"Joi.array() does not allow arguments."),f.callWithDefaults.call(this,f.array,t)},t.boolean=t.bool=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return i.assert(0===t.length,"Joi.boolean() does not allow arguments."),f.callWithDefaults.call(this,f.boolean,t)},t.binary=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return i.assert(0===t.length,"Joi.binary() does not allow arguments."),f.callWithDefaults.call(this,f.binary,t)},t.date=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return i.assert(0===t.length,"Joi.date() does not allow arguments."),f.callWithDefaults.call(this,f.date,t)},t.func=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return i.assert(0===t.length,"Joi.func() does not allow arguments."),f.callWithDefaults.call(this,f.func,t)},t.number=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return i.assert(0===t.length,"Joi.number() does not allow arguments."),f.callWithDefaults.call(this,f.number,t)},t.object=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return f.callWithDefaults.call(this,f.object,t)},t.string=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return i.assert(0===t.length,"Joi.string() does not allow arguments."),f.callWithDefaults.call(this,f.string,t)},t.ref=function(){return l.create.apply(l,arguments)},t.isRef=function(e){return l.isRef(e)},t.validate=function(r){var n,i=(n=(arguments.length<=1?0:arguments.length-1)-1+1,arguments.length<=n?void 0:arguments[n]),a="function"===typeof i?i:null,o=(arguments.length<=1?0:arguments.length-1)-(a?1:0);if(0===o)return e.validate(r,a);var s=2===o?arguments.length<=2?void 0:arguments[2]:{},u=t.compile(arguments.length<=1?void 0:arguments[1]);return u._validateWithOptions(r,s,a)},t.describe=function(){var r=arguments.length?t.compile(arguments.length<=0?void 0:arguments[0]):e;return r.describe()},t.compile=function(e){try{return o.schema(this,e)}catch(t){throw t.hasOwnProperty("path")&&(t.message=t.message+"("+t.path+")"),t}},t.assert=function(e,r,n){t.attempt(e,r,n)},t.attempt=function(e,r,n){var i=t.validate(e,r),a=i.error;if(a){if(!n)throw"function"===typeof a.annotate&&(a.message=a.annotate()),a;if(!(n instanceof Error))throw"function"===typeof a.annotate&&(a.message=n+" "+a.annotate()),a;throw n}return i.value},t.reach=function(e,t){i.assert(e&&e instanceof a,"you must provide a joi schema"),i.assert(Array.isArray(t)||"string"===typeof t,"path must be a string or an array of strings");return function reach(e,t){if(!t.length)return e;var r=e._inner.children;if(r)for(var n=t.shift(),i=0;i<r.length;++i){var a=r[i];if(a.key===n)return reach(a.schema,t)}}(e,"string"===typeof t?t?t.split("."):[]:t.slice())},t.lazy=function(e){return u.set(e)},t.defaults=function(e){var t=this;i.assert("function"===typeof e,"Defaults must be a function");var r=Object.create(this.any());return r=e(r),i.assert(r&&r instanceof this.constructor,"defaults() must return a schema"),n(r,this,r.clone()),r._defaults=function(r){return t._defaults&&(r=t._defaults(r),i.assert(r instanceof t.constructor,"defaults() must return a schema")),r=e(r),i.assert(r instanceof t.constructor,"defaults() must return a schema"),r},r},t.extend=function(){for(var e=this,r=arguments.length,u=Array(r),d=0;d<r;d++)u[d]=arguments[d];var h=i.flatten(u);i.assert(h.length>0,"You need to provide at least one extension"),this.assert(h,t.extensionsSchema);var p=Object.create(this.any());n(p,this);for(var g=function _loop(r){var u=h[r];"function"===typeof u&&(u=u(p)),e.assert(u,t.extensionSchema);var d=(u.base||e.any()).clone(),g=d.constructor,m=function(e){function type(){_classCallCheck(this,type);var t=_possibleConstructorReturn(this,e.call(this));return u.base&&n(t,d),t._type=u.name,u.language&&(t._settings=c.concat(t._settings,{language:_defineProperty({},u.name,u.language)})),t}return _inherits(type,e),type}(g);if(u.coerce&&(m.prototype._coerce=function(e,t,r){if(g.prototype._coerce){var n=g.prototype._coerce.call(this,e,t,r);if(n.errors)return n;e=n.value}var i=u.coerce.call(this,e,t,r);return i instanceof s.Err?{value:e,errors:i}:{value:i}}),u.pre&&(m.prototype._base=function(e,t,r){if(g.prototype._base){var n=g.prototype._base.call(this,e,t,r);if(n.errors)return n;e=n.value}var i=u.pre.call(this,e,t,r);return i instanceof s.Err?{value:e,errors:i}:{value:i}}),u.rules)for(var v=function _loop2(t){var r=u.rules[t],n=r.params?r.params instanceof a?r.params._inner.children.map((function(e){return e.key})):Object.keys(r.params):[],s=r.params?o.schema(e,r.params):null;m.prototype[r.name]=function(){for(var e=arguments.length,t=Array(e),o=0;o<e;o++)t[o]=arguments[o];if(t.length>n.length)throw new Error("Unexpected number of arguments");for(var u=!1,c={},f=0;f<n.length;++f)c[n[f]]=t[f],!u&&l.isRef(t[f])&&(u=!0);s&&(c=p.attempt(c,s));var d=void 0;if(r.validate){var h=function validate(e,t,n){return r.validate.call(this,c,e,t,n)};d=this._test(r.name,c,h,{description:r.description,hasRef:u})}else d=this.clone();if(r.setup){var g=r.setup.call(d,c);void 0!==g&&(i.assert(g instanceof a,"Setup of extension Joi."+this._type+"()."+r.name+"() must return undefined or a Joi object"),d=g)}return d}},y=0;y<u.rules.length;++y)v(y);u.describe&&(m.prototype.describe=function(){var e=g.prototype.describe.call(this);return u.describe.call(this,e)});var _=new m;p[u.name]=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return f.callWithDefaults.call(this,_,t)}},m=0;m<h.length;++m)g(m);return p},t.extensionSchema=f.object.keys({base:f.object.type(a,"Joi object"),name:f.string.required(),coerce:f.func.arity(3),pre:f.func.arity(3),language:f.object,describe:f.func.arity(1),rules:f.array.items(f.object.keys({name:f.string.required(),setup:f.func.arity(1),validate:f.func.arity(4),params:[f.object.pattern(/.*/,f.object.type(a,"Joi object")),f.object.type(f.object.constructor,"Joi object")],description:[f.string,f.func.arity(1)]}).or("setup","validate"))}).strict(),t.extensionsSchema=f.array.items([f.object,f.func.arity(1)]).strict(),t.version=r(36).version,t},e.exports=f.root()},function(e,t,r){"use strict";(function(t){var n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}var i=r(1),a={extendedCheckForValue:function(e,r){var i="undefined"===typeof e?"undefined":n(e);if("object"===i){if(e instanceof Date)return function(t){return t instanceof Date&&e.getTime()===t.getTime()};if(t.isBuffer(e))return function(r){return t.isBuffer(r)&&e.length===r.length&&e.toString("binary")===r.toString("binary")}}else if(r&&"string"===i){var a=e.toLowerCase();return function(e){return"string"===typeof e&&a===e.toLowerCase()}}return null}};e.exports=function(){function InternalSet(e){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,InternalSet),this._set=new Set(e),this._hasRef=!1}return InternalSet.prototype.add=function add(e,t){var r=i.isRef(e);return!r&&this.has(e,null,null,!1)?this:(void 0!==t&&i.push(t,e),this._set.add(e),this._hasRef|=r,this)},InternalSet.prototype.merge=function merge(e,t){var r=!0,n=!1,i=void 0;try{for(var a,o=e._set[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;this.add(s)}}catch(p){n=!0,i=p}finally{try{!r&&o.return&&o.return()}finally{if(n)throw i}}var u=!0,l=!1,c=void 0;try{for(var f,d=t._set[Symbol.iterator]();!(u=(f=d.next()).done);u=!0){var h=f.value;this.remove(h)}}catch(p){l=!0,c=p}finally{try{!u&&d.return&&d.return()}finally{if(l)throw c}}return this},InternalSet.prototype.remove=function remove(e){return this._set.delete(e),this},InternalSet.prototype.has=function has(e,t,r,n){if(!this._set.size)return!1;var o=this._set.has(e);if(o)return o;var s=a.extendedCheckForValue(e,n);if(!s){if(t&&this._hasRef){var u=!0,l=!1,c=void 0;try{for(var f,d=this._set[Symbol.iterator]();!(u=(f=d.next()).done);u=!0){var h=f.value;if(i.isRef(h)&&(e===(h=h(t.reference||t.parent,r))||Array.isArray(h)&&h.includes(e)))return!0}}catch(p){l=!0,c=p}finally{try{!u&&d.return&&d.return()}finally{if(l)throw c}}}return!1}return this._has(e,t,r,s)},InternalSet.prototype._has=function _has(e,t,r,n){var a=!(!t||!this._hasRef),o=function isReallyEqual(t){return e===t||n(t)},s=!0,u=!1,l=void 0;try{for(var c,f=this._set[Symbol.iterator]();!(s=(c=f.next()).done);s=!0){var d=c.value;if(a&&i.isRef(d)&&(d=d(t.reference||t.parent,r),Array.isArray(d))){if(d.find(o))return!0}else if(o(d))return!0}}catch(h){u=!0,l=h}finally{try{!s&&f.return&&f.return()}finally{if(u)throw l}}return!1},InternalSet.prototype.values=function values(e){if(e&&e.stripUndefined){var values=[],t=!0,r=!1,n=void 0;try{for(var i,a=this._set[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var o=i.value;void 0!==o&&values.push(o)}}catch(s){r=!0,n=s}finally{try{!t&&a.return&&a.return()}finally{if(r)throw n}}return values}return Array.from(this._set)},InternalSet.prototype.slice=function slice(){var e=new InternalSet(this._set);return e._hasRef=this._hasRef,e},InternalSet.prototype.concat=function concat(e){var t=new InternalSet([].concat(_toConsumableArray(this._set),_toConsumableArray(e._set)));return t._hasRef=!!(this._hasRef|e._hasRef),t},InternalSet}()}).call(t,r(3).Buffer)},function(e,t,r){"use strict";var n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function _inherits(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):function _defaults(e,t){for(var r=Object.getOwnPropertyNames(t),n=0;n<r.length;n++){var i=r[n],a=Object.getOwnPropertyDescriptor(t,i);a&&a.configurable&&void 0===e[i]&&Object.defineProperty(e,i,a)}return e}(e,t))}var i=r(0),a=r(2),o=r(4),s=r(1),u={};u.Alternatives=function(e){function _class(){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,_class);var t=function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,e.call(this));return t._type="alternatives",t._invalids.remove(null),t._inner.matches=[],t}return _inherits(_class,e),_class.prototype._init=function _init(){return arguments.length?this.try.apply(this,arguments):this},_class.prototype._base=function _base(e,t,r){for(var n=[],i=this._inner.matches.length,a=this._baseType,o=0;o<i;++o){var s=this._inner.matches[o];if(s.schema){var u=s.schema._validate(e,t,r);if(!u.errors)return u;n=n.concat(u.errors)}else{var l=s.peek||s.is,c=s.is?s.ref(t.reference||t.parent,r):e;if(l._validate(c,null,r,t.parent).errors){if(s.otherwise)return s.otherwise._validate(e,t,r)}else if(s.then)return s.then._validate(e,t,r);if(o===i-1&&a)return a._validate(e,t,r)}}return n.length?{errors:this.createError("alternatives.child",{reason:n},t,r)}:{errors:this.createError("alternatives.base",null,t,r)}},_class.prototype.try=function _try(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];t=i.flatten(t),i.assert(t.length,"Cannot add other alternatives without at least one schema");for(var n=this.clone(),a=0;a<t.length;++a){var s=o.schema(this._currentJoi,t[a]);s._refs.length&&(n._refs=n._refs.concat(s._refs)),n._inner.matches.push({schema:s})}return n},_class.prototype.when=function when(e,t){var r=!1;i.assert(s.isRef(e)||"string"===typeof e||(r=e instanceof a),"Invalid condition:",e),i.assert(t,"Missing options"),i.assert("object"===("undefined"===typeof t?"undefined":n(t)),"Invalid options"),r?i.assert(!t.hasOwnProperty("is"),'"is" can not be used with a schema condition'):i.assert(t.hasOwnProperty("is"),'Missing "is" directive'),i.assert(void 0!==t.then||void 0!==t.otherwise,'options must have at least one of "then" or "otherwise"');var u=this.clone(),l=void 0;r||(l=o.schema(this._currentJoi,t.is),null!==t.is&&(s.isRef(t.is)||t.is instanceof a)||(l=l.required()));var c={ref:r?null:o.ref(e),peek:r?e:null,is:l,then:void 0!==t.then?o.schema(this._currentJoi,t.then):void 0,otherwise:void 0!==t.otherwise?o.schema(this._currentJoi,t.otherwise):void 0};return u._baseType&&(c.then=c.then&&u._baseType.concat(c.then),c.otherwise=c.otherwise&&u._baseType.concat(c.otherwise)),r||(s.push(u._refs,c.ref),u._refs=u._refs.concat(c.is._refs)),c.then&&c.then._refs&&(u._refs=u._refs.concat(c.then._refs)),c.otherwise&&c.otherwise._refs&&(u._refs=u._refs.concat(c.otherwise._refs)),u._inner.matches.push(c),u},_class.prototype.describe=function describe(){for(var e=a.prototype.describe.call(this),t=[],r=0;r<this._inner.matches.length;++r){var n=this._inner.matches[r];if(n.schema)t.push(n.schema.describe());else{var i=n.is?{ref:n.ref.toString(),is:n.is.describe()}:{peek:n.peek.describe()};n.then&&(i.then=n.then.describe()),n.otherwise&&(i.otherwise=n.otherwise.describe()),t.push(i)}}return e.alternatives=t,e},_class}(a),e.exports=new u.Alternatives},function(e,t,r){"use strict";var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},i=r(0);t.concat=function(e,t){if(!t)return e;for(var r=n({},e),a=Object.keys(t),o=0;o<a.length;++o){var s=a[o];"language"===s&&r.hasOwnProperty(s)?r[s]=i.applyToDefaults(r[s],t[s]):r[s]=t[s]}return r}},function(e,t,r){"use strict";function _inherits(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):function _defaults(e,t){for(var r=Object.getOwnPropertyNames(t),n=0;n<r.length;n++){var i=r[n],a=Object.getOwnPropertyDescriptor(t,i);a&&a.configurable&&void 0===e[i]&&Object.defineProperty(e,i,a)}return e}(e,t))}var n=r(2),i=r(1),a=r(0),o={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};o.invalidDate=new Date(""),o.isIsoDate=function(){var e=o.isoDate.toString();return function(t){return t&&t.toString()===e}}(),o.Date=function(e){function _class(){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,_class);var t=function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,e.call(this));return t._type="date",t}return _inherits(_class,e),_class.prototype._base=function _base(e,t,r){var n={value:r.convert&&o.Date.toDate(e,this._flags.format,this._flags.timestamp,this._flags.multiplier)||e};if(n.value instanceof Date&&!isNaN(n.value.getTime()))n.errors=null;else if(r.convert){var i=void 0;i=o.isIsoDate(this._flags.format)?"isoDate":this._flags.timestamp?"timestamp."+this._flags.timestamp:"base",n.errors=this.createError("date."+i,null,t,r)}else n.errors=this.createError("date.strict",null,t,r);return n},_class.toDate=function toDate(e,t,r,n){if(e instanceof Date)return e;if("string"===typeof e||"number"===typeof e&&!isNaN(e)&&isFinite(e)){"string"===typeof e&&/^[+-]?\d+(\.\d+)?$/.test(e)&&(e=parseFloat(e));var i=void 0;if(i=t&&o.isIsoDate(t)?t.test(e)?new Date(e):o.invalidDate:r&&n?/^\s*$/.test(e)?o.invalidDate:new Date(e*n):new Date(e),!isNaN(i.getTime()))return i}return null},_class.prototype.iso=function iso(){if(this._flags.format===o.isoDate)return this;var e=this.clone();return e._flags.format=o.isoDate,e},_class.prototype.timestamp=function timestamp(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"javascript",t=["javascript","unix"];if(a.assert(t.includes(e),'"type" must be one of "'+t.join('", "')+'"'),this._flags.timestamp===e)return this;var r=this.clone();return r._flags.timestamp=e,r._flags.multiplier="unix"===e?1e3:1,r},_class.prototype._isIsoDate=function _isIsoDate(e){return o.isoDate.test(e)},_class}(n),o.compare=function(e,t){return function(r){var n="now"===r,s=i.isRef(r);return n||s||(r=o.Date.toDate(r)),a.assert(r,"Invalid date format"),this._test(e,r,(function(i,a,u){var l=void 0;if(n)l=Date.now();else if(s){if(!(l=o.Date.toDate(r(a.reference||a.parent,u))))return this.createError("date.ref",{ref:r.key},a,u);l=l.getTime()}else l=r.getTime();return t(i.getTime(),l)?i:this.createError("date."+e,{limit:new Date(l)},a,u)}))}},o.Date.prototype.min=o.compare("min",(function(e,t){return e>=t})),o.Date.prototype.max=o.compare("max",(function(e,t){return e<=t})),o.Date.prototype.greater=o.compare("greater",(function(e,t){return e>t})),o.Date.prototype.less=o.compare("less",(function(e,t){return e<t})),e.exports=new o.Date},function(e,t,r){"use strict";var n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function _inherits(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):function _defaults(e,t){for(var r=Object.getOwnPropertyNames(t),n=0;n<r.length;n++){var i=r[n],a=Object.getOwnPropertyDescriptor(t,i);a&&a.configurable&&void 0===e[i]&&Object.defineProperty(e,i,a)}return e}(e,t))}var i=r(0),a=r(31),o=r(2),s=r(6),u=r(4),l={};l.Object=function(e){function _class(){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,_class);var t=function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,e.call(this));return t._type="object",t._inner.children=null,t._inner.renames=[],t._inner.dependencies=[],t._inner.patterns=[],t}return _inherits(_class,e),_class.prototype._init=function _init(){return arguments.length?this.keys.apply(this,arguments):this},_class.prototype._base=function _base(e,t,r){var a=e,o=[],u=function finish(){return{value:a,errors:o.length?o:null}};"string"===typeof e&&r.convert&&(e=l.safeParse(e));var c=this._flags.func?"function":"object";if(!e||("undefined"===typeof e?"undefined":n(e))!==c||Array.isArray(e))return o.push(this.createError(c+".base",null,t,r)),u();if(!this._inner.renames.length&&!this._inner.dependencies.length&&!this._inner.children&&!this._inner.patterns.length)return a=e,u();if(a===e){"object"===c?a=Object.create(Object.getPrototypeOf(e)):(a=function target(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return e.apply(this,r)}).prototype=i.clone(e.prototype);for(var f=Object.keys(e),d=0;d<f.length;++d)a[f[d]]=e[f[d]]}else a=e;for(var h={},p=0;p<this._inner.renames.length;++p){var g=this._inner.renames[p];if(g.isRegExp){for(var m=Object.keys(a),v=[],y=0;y<m.length;++y)g.from.test(m[y])&&v.push(m[y]);var _=v.every((function(e){return void 0===a[e]}));if(g.options.ignoreUndefined&&_)continue;if(!g.options.multiple&&h[g.to]&&(o.push(this.createError("object.rename.regex.multiple",{from:v,to:g.to},t,r)),r.abortEarly))return u();if(Object.prototype.hasOwnProperty.call(a,g.to)&&!g.options.override&&!h[g.to]&&(o.push(this.createError("object.rename.regex.override",{from:v,to:g.to},t,r)),r.abortEarly))return u();if(_?delete a[g.to]:a[g.to]=a[v[v.length-1]],h[g.to]=!0,!g.options.alias)for(var b=0;b<v.length;++b)delete a[v[b]]}else{if(g.options.ignoreUndefined&&void 0===a[g.from])continue;if(!g.options.multiple&&h[g.to]&&(o.push(this.createError("object.rename.multiple",{from:g.from,to:g.to},t,r)),r.abortEarly))return u();if(Object.prototype.hasOwnProperty.call(a,g.to)&&!g.options.override&&!h[g.to]&&(o.push(this.createError("object.rename.override",{from:g.from,to:g.to},t,r)),r.abortEarly))return u();void 0===a[g.from]?delete a[g.to]:a[g.to]=a[g.from],h[g.to]=!0,g.options.alias||delete a[g.from]}}if(!this._inner.children&&!this._inner.patterns.length&&!this._inner.dependencies.length)return u();var x=new Set(Object.keys(a));if(this._inner.children){for(var w=[],k=0;k<this._inner.children.length;++k){var S=this._inner.children[k],E=S.key,C=a[E];x.delete(E);var T={key:E,path:t.path.concat(E),parent:a,reference:t.reference},O=S.schema._validate(C,T,r);if(O.errors){if(o.push(this.createError("object.child",{key:E,child:S.schema._getLabel(E),reason:O.errors},T,r)),r.abortEarly)return u()}else S.schema._flags.strip||void 0===O.value&&O.value!==C?(w.push(E),a[E]=O.finalValue):void 0!==O.value&&(a[E]=O.value)}for(var A=0;A<w.length;++A)delete a[w[A]]}if(x.size&&this._inner.patterns.length){var R=!0,D=!1,P=void 0;try{for(var j,M=x[Symbol.iterator]();!(R=(j=M.next()).done);R=!0)for(var F=j.value,I={key:F,path:t.path.concat(F),parent:a,reference:t.reference},L=a[F],N=0;N<this._inner.patterns.length;++N){var B=this._inner.patterns[N];if(B.regex?B.regex.test(F):!B.schema.validate(F).error){x.delete(F);var U=B.rule._validate(L,I,r);if(U.errors&&(o.push(this.createError("object.child",{key:F,child:B.rule._getLabel(F),reason:U.errors},I,r)),r.abortEarly))return u();a[F]=U.value}}}catch(re){D=!0,P=re}finally{try{!R&&M.return&&M.return()}finally{if(D)throw P}}}if(x.size&&(this._inner.children||this._inner.patterns.length)){if(r.stripUnknown&&!0!==this._flags.allowUnknown||r.skipFunctions){var z=!!r.stripUnknown&&(!0===r.stripUnknown||!!r.stripUnknown.objects),q=!0,W=!1,G=void 0;try{for(var H,V=x[Symbol.iterator]();!(q=(H=V.next()).done);q=!0){var Y=H.value;z?(delete a[Y],x.delete(Y)):"function"===typeof a[Y]&&x.delete(Y)}}catch(re){W=!0,G=re}finally{try{!q&&V.return&&V.return()}finally{if(W)throw G}}}if(void 0!==this._flags.allowUnknown?!this._flags.allowUnknown:!r.allowUnknown){var $=!0,X=!1,K=void 0;try{for(var J,Q=x[Symbol.iterator]();!($=(J=Q.next()).done);$=!0){var Z=J.value;o.push(this.createError("object.allowUnknown",{child:Z},{key:Z,path:t.path.concat(Z)},r,{}))}}catch(re){X=!0,K=re}finally{try{!$&&Q.return&&Q.return()}finally{if(X)throw K}}}}for(var ee=0;ee<this._inner.dependencies.length;++ee){var te=this._inner.dependencies[ee],re=l[te.type].call(this,null!==te.key&&a[te.key],te.peers,a,{key:te.key,path:null===te.key?t.path:t.path.concat(te.key)},r);if(re instanceof s.Err&&(o.push(re),r.abortEarly))return u()}return u()},_class.prototype.keys=function keys(e){i.assert(null===e||void 0===e||"object"===("undefined"===typeof e?"undefined":n(e)),"Object schema must be a valid object"),i.assert(!e||!(e instanceof o),"Object schema cannot be a joi schema");var t=this.clone();if(!e)return t._inner.children=null,t;var r=Object.keys(e);if(!r.length)return t._inner.children=[],t;var s=new a;if(t._inner.children)for(var l=0;l<t._inner.children.length;++l){var c=t._inner.children[l];r.includes(c.key)||s.add(c,{after:c._refs,group:c.key})}for(var f=0;f<r.length;++f){var d=r[f],h=e[d];try{var p=u.schema(this._currentJoi,h);s.add({key:d,schema:p},{after:p._refs,group:d})}catch(g){throw g.hasOwnProperty("path")?g.path=d+"."+g.path:g.path=d,g}}return t._inner.children=s.nodes,t},_class.prototype.append=function append(e){return null===e||void 0===e||0===Object.keys(e).length?this:this.keys(e)},_class.prototype.unknown=function unknown(e){var t=!1!==e;if(this._flags.allowUnknown===t)return this;var r=this.clone();return r._flags.allowUnknown=t,r},_class.prototype.length=function length(e){return i.assert(Number.isSafeInteger(e)&&e>=0,"limit must be a positive integer"),this._test("length",e,(function(t,r,n){return Object.keys(t).length===e?t:this.createError("object.length",{limit:e},r,n)}))},_class.prototype.min=function min(e){return i.assert(Number.isSafeInteger(e)&&e>=0,"limit must be a positive integer"),this._test("min",e,(function(t,r,n){return Object.keys(t).length>=e?t:this.createError("object.min",{limit:e},r,n)}))},_class.prototype.max=function max(e){return i.assert(Number.isSafeInteger(e)&&e>=0,"limit must be a positive integer"),this._test("max",e,(function(t,r,n){return Object.keys(t).length<=e?t:this.createError("object.max",{limit:e},r,n)}))},_class.prototype.pattern=function pattern(e,t){var r=e instanceof RegExp;i.assert(r||e instanceof o,"pattern must be a regex or schema"),i.assert(void 0!==t,"Invalid rule"),r&&(e=new RegExp(e.source,e.ignoreCase?"i":void 0));try{t=u.schema(this._currentJoi,t)}catch(a){throw a.hasOwnProperty("path")&&(a.message=a.message+"("+a.path+")"),a}var n=this.clone();return r?n._inner.patterns.push({regex:e,rule:t}):n._inner.patterns.push({schema:e,rule:t}),n},_class.prototype.schema=function schema(){return this._test("schema",null,(function(e,t,r){return e instanceof o?e:this.createError("object.schema",null,t,r)}))},_class.prototype.with=function _with(e,t){return i.assert(2===arguments.length,"Invalid number of arguments, expected 2."),this._dependency("with",e,t)},_class.prototype.without=function without(e,t){return i.assert(2===arguments.length,"Invalid number of arguments, expected 2."),this._dependency("without",e,t)},_class.prototype.xor=function xor(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t=i.flatten(t),this._dependency("xor",null,t)},_class.prototype.or=function or(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t=i.flatten(t),this._dependency("or",null,t)},_class.prototype.and=function and(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t=i.flatten(t),this._dependency("and",null,t)},_class.prototype.nand=function nand(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t=i.flatten(t),this._dependency("nand",null,t)},_class.prototype.requiredKeys=function requiredKeys(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t=i.flatten(t),this.applyFunctionToChildren(t,"required")},_class.prototype.optionalKeys=function optionalKeys(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t=i.flatten(t),this.applyFunctionToChildren(t,"optional")},_class.prototype.forbiddenKeys=function forbiddenKeys(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t=i.flatten(t),this.applyFunctionToChildren(t,"forbidden")},_class.prototype.rename=function rename(e,t,r){i.assert("string"===typeof e||e instanceof RegExp,"Rename missing the from argument"),i.assert("string"===typeof t,"Rename missing the to argument"),i.assert(t!==e,"Cannot rename key to same name:",e);for(var n=0;n<this._inner.renames.length;++n)i.assert(this._inner.renames[n].from!==e,"Cannot rename the same key multiple times");var a=this.clone();return a._inner.renames.push({from:e,to:t,options:i.applyToDefaults(l.renameDefaults,r||{}),isRegExp:e instanceof RegExp}),a},_class.prototype.applyFunctionToChildren=function applyFunctionToChildren(e,t,r,n){e=[].concat(e),i.assert(e.length>0,"expected at least one children");var a=l.groupChildren(e),o=void 0;if(""in a?(o=this[t].apply(this,r),delete a[""]):o=this.clone(),o._inner.children){n=n?n+".":"";for(var s=0;s<o._inner.children.length;++s){var u=o._inner.children[s],c=a[u.key];c&&(o._inner.children[s]={key:u.key,_refs:u._refs,schema:u.schema.applyFunctionToChildren(c,t,r,n+u.key)},delete a[u.key])}}var f=Object.keys(a);return i.assert(0===f.length,"unknown key(s)",f.join(", ")),o},_class.prototype._dependency=function _dependency(e,t,r){r=[].concat(r);for(var n=0;n<r.length;++n)i.assert("string"===typeof r[n],e,"peers must be a string or array of strings");var a=this.clone();return a._inner.dependencies.push({type:e,key:t,peers:r}),a},_class.prototype.describe=function describe(e){var t=o.prototype.describe.call(this);if(t.rules)for(var r=0;r<t.rules.length;++r){var a=t.rules[r];a.arg&&"object"===n(a.arg)&&a.arg.schema&&a.arg.ref&&(a.arg={schema:a.arg.schema.describe(),ref:a.arg.ref.toString()})}if(this._inner.children&&!e){t.children={};for(var s=0;s<this._inner.children.length;++s){var u=this._inner.children[s];t.children[u.key]=u.schema.describe()}}if(this._inner.dependencies.length&&(t.dependencies=i.clone(this._inner.dependencies)),this._inner.patterns.length){t.patterns=[];for(var l=0;l<this._inner.patterns.length;++l){var c=this._inner.patterns[l];c.regex?t.patterns.push({regex:c.regex.toString(),rule:c.rule.describe()}):t.patterns.push({schema:c.schema.describe(),rule:c.rule.describe()})}}return this._inner.renames.length>0&&(t.renames=i.clone(this._inner.renames)),t},_class.prototype.assert=function assert(e,t,r){e=u.ref(e),i.assert(e.isContext||e.depth>1,"Cannot use assertions for root level references - use direct key rules instead"),r=r||"pass the assertion test";try{t=u.schema(this._currentJoi,t)}catch(o){throw o.hasOwnProperty("path")&&(o.message=o.message+"("+o.path+")"),o}var n=e.path[e.path.length-1],a=e.path.join(".");return this._test("assert",{schema:t,ref:e},(function(o,s,u){if(!t._validate(e(o),null,u,o).errors)return o;var l=i.merge({},s);return l.key=n,l.path=e.path,this.createError("object.assert",{ref:a,message:r},l,u)}))},_class.prototype.type=function type(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.name;i.assert("function"===typeof e,"type must be a constructor function");var r={name:t,ctor:e};return this._test("type",r,(function(t,n,i){return t instanceof e?t:this.createError("object.type",{type:r.name},n,i)}))},_class}(o),l.safeParse=function(e){try{return JSON.parse(e)}catch(t){}return e},l.renameDefaults={alias:!1,multiple:!1,override:!1},l.groupChildren=function(e){e.sort();for(var t={},r=0;r<e.length;++r){var n=e[r];i.assert("string"===typeof n,"children must be strings");var a=n.split(".")[0];(t[a]=t[a]||[]).push(n.substring(a.length+1))}return t},l.keysToLabels=function(e,t){var r=e._inner.children;if(!r)return t;var n=function findLabel(e){var t=r.find((function(t){return t.key===e}));return t?t.schema._getLabel(e):e};return Array.isArray(t)?t.map(n):n(t)},l.with=function(e,t,r,n,i){if(void 0===e)return e;for(var a=0;a<t.length;++a){var o=t[a];if(!Object.prototype.hasOwnProperty.call(r,o)||void 0===r[o])return this.createError("object.with",{main:n.key,mainWithLabel:l.keysToLabels(this,n.key),peer:o,peerWithLabel:l.keysToLabels(this,o)},n,i)}return e},l.without=function(e,t,r,n,i){if(void 0===e)return e;for(var a=0;a<t.length;++a){var o=t[a];if(Object.prototype.hasOwnProperty.call(r,o)&&void 0!==r[o])return this.createError("object.without",{main:n.key,mainWithLabel:l.keysToLabels(this,n.key),peer:o,peerWithLabel:l.keysToLabels(this,o)},n,i)}return e},l.xor=function(e,t,r,n,i){for(var a=[],o=0;o<t.length;++o){var s=t[o];Object.prototype.hasOwnProperty.call(r,s)&&void 0!==r[s]&&a.push(s)}if(1===a.length)return e;var u={peers:t,peersWithLabels:l.keysToLabels(this,t)};return 0===a.length?this.createError("object.missing",u,n,i):this.createError("object.xor",u,n,i)},l.or=function(e,t,r,n,i){for(var a=0;a<t.length;++a){var o=t[a];if(Object.prototype.hasOwnProperty.call(r,o)&&void 0!==r[o])return e}return this.createError("object.missing",{peers:t,peersWithLabels:l.keysToLabels(this,t)},n,i)},l.and=function(e,t,r,n,i){for(var a=[],o=[],s=t.length,u=0;u<s;++u){var c=t[u];Object.prototype.hasOwnProperty.call(r,c)&&void 0!==r[c]?o.push(c):a.push(c)}if(!(a.length===s||o.length===s))return this.createError("object.and",{present:o,presentWithLabels:l.keysToLabels(this,o),missing:a,missingWithLabels:l.keysToLabels(this,a)},n,i)},l.nand=function(e,t,r,n,a){for(var o=[],s=0;s<t.length;++s){var u=t[s];Object.prototype.hasOwnProperty.call(r,u)&&void 0!==r[u]&&o.push(u)}var c=i.clone(t),f=c.splice(0,1)[0];return o.length===t.length?this.createError("object.nand",{main:f,mainWithLabel:l.keysToLabels(this,f),peers:c,peersWithLabels:l.keysToLabels(this,c)},n,a):null},e.exports=new l.Object},function(e,t,r){"use strict";var n={rfc3986:{},generate:function(){var e="|";n.rfc3986.ipv4Cidr="[0-9]|[1-2][0-9]|3[0-2]",n.rfc3986.ipv6Cidr="(?:0?0?[0-9]|0?[1-9][0-9]|1[01][0-9]|12[0-8])";var t="a-zA-Z0-9-\\._~",r="!\\$&'\\(\\)\\*\\+,;=",i=t+"%0-9A-Fa-f"+r+":@",a="["+i+"]",o="(?:0?0?[0-9]|0?[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])";n.rfc3986.IPv4address="(?:"+o+"\\.){3}"+o;var s="[0-9A-Fa-f]{1,4}",u="(?:"+s+":"+s+"|"+n.rfc3986.IPv4address+")",l="(?:"+s+":){6}"+u,c="::(?:"+s+":){5}"+u,f="(?:"+s+")?::(?:"+s+":){4}"+u,d="(?:(?:"+s+":){0,1}"+s+")?::(?:"+s+":){3}"+u,h="(?:(?:"+s+":){0,2}"+s+")?::(?:"+s+":){2}"+u,p="(?:(?:"+s+":){0,3}"+s+")?::"+s+":"+u,g="(?:(?:"+s+":){0,4}"+s+")?::"+u;n.rfc3986.IPv6address="(?:"+l+e+c+e+f+e+d+e+h+e+p+e+g+e+"(?:(?:[0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}"+e+"(?:(?:[0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})?::)",n.rfc3986.IPvFuture="v[0-9A-Fa-f]+\\.["+t+r+":]+",n.rfc3986.scheme="[a-zA-Z][a-zA-Z0-9+-\\.]*";var m="(?:[a-zA-Z0-9-\\._~%0-9A-Fa-f!\\$&'\\(\\)\\*\\+,;=:]*@)?"+("(?:"+("\\[(?:"+n.rfc3986.IPv6address+e+n.rfc3986.IPvFuture+")\\]")+e+n.rfc3986.IPv4address+e+"[a-zA-Z0-9-\\._~%0-9A-Fa-f!\\$&'\\(\\)\\*\\+,;=]{0,255})")+"(?::[0-9]*)?",v=a+"+",y="(?:\\/[a-zA-Z0-9-\\._~%0-9A-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*)*",_="\\/(?:"+v+y+")?";n.rfc3986.hierPart="(?:(?:\\/\\/"+m+y+")"+e+_+e+"[a-zA-Z0-9-\\._~%0-9A-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]+(?:\\/[a-zA-Z0-9-\\._~%0-9A-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*)*)",n.rfc3986.relativeRef="(?:(?:\\/\\/"+m+y+")"+e+_+e+"[a-zA-Z0-9-\\._~%0-9A-Fa-f!\\$&'\\(\\)\\*\\+,;=@]+(?:\\/[a-zA-Z0-9-\\._~%0-9A-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*)*"+e+")",n.rfc3986.query="["+i+"\\/\\?]*(?=#|$)",n.rfc3986.fragment="["+i+"\\/\\?]*"}};n.generate(),e.exports=n.rfc3986},function(e,t){},function(e,t,r){(function(e,n){var i=/%[sdj%]/g;t.format=function(e){if(!isString(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(inspect(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,a=n.length,o=String(e).replace(i,(function(e){if("%%"===e)return"%";if(r>=a)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return e}})),s=n[r];r<a;s=n[++r])isNull(s)||!isObject(s)?o+=" "+s:o+=" "+inspect(s);return o},t.deprecate=function(r,i){if(isUndefined(e.process))return function(){return t.deprecate(r,i).apply(this,arguments)};if(!0===n.noDeprecation)return r;var a=!1;return function deprecated(){if(!a){if(n.throwDeprecation)throw new Error(i);n.traceDeprecation?console.trace(i):console.error(i),a=!0}return r.apply(this,arguments)}};var a,o={};function inspect(e,r){var n={seen:[],stylize:stylizeNoColor};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),isBoolean(r)?n.showHidden=r:r&&t._extend(n,r),isUndefined(n.showHidden)&&(n.showHidden=!1),isUndefined(n.depth)&&(n.depth=2),isUndefined(n.colors)&&(n.colors=!1),isUndefined(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=stylizeWithColor),formatValue(n,e,n.depth)}function stylizeWithColor(e,t){var r=inspect.styles[t];return r?"\x1b["+inspect.colors[r][0]+"m"+e+"\x1b["+inspect.colors[r][1]+"m":e}function stylizeNoColor(e,t){return e}function formatValue(e,r,n){if(e.customInspect&&r&&isFunction(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return isString(i)||(i=formatValue(e,i,n)),i}var a=function formatPrimitive(e,t){if(isUndefined(t))return e.stylize("undefined","undefined");if(isString(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(isNumber(t))return e.stylize(""+t,"number");if(isBoolean(t))return e.stylize(""+t,"boolean");if(isNull(t))return e.stylize("null","null")}(e,r);if(a)return a;var o=Object.keys(r),s=function arrayToHash(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),isError(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return formatError(r);if(0===o.length){if(isFunction(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(isRegExp(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(isDate(r))return e.stylize(Date.prototype.toString.call(r),"date");if(isError(r))return formatError(r)}var l,c="",f=!1,d=["{","}"];(isArray(r)&&(f=!0,d=["[","]"]),isFunction(r))&&(c=" [Function"+(r.name?": "+r.name:"")+"]");return isRegExp(r)&&(c=" "+RegExp.prototype.toString.call(r)),isDate(r)&&(c=" "+Date.prototype.toUTCString.call(r)),isError(r)&&(c=" "+formatError(r)),0!==o.length||f&&0!=r.length?n<0?isRegExp(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),l=f?function formatArray(e,t,r,n,i){for(var a=[],o=0,s=t.length;o<s;++o)hasOwnProperty(t,String(o))?a.push(formatProperty(e,t,r,n,String(o),!0)):a.push("");return i.forEach((function(i){i.match(/^\d+$/)||a.push(formatProperty(e,t,r,n,i,!0))})),a}(e,r,n,s,o):o.map((function(t){return formatProperty(e,r,n,s,t,f)})),e.seen.pop(),function reduceToSingleString(e,t,r){if(e.reduce((function(e,t){return 0,t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(l,c,d)):d[0]+c+d[1]}function formatError(e){return"["+Error.prototype.toString.call(e)+"]"}function formatProperty(e,t,r,n,i,a){var o,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),hasOwnProperty(n,i)||(o="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=isNull(r)?formatValue(e,u.value,null):formatValue(e,u.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),isUndefined(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function isArray(e){return Array.isArray(e)}function isBoolean(e){return"boolean"===typeof e}function isNull(e){return null===e}function isNumber(e){return"number"===typeof e}function isString(e){return"string"===typeof e}function isUndefined(e){return void 0===e}function isRegExp(e){return isObject(e)&&"[object RegExp]"===objectToString(e)}function isObject(e){return"object"===typeof e&&null!==e}function isDate(e){return isObject(e)&&"[object Date]"===objectToString(e)}function isError(e){return isObject(e)&&("[object Error]"===objectToString(e)||e instanceof Error)}function isFunction(e){return"function"===typeof e}function objectToString(e){return Object.prototype.toString.call(e)}function pad(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(isUndefined(a)&&(a=n.env.NODE_DEBUG||""),e=e.toUpperCase(),!o[e])if(new RegExp("\\b"+e+"\\b","i").test(a)){var r=n.pid;o[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else o[e]=function(){};return o[e]},t.inspect=inspect,inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=isArray,t.isBoolean=isBoolean,t.isNull=isNull,t.isNullOrUndefined=function isNullOrUndefined(e){return null==e},t.isNumber=isNumber,t.isString=isString,t.isSymbol=function isSymbol(e){return"symbol"===typeof e},t.isUndefined=isUndefined,t.isRegExp=isRegExp,t.isObject=isObject,t.isDate=isDate,t.isError=isError,t.isFunction=isFunction,t.isPrimitive=function isPrimitive(e){return null===e||"boolean"===typeof e||"number"===typeof e||"string"===typeof e||"symbol"===typeof e||"undefined"===typeof e},t.isBuffer=r(40);var s=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp(){var e=new Date,t=[pad(e.getHours()),pad(e.getMinutes()),pad(e.getSeconds())].join(":");return[e.getDate(),s[e.getMonth()],t].join(" ")}function hasOwnProperty(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",timestamp(),t.format.apply(t,arguments))},t.inherits=r(39),t._extend=function(e,t){if(!t||!isObject(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}}).call(t,r(5),r(7))},function(e,t,r){"use strict";(function(t){function compare(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function isBuffer(e){return t.Buffer&&"function"===typeof t.Buffer.isBuffer?t.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}var n=r(16),i=Object.prototype.hasOwnProperty,a=Array.prototype.slice,o="foo"===function foo(){}.name;function pToString(e){return Object.prototype.toString.call(e)}function isView(e){return!isBuffer(e)&&("function"===typeof t.ArrayBuffer&&("function"===typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}var s=e.exports=ok,u=/\s*function\s+([^\(\s]*)\s*/;function getName(e){if(n.isFunction(e)){if(o)return e.name;var t=e.toString().match(u);return t&&t[1]}}function truncate(e,t){return"string"===typeof e?e.length<t?e:e.slice(0,t):e}function inspect(e){if(o||!n.isFunction(e))return n.inspect(e);var t=getName(e);return"[Function"+(t?": "+t:"")+"]"}function fail(e,t,r,n,i){throw new s.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:i})}function ok(e,t){e||fail(e,!0,t,"==",s.ok)}function _deepEqual(e,t,r,i){if(e===t)return!0;if(isBuffer(e)&&isBuffer(t))return 0===compare(e,t);if(n.isDate(e)&&n.isDate(t))return e.getTime()===t.getTime();if(n.isRegExp(e)&&n.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"===typeof e||null!==t&&"object"===typeof t){if(isView(e)&&isView(t)&&pToString(e)===pToString(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===compare(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(isBuffer(e)!==isBuffer(t))return!1;var o=(i=i||{actual:[],expected:[]}).actual.indexOf(e);return-1!==o&&o===i.expected.indexOf(t)||(i.actual.push(e),i.expected.push(t),function objEquiv(e,t,r,i){if(null===e||void 0===e||null===t||void 0===t)return!1;if(n.isPrimitive(e)||n.isPrimitive(t))return e===t;if(r&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var o=isArguments(e),s=isArguments(t);if(o&&!s||!o&&s)return!1;if(o)return e=a.call(e),t=a.call(t),_deepEqual(e,t,r);var u,c,f=l(e),d=l(t);if(f.length!==d.length)return!1;for(f.sort(),d.sort(),c=f.length-1;c>=0;c--)if(f[c]!==d[c])return!1;for(c=f.length-1;c>=0;c--)if(u=f[c],!_deepEqual(e[u],t[u],r,i))return!1;return!0}(e,t,r,i))}return r?e===t:e==t}function isArguments(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function expectedException(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(r){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function _throws(e,t,r,i){var a;if("function"!==typeof t)throw new TypeError('"block" argument must be a function');"string"===typeof r&&(i=r,r=null),a=function _tryBlock(e){var t;try{e()}catch(r){t=r}return t}(t),i=(r&&r.name?" ("+r.name+").":".")+(i?" "+i:"."),e&&!a&&fail(a,r,"Missing expected exception"+i);var o="string"===typeof i,s=!e&&a&&!r;if((!e&&n.isError(a)&&o&&expectedException(a,r)||s)&&fail(a,r,"Got unwanted exception"+i),e&&a&&r&&!expectedException(a,r)||!e&&a)throw a}s.AssertionError=function AssertionError(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function getMessage(e){return truncate(inspect(e.actual),128)+" "+e.operator+" "+truncate(inspect(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||fail;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,i=getName(t),a=n.indexOf("\n"+i);if(a>=0){var o=n.indexOf("\n",a+1);n=n.substring(o+1)}this.stack=n}}},n.inherits(s.AssertionError,Error),s.fail=fail,s.ok=ok,s.equal=function equal(e,t,r){e!=t&&fail(e,t,r,"==",s.equal)},s.notEqual=function notEqual(e,t,r){e==t&&fail(e,t,r,"!=",s.notEqual)},s.deepEqual=function deepEqual(e,t,r){_deepEqual(e,t,!1)||fail(e,t,r,"deepEqual",s.deepEqual)},s.deepStrictEqual=function deepStrictEqual(e,t,r){_deepEqual(e,t,!0)||fail(e,t,r,"deepStrictEqual",s.deepStrictEqual)},s.notDeepEqual=function notDeepEqual(e,t,r){_deepEqual(e,t,!1)&&fail(e,t,r,"notDeepEqual",s.notDeepEqual)},s.notDeepStrictEqual=function notDeepStrictEqual(e,t,r){_deepEqual(e,t,!0)&&fail(e,t,r,"notDeepStrictEqual",notDeepStrictEqual)},s.strictEqual=function strictEqual(e,t,r){e!==t&&fail(e,t,r,"===",s.strictEqual)},s.notStrictEqual=function notStrictEqual(e,t,r){e===t&&fail(e,t,r,"!==",s.notStrictEqual)},s.throws=function(e,t,r){_throws(!0,e,t,r)},s.doesNotThrow=function(e,t,r){_throws(!1,e,t,r)},s.ifError=function(e){if(e)throw e};var l=Object.keys||function(e){var t=[];for(var r in e)i.call(e,r)&&t.push(r);return t}}).call(t,r(5))},function(e,t,r){"use strict";(function(e){var r={};t.escapeJavaScript=function(e){if(!e)return"";for(var t="",n=0;n<e.length;++n){var i=e.charCodeAt(n);r.isSafe(i)?t+=e[n]:t+=r.escapeJavaScriptChar(i)}return t},t.escapeHtml=function(e){if(!e)return"";for(var t="",n=0;n<e.length;++n){var i=e.charCodeAt(n);r.isSafe(i)?t+=e[n]:t+=r.escapeHtmlChar(i)}return t},t.escapeJson=function(e){if(!e)return"";var t=void 0;return e.replace(/[<>&\u2028\u2029]/g,(function(e){return 60===(t=e.charCodeAt(0))?"\\u003c":62===t?"\\u003e":38===t?"\\u0026":8232===t?"\\u2028":"\\u2029"}))},r.escapeJavaScriptChar=function(t){if(t>=256)return"\\u"+r.padLeft(""+t,4);var n=e.from(String.fromCharCode(t),"ascii").toString("hex");return"\\x"+r.padLeft(n,2)},r.escapeHtmlChar=function(t){var n=r.namedHtml[t];if("undefined"!==typeof n)return n;if(t>=256)return"&#"+t+";";var i=e.from(String.fromCharCode(t),"ascii").toString("hex");return"&#x"+r.padLeft(i,2)+";"},r.padLeft=function(e,t){for(;e.length<t;)e="0"+e;return e},r.isSafe=function(e){return"undefined"!==typeof r.safeCharCodes[e]},r.namedHtml={38:"&amp;",60:"&lt;",62:"&gt;",34:"&quot;",160:"&nbsp;",162:"&cent;",163:"&pound;",164:"&curren;",169:"&copy;",174:"&reg;"},r.safeCharCodes=function(){for(var e={},t=32;t<123;++t)(t>=97||t>=65&&t<=90||t>=48&&t<=57||32===t||46===t||44===t||45===t||58===t||95===t)&&(e[t]=null);return e}()}).call(t,r(3).Buffer)},function(e,t,r){"use strict";(function(e){var n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=r(38),a={hasOwn:Object.prototype.hasOwnProperty,indexOf:Array.prototype.indexOf,defaultThreshold:16,maxIPv6Groups:8,categories:{valid:1,dnsWarn:7,rfc5321:15,cfws:31,deprecated:63,rfc5322:127,error:255},diagnoses:{valid:0,rfc5321TLD:9,rfc5321TLDNumeric:10,rfc5321QuotedString:11,rfc5321AddressLiteral:12,cfwsComment:17,cfwsFWS:18,undesiredNonAscii:25,deprecatedLocalPart:33,deprecatedFWS:34,deprecatedQTEXT:35,deprecatedQP:36,deprecatedComment:37,deprecatedCTEXT:38,deprecatedIPv6:39,deprecatedCFWSNearAt:49,rfc5322Domain:65,rfc5322TooLong:66,rfc5322LocalTooLong:67,rfc5322DomainTooLong:68,rfc5322LabelTooLong:69,rfc5322DomainLiteral:70,rfc5322DomainLiteralOBSDText:71,rfc5322IPv6GroupCount:72,rfc5322IPv62x2xColon:73,rfc5322IPv6BadCharacter:74,rfc5322IPv6MaxGroups:75,rfc5322IPv6ColonStart:76,rfc5322IPv6ColonEnd:77,errExpectingDTEXT:129,errNoLocalPart:130,errNoDomain:131,errConsecutiveDots:132,errATEXTAfterCFWS:133,errATEXTAfterQS:134,errATEXTAfterDomainLiteral:135,errExpectingQPair:136,errExpectingATEXT:137,errExpectingQTEXT:138,errExpectingCTEXT:139,errBackslashEnd:140,errDotStart:141,errDotEnd:142,errDomainHyphenStart:143,errDomainHyphenEnd:144,errUnclosedQuotedString:145,errUnclosedComment:146,errUnclosedDomainLiteral:147,errFWSCRLFx2:148,errFWSCRLFEnd:149,errCRNoLF:150,errUnknownTLD:160,errDomainTooShort:161},components:{localpart:0,domain:1,literal:2,contextComment:3,contextFWS:4,contextQuotedString:5,contextQuotedPair:6}};a.specials=function(){var e=new Array(256);e.fill(!1);for(var t=0;t<'()<>[]:;@\\,."'.length;++t)e['()<>[]:;@\\,."'.codePointAt(t)]=!0;return function(t){return e[t]}}(),a.c0Controls=function(){var e=new Array(256);e.fill(!1);for(var t=0;t<33;++t)e[t]=!0;return function(t){return e[t]}}(),a.c1Controls=function(){var e=new Array(256);e.fill(!1);for(var t=127;t<160;++t)e[t]=!0;return function(t){return e[t]}}(),a.regex={ipV4:/\b(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipV6:/^[a-fA-F\d]{0,4}$/},a.normalizeSupportsNul="\0"==="\0".normalize("NFC"),a.nulNormalize=function(e){return e.split("\0").map((function(e){return e.normalize("NFC")})).join("\0")},a.normalize=function(e){return!a.normalizeSupportsNul&&e.indexOf("\0")>=0?a.nulNormalize(e):e.normalize("NFC")},a.checkIpV6=function(e){return e.every((function(e){return a.regex.ipV6.test(e)}))},a.validDomain=function(e,t){return t.tldBlacklist?Array.isArray(t.tldBlacklist)?-1===a.indexOf.call(t.tldBlacklist,e):!a.hasOwn.call(t.tldBlacklist,e):Array.isArray(t.tldWhitelist)?-1!==a.indexOf.call(t.tldWhitelist,e):a.hasOwn.call(t.tldWhitelist,e)},t.validate=a.validate=function(t,r,o){r=r||{},t=a.normalize(t),"function"===typeof r&&(o=r,r={}),"function"!==typeof o&&(o=null);var s=void 0,u=void 0;if("number"===typeof r.errorLevel?(s=!0,u=r.errorLevel):(s=!!r.errorLevel,u=a.diagnoses.valid),r.tldWhitelist)if("string"===typeof r.tldWhitelist)r.tldWhitelist=[r.tldWhitelist];else if("object"!==n(r.tldWhitelist))throw new TypeError("expected array or object tldWhitelist");if(r.tldBlacklist)if("string"===typeof r.tldBlacklist)r.tldBlacklist=[r.tldBlacklist];else if("object"!==n(r.tldBlacklist))throw new TypeError("expected array or object tldBlacklist");if(r.minDomainAtoms&&(r.minDomainAtoms!==(0|+r.minDomainAtoms)||r.minDomainAtoms<0))throw new TypeError("expected positive integer minDomainAtoms");var l=a.diagnoses.valid,c=function updateResult(e){e>l&&(l=e)};!(void 0===r.allowUnicode||!!r.allowUnicode)&&/[^\x00-\x7f]/.test(t)&&c(a.diagnoses.undesiredNonAscii);for(var f={now:a.components.localpart,prev:a.components.localpart,stack:[a.components.localpart]},d="",h={local:"",domain:""},p={locals:[""],domains:[""]},g=0,m=0,v=0,y=void 0,_=!1,b=!1,x=t.length,w=void 0,k=0;k<x;k+=w.length){switch(w=String.fromCodePoint(t.codePointAt(k)),f.now){case a.components.localpart:switch(w){case"(":0===m?c(0===g?a.diagnoses.cfwsComment:a.diagnoses.deprecatedComment):(c(a.diagnoses.cfwsComment),b=!0),f.stack.push(f.now),f.now=a.components.contextComment;break;case".":0===m?c(0===g?a.diagnoses.errDotStart:a.diagnoses.errConsecutiveDots):(b&&c(a.diagnoses.deprecatedLocalPart),b=!1,m=0,++g,h.local+=w,p.locals[g]="");break;case'"':0===m?(c(0===g?a.diagnoses.rfc5321QuotedString:a.diagnoses.deprecatedLocalPart),h.local+=w,p.locals[g]+=w,m+=e.byteLength(w,"utf8"),b=!0,f.stack.push(f.now),f.now=a.components.contextQuotedString):c(a.diagnoses.errExpectingATEXT);break;case"\r":if(x===++k||"\n"!==t[k]){c(a.diagnoses.errCRNoLF);break}case" ":case"\t":0===m?c(0===g?a.diagnoses.cfwsFWS:a.diagnoses.deprecatedFWS):b=!0,f.stack.push(f.now),f.now=a.components.contextFWS,d=w;break;case"@":if(1!==f.stack.length)throw new Error("unexpected item on context stack");0===h.local.length?c(a.diagnoses.errNoLocalPart):0===m?c(a.diagnoses.errDotEnd):e.byteLength(h.local,"utf8")>64?c(a.diagnoses.rfc5322LocalTooLong):f.prev!==a.components.contextComment&&f.prev!==a.components.contextFWS||c(a.diagnoses.deprecatedCFWSNearAt),f.now=a.components.domain,f.stack[0]=a.components.domain,g=0,m=0,b=!1;break;default:if(b)switch(f.prev){case a.components.contextComment:case a.components.contextFWS:c(a.diagnoses.errATEXTAfterCFWS);break;case a.components.contextQuotedString:c(a.diagnoses.errATEXTAfterQS);break;default:throw new Error("more atext found where none is allowed, but unrecognized prev context: "+f.prev)}else f.prev=f.now,y=w.codePointAt(0),(a.specials(y)||a.c0Controls(y)||a.c1Controls(y))&&c(a.diagnoses.errExpectingATEXT),h.local+=w,p.locals[g]+=w,m+=e.byteLength(w,"utf8")}break;case a.components.domain:switch(w){case"(":0===m?c(0===g?a.diagnoses.deprecatedCFWSNearAt:a.diagnoses.deprecatedComment):(b=!0,c(a.diagnoses.cfwsComment)),f.stack.push(f.now),f.now=a.components.contextComment;break;case".":var S=i.encode(p.domains[g]).length;0===m?c(0===g?a.diagnoses.errDotStart:a.diagnoses.errConsecutiveDots):_?c(a.diagnoses.errDomainHyphenEnd):S>63&&c(a.diagnoses.rfc5322LabelTooLong),b=!1,m=0,++g,p.domains[g]="",h.domain+=w;break;case"[":0===h.domain.length?(b=!0,m+=e.byteLength(w,"utf8"),f.stack.push(f.now),f.now=a.components.literal,h.domain+=w,p.domains[g]+=w,h.literal=""):c(a.diagnoses.errExpectingATEXT);break;case"\r":if(x===++k||"\n"!==t[k]){c(a.diagnoses.errCRNoLF);break}case" ":case"\t":0===m?c(0===g?a.diagnoses.deprecatedCFWSNearAt:a.diagnoses.deprecatedFWS):(c(a.diagnoses.cfwsFWS),b=!0),f.stack.push(f.now),f.now=a.components.contextFWS,d=w;break;default:if(b)switch(f.prev){case a.components.contextComment:case a.components.contextFWS:c(a.diagnoses.errATEXTAfterCFWS);break;case a.components.literal:c(a.diagnoses.errATEXTAfterDomainLiteral);break;default:throw new Error("more atext found where none is allowed, but unrecognized prev context: "+f.prev)}y=w.codePointAt(0),_=!1,a.specials(y)||a.c0Controls(y)||a.c1Controls(y)?c(a.diagnoses.errExpectingATEXT):"-"===w?(0===m&&c(a.diagnoses.errDomainHyphenStart),_=!0):(y<48||y>122&&y<192||y>57&&y<65||y>90&&y<97)&&c(a.diagnoses.rfc5322Domain),h.domain+=w,p.domains[g]+=w,m+=e.byteLength(w,"utf8")}break;case a.components.literal:switch(w){case"]":if(l<a.categories.deprecated){var E=-1,C=h.literal,T=a.regex.ipV4.exec(C);if(T&&0!==(E=T.index)&&(C=C.slice(0,E)+"0:0"),0===E)c(a.diagnoses.rfc5321AddressLiteral);else if("ipv6:"!==C.slice(0,5).toLowerCase())c(a.diagnoses.rfc5322DomainLiteral);else{var O=C.slice(5),A=a.maxIPv6Groups,R=O.split(":");~(E=O.indexOf("::"))?E!==O.lastIndexOf("::")?c(a.diagnoses.rfc5322IPv62x2xColon):(0!==E&&E!==O.length-2||++A,R.length>A?c(a.diagnoses.rfc5322IPv6MaxGroups):R.length===A&&c(a.diagnoses.deprecatedIPv6)):R.length!==A&&c(a.diagnoses.rfc5322IPv6GroupCount),":"===O[0]&&":"!==O[1]?c(a.diagnoses.rfc5322IPv6ColonStart):":"===O[O.length-1]&&":"!==O[O.length-2]?c(a.diagnoses.rfc5322IPv6ColonEnd):a.checkIpV6(R)?c(a.diagnoses.rfc5321AddressLiteral):c(a.diagnoses.rfc5322IPv6BadCharacter)}}else c(a.diagnoses.rfc5322DomainLiteral);h.domain+=w,p.domains[g]+=w,m+=e.byteLength(w,"utf8"),f.prev=f.now,f.now=f.stack.pop();break;case"\\":c(a.diagnoses.rfc5322DomainLiteralOBSDText),f.stack.push(f.now),f.now=a.components.contextQuotedPair;break;case"\r":if(x===++k||"\n"!==t[k]){c(a.diagnoses.errCRNoLF);break}case" ":case"\t":c(a.diagnoses.cfwsFWS),f.stack.push(f.now),f.now=a.components.contextFWS,d=w;break;default:if(127!==(y=w.codePointAt(0))&&a.c1Controls(y)||0===y||"["===w){c(a.diagnoses.errExpectingDTEXT);break}(a.c0Controls(y)||127===y)&&c(a.diagnoses.rfc5322DomainLiteralOBSDText),h.literal+=w,h.domain+=w,p.domains[g]+=w,m+=e.byteLength(w,"utf8")}break;case a.components.contextQuotedString:switch(w){case"\\":f.stack.push(f.now),f.now=a.components.contextQuotedPair;break;case"\r":if(x===++k||"\n"!==t[k]){c(a.diagnoses.errCRNoLF);break}case"\t":h.local+=" ",p.locals[g]+=" ",m+=e.byteLength(w,"utf8"),c(a.diagnoses.cfwsFWS),f.stack.push(f.now),f.now=a.components.contextFWS,d=w;break;case'"':h.local+=w,p.locals[g]+=w,m+=e.byteLength(w,"utf8"),f.prev=f.now,f.now=f.stack.pop();break;default:127!==(y=w.codePointAt(0))&&a.c1Controls(y)||0===y||10===y?c(a.diagnoses.errExpectingQTEXT):(a.c0Controls(y)||127===y)&&c(a.diagnoses.deprecatedQTEXT),h.local+=w,p.locals[g]+=w,m+=e.byteLength(w,"utf8")}break;case a.components.contextQuotedPair:127!==(y=w.codePointAt(0))&&a.c1Controls(y)?c(a.diagnoses.errExpectingQPair):(y<31&&9!==y||127===y)&&c(a.diagnoses.deprecatedQP),f.prev=f.now,f.now=f.stack.pop();var D="\\"+w;switch(f.now){case a.components.contextComment:break;case a.components.contextQuotedString:h.local+=D,p.locals[g]+=D,m+=2;break;case a.components.literal:h.domain+=D,p.domains[g]+=D,m+=2;break;default:throw new Error("quoted pair logic invoked in an invalid context: "+f.now)}break;case a.components.contextComment:switch(w){case"(":f.stack.push(f.now),f.now=a.components.contextComment;break;case")":f.prev=f.now,f.now=f.stack.pop();break;case"\\":f.stack.push(f.now),f.now=a.components.contextQuotedPair;break;case"\r":if(x===++k||"\n"!==t[k]){c(a.diagnoses.errCRNoLF);break}case" ":case"\t":c(a.diagnoses.cfwsFWS),f.stack.push(f.now),f.now=a.components.contextFWS,d=w;break;default:if(0===(y=w.codePointAt(0))||10===y||127!==y&&a.c1Controls(y)){c(a.diagnoses.errExpectingCTEXT);break}(a.c0Controls(y)||127===y)&&c(a.diagnoses.deprecatedCTEXT)}break;case a.components.contextFWS:if("\r"===d){if("\r"===w){c(a.diagnoses.errFWSCRLFx2);break}++v>1?c(a.diagnoses.deprecatedFWS):v=1}switch(w){case"\r":x!==++k&&"\n"===t[k]||c(a.diagnoses.errCRNoLF);break;case" ":case"\t":break;default:"\r"===d&&c(a.diagnoses.errFWSCRLFEnd),v=0,f.prev=f.now,f.now=f.stack.pop(),--k}d=w;break;default:throw new Error("unknown context: "+f.now)}if(l>a.categories.rfc5322)break}if(l<a.categories.rfc5322){var P=i.encode(h.domain).length;if(f.now===a.components.contextQuotedString)c(a.diagnoses.errUnclosedQuotedString);else if(f.now===a.components.contextQuotedPair)c(a.diagnoses.errBackslashEnd);else if(f.now===a.components.contextComment)c(a.diagnoses.errUnclosedComment);else if(f.now===a.components.literal)c(a.diagnoses.errUnclosedDomainLiteral);else if("\r"===w)c(a.diagnoses.errFWSCRLFEnd);else if(0===h.domain.length)c(a.diagnoses.errNoDomain);else if(0===m)c(a.diagnoses.errDotEnd);else if(_)c(a.diagnoses.errDomainHyphenEnd);else if(P>255)c(a.diagnoses.rfc5322DomainTooLong);else if(e.byteLength(h.local,"utf8")+P+1>254)c(a.diagnoses.rfc5322TooLong);else if(m>63)c(a.diagnoses.rfc5322LabelTooLong);else if(r.minDomainAtoms&&p.domains.length<r.minDomainAtoms)c(a.diagnoses.errDomainTooShort);else if(r.tldWhitelist||r.tldBlacklist){var j=p.domains[g];a.validDomain(j,r)||c(a.diagnoses.errUnknownTLD)}}l<a.categories.dnsWarn&&(p.domains[g].codePointAt(0)<=57&&c(a.diagnoses.rfc5321TLDNumeric));l<u&&(l=a.diagnoses.valid);var M=s?l:l<a.defaultThreshold;return o&&o(M),M},t.diagnoses=a.validate.diagnoses=function(){for(var e={},t=Object.keys(a.diagnoses),r=0;r<t.length;++r){var n=t[r];e[n]=a.diagnoses[n]}return e}(),t.normalize=a.normalize}).call(t,r(3).Buffer)},function(e,t,r){"use strict";t.errors={root:"value",key:'"{{!label}}" ',messages:{wrapArrays:!0},any:{unknown:"is not allowed",invalid:"contains an invalid value",empty:"is not allowed to be empty",required:"is required",allowOnly:"must be one of {{valids}}",default:"threw an error when running default method"},alternatives:{base:"not matching any of the allowed alternatives",child:null},array:{base:"must be an array",includes:"at position {{pos}} does not match any of the allowed types",includesSingle:'single value of "{{!label}}" does not match any of the allowed types',includesOne:"at position {{pos}} fails because {{reason}}",includesOneSingle:'single value of "{{!label}}" fails because {{reason}}',includesRequiredUnknowns:"does not contain {{unknownMisses}} required value(s)",includesRequiredKnowns:"does not contain {{knownMisses}}",includesRequiredBoth:"does not contain {{knownMisses}} and {{unknownMisses}} other required value(s)",excludes:"at position {{pos}} contains an excluded value",excludesSingle:'single value of "{{!label}}" contains an excluded value',min:"must contain at least {{limit}} items",max:"must contain less than or equal to {{limit}} items",length:"must contain {{limit}} items",ordered:"at position {{pos}} fails because {{reason}}",orderedLength:"at position {{pos}} fails because array must contain at most {{limit}} items",ref:'references "{{ref}}" which is not a positive integer',sparse:"must not be a sparse array",unique:"position {{pos}} contains a duplicate value"},boolean:{base:"must be a boolean"},binary:{base:"must be a buffer or a string",min:"must be at least {{limit}} bytes",max:"must be less than or equal to {{limit}} bytes",length:"must be {{limit}} bytes"},date:{base:"must be a number of milliseconds or valid date string",format:"must be a string with one of the following formats {{format}}",strict:"must be a valid date",min:'must be larger than or equal to "{{limit}}"',max:'must be less than or equal to "{{limit}}"',less:'must be less than "{{limit}}"',greater:'must be greater than "{{limit}}"',isoDate:"must be a valid ISO 8601 date",timestamp:{javascript:"must be a valid timestamp or number of milliseconds",unix:"must be a valid timestamp or number of seconds"},ref:'references "{{ref}}" which is not a date'},function:{base:"must be a Function",arity:"must have an arity of {{n}}",minArity:"must have an arity greater or equal to {{n}}",maxArity:"must have an arity lesser or equal to {{n}}",ref:"must be a Joi reference",class:"must be a class"},lazy:{base:"!!schema error: lazy schema must be set",schema:"!!schema error: lazy schema function must return a schema"},object:{base:"must be an object",child:'!!child "{{!child}}" fails because {{reason}}',min:"must have at least {{limit}} children",max:"must have less than or equal to {{limit}} children",length:"must have {{limit}} children",allowUnknown:'!!"{{!child}}" is not allowed',with:'!!"{{mainWithLabel}}" missing required peer "{{peerWithLabel}}"',without:'!!"{{mainWithLabel}}" conflict with forbidden peer "{{peerWithLabel}}"',missing:"must contain at least one of {{peersWithLabels}}",xor:"contains a conflict between exclusive peers {{peersWithLabels}}",or:"must contain at least one of {{peersWithLabels}}",and:"contains {{presentWithLabels}} without its required peers {{missingWithLabels}}",nand:'!!"{{mainWithLabel}}" must not exist simultaneously with {{peersWithLabels}}',assert:'!!"{{ref}}" validation failed because "{{ref}}" failed to {{message}}',rename:{multiple:'cannot rename child "{{from}}" because multiple renames are disabled and another key was already renamed to "{{to}}"',override:'cannot rename child "{{from}}" because override is disabled and target "{{to}}" exists',regex:{multiple:'cannot rename children {{from}} because multiple renames are disabled and another key was already renamed to "{{to}}"',override:'cannot rename children {{from}} because override is disabled and target "{{to}}" exists'}},type:'must be an instance of "{{type}}"',schema:"must be a Joi instance"},number:{base:"must be a number",min:"must be larger than or equal to {{limit}}",max:"must be less than or equal to {{limit}}",less:"must be less than {{limit}}",greater:"must be greater than {{limit}}",float:"must be a float or double",integer:"must be an integer",negative:"must be a negative number",positive:"must be a positive number",precision:"must have no more than {{limit}} decimal places",ref:'references "{{ref}}" which is not a number',multiple:"must be a multiple of {{multiple}}",port:"must be a valid port"},string:{base:"must be a string",min:"length must be at least {{limit}} characters long",max:"length must be less than or equal to {{limit}} characters long",length:"length must be {{limit}} characters long",alphanum:"must only contain alpha-numeric characters",token:"must only contain alpha-numeric and underscore characters",regex:{base:'with value "{{!value}}" fails to match the required pattern: {{pattern}}',name:'with value "{{!value}}" fails to match the {{name}} pattern',invert:{base:'with value "{{!value}}" matches the inverted pattern: {{pattern}}',name:'with value "{{!value}}" matches the inverted {{name}} pattern'}},email:"must be a valid email",uri:"must be a valid uri",uriRelativeOnly:"must be a valid relative uri",uriCustomScheme:"must be a valid uri with a scheme matching the {{scheme}} pattern",isoDate:"must be a valid ISO 8601 date",guid:"must be a valid GUID",hex:"must only contain hexadecimal characters",hexAlign:"hex decoded representation must be byte aligned",base64:"must be a valid base64 string",hostname:"must be a valid hostname",normalize:"must be unicode normalized in the {{form}} form",lowercase:"must only contain lowercase characters",uppercase:"must only contain uppercase characters",trim:"must not have leading or trailing whitespace",creditCard:"must be a credit card",ref:'references "{{ref}}" which is not a number',ip:"must be a valid ip address with a {{cidr}} CIDR",ipVersion:"must be a valid ip address of one of the following versions {{version}} with a {{cidr}} CIDR"}}},function(e,t,r){"use strict";var n=r(8);t.options=n.object({abortEarly:n.boolean(),convert:n.boolean(),allowUnknown:n.boolean(),skipFunctions:n.boolean(),stripUnknown:[n.boolean(),n.object({arrays:n.boolean(),objects:n.boolean()}).or("arrays","objects")],language:n.object(),presence:n.string().only("required","optional","forbidden","ignore"),raw:n.boolean(),context:n.object(),strip:n.boolean(),noDefaults:n.boolean(),escapeHtml:n.boolean()}).strict()},function(e,t,r){"use strict";var n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function _inherits(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):function _defaults(e,t){for(var r=Object.getOwnPropertyNames(t),n=0;n<r.length;n++){var i=r[n],a=Object.getOwnPropertyDescriptor(t,i);a&&a.configurable&&void 0===e[i]&&Object.defineProperty(e,i,a)}return e}(e,t))}var i=r(2),a=r(4),o=r(1),s=r(0),u={fastSplice:function(e,t){for(var r=t;r<e.length;)e[r++]=e[r];--e.length}};u.Array=function(e){function _class(){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,_class);var t=function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,e.call(this));return t._type="array",t._inner.items=[],t._inner.ordereds=[],t._inner.inclusions=[],t._inner.exclusions=[],t._inner.requireds=[],t._flags.sparse=!1,t}return _inherits(_class,e),_class.prototype._base=function _base(e,t,r){var n={value:e};"string"===typeof e&&r.convert&&u.safeParse(e,n);var i=Array.isArray(n.value),a=i;if(r.convert&&this._flags.single&&!i&&(n.value=[n.value],i=!0),!i)return n.errors=this.createError("array.base",null,t,r),n;if((this._inner.inclusions.length||this._inner.exclusions.length||this._inner.requireds.length||this._inner.ordereds.length||!this._flags.sparse)&&(a&&(n.value=n.value.slice(0)),n.errors=this._checkItems.call(this,n.value,a,t,r),n.errors&&a&&r.convert&&this._flags.single)){var o=n.errors;n.value=[n.value],n.errors=this._checkItems.call(this,n.value,a,t,r),n.errors&&(n.errors=o,n.value=n.value[0])}return n},_class.prototype._checkItems=function _checkItems(e,t,r,n){for(var i=[],a=void 0,o=this._inner.requireds.slice(),s=this._inner.ordereds.slice(),l=this._inner.inclusions.concat(o),c=e.length,f=0;f<c;++f){a=!1;var d=e[f],h=!1,p={key:t?f:r.key,path:t?r.path.concat(f):r.path,parent:r.parent,reference:r.reference},g=void 0;if(this._flags.sparse||void 0!==d){for(var m=0;m<this._inner.exclusions.length;++m)if(!(g=this._inner.exclusions[m]._validate(d,p,{})).errors){if(i.push(this.createError(t?"array.excludes":"array.excludesSingle",{pos:f,value:d},{key:r.key,path:p.path},n)),a=!0,n.abortEarly)return i;s.shift();break}if(!a){if(this._inner.ordereds.length){if(s.length>0){var v=s.shift();if((g=v._validate(d,p,n)).errors){if(i.push(this.createError("array.ordered",{pos:f,reason:g.errors,value:d},{key:r.key,path:p.path},n)),n.abortEarly)return i}else if(v._flags.strip)u.fastSplice(e,f),--f,--c;else{if(!this._flags.sparse&&void 0===g.value){if(i.push(this.createError("array.sparse",null,{key:r.key,path:p.path,pos:f},n)),n.abortEarly)return i;continue}e[f]=g.value}continue}if(!this._inner.items.length){if(i.push(this.createError("array.orderedLength",{pos:f,limit:this._inner.ordereds.length},{key:r.key,path:p.path},n)),n.abortEarly)return i;continue}}for(var y=[],_=o.length,b=0;b<_;++b)if(!(g=y[b]=o[b]._validate(d,p,n)).errors){if(e[f]=g.value,h=!0,u.fastSplice(o,b),--b,--_,!this._flags.sparse&&void 0===g.value&&(i.push(this.createError("array.sparse",null,{key:r.key,path:p.path,pos:f},n)),n.abortEarly))return i;break}if(!h){var x=!!n.stripUnknown&&(!0===n.stripUnknown||!!n.stripUnknown.arrays);_=l.length;for(var w=0;w<_;++w){var k=l[w],S=o.indexOf(k);if(-1!==S)g=y[S];else if(!(g=k._validate(d,p,n)).errors){k._flags.strip?(u.fastSplice(e,f),--f,--c):this._flags.sparse||void 0!==g.value?e[f]=g.value:(i.push(this.createError("array.sparse",null,{key:r.key,path:p.path,pos:f},n)),a=!0),h=!0;break}if(1===_){if(x){u.fastSplice(e,f),--f,--c,h=!0;break}if(i.push(this.createError(t?"array.includesOne":"array.includesOneSingle",{pos:f,reason:g.errors,value:d},{key:r.key,path:p.path},n)),a=!0,n.abortEarly)return i;break}}if(!a&&this._inner.inclusions.length&&!h){if(x){u.fastSplice(e,f),--f,--c;continue}if(i.push(this.createError(t?"array.includes":"array.includesSingle",{pos:f,value:d},{key:r.key,path:p.path},n)),n.abortEarly)return i}}}}else{if(i.push(this.createError("array.sparse",null,{key:r.key,path:p.path,pos:f},n)),n.abortEarly)return i;s.shift()}}return o.length&&this._fillMissedErrors.call(this,i,o,r,n),s.length&&this._fillOrderedErrors.call(this,i,s,r,n),i.length?i:null},_class.prototype.describe=function describe(){var e=i.prototype.describe.call(this);if(this._inner.ordereds.length){e.orderedItems=[];for(var t=0;t<this._inner.ordereds.length;++t)e.orderedItems.push(this._inner.ordereds[t].describe())}if(this._inner.items.length){e.items=[];for(var r=0;r<this._inner.items.length;++r)e.items.push(this._inner.items[r].describe())}return e},_class.prototype.items=function items(){for(var e=this,t=this.clone(),r=arguments.length,n=Array(r),i=0;i<r;i++)n[i]=arguments[i];return s.flatten(n).forEach((function(r,n){try{r=a.schema(e._currentJoi,r)}catch(i){throw i.hasOwnProperty("path")?i.path=n+"."+i.path:i.path=n,i.message=i.message+"("+i.path+")",i}t._inner.items.push(r),"required"===r._flags.presence?t._inner.requireds.push(r):"forbidden"===r._flags.presence?t._inner.exclusions.push(r.optional()):t._inner.inclusions.push(r)})),t},_class.prototype.ordered=function ordered(){for(var e=this,t=this.clone(),r=arguments.length,n=Array(r),i=0;i<r;i++)n[i]=arguments[i];return s.flatten(n).forEach((function(r,n){try{r=a.schema(e._currentJoi,r)}catch(i){throw i.hasOwnProperty("path")?i.path=n+"."+i.path:i.path=n,i.message=i.message+"("+i.path+")",i}t._inner.ordereds.push(r)})),t},_class.prototype.min=function min(e){var t=o.isRef(e);return s.assert(Number.isSafeInteger(e)&&e>=0||t,"limit must be a positive integer or reference"),this._test("min",e,(function(r,n,i){var a=void 0;if(t){if(a=e(n.reference||n.parent,i),!(Number.isSafeInteger(a)&&a>=0))return this.createError("array.ref",{ref:e.key},n,i)}else a=e;return r.length>=a?r:this.createError("array.min",{limit:e,value:r},n,i)}))},_class.prototype.max=function max(e){var t=o.isRef(e);return s.assert(Number.isSafeInteger(e)&&e>=0||t,"limit must be a positive integer or reference"),this._test("max",e,(function(r,n,i){var a=void 0;if(t){if(a=e(n.reference||n.parent,i),!(Number.isSafeInteger(a)&&a>=0))return this.createError("array.ref",{ref:e.key},n,i)}else a=e;return r.length<=a?r:this.createError("array.max",{limit:e,value:r},n,i)}))},_class.prototype.length=function length(e){var t=o.isRef(e);return s.assert(Number.isSafeInteger(e)&&e>=0||t,"limit must be a positive integer or reference"),this._test("length",e,(function(r,n,i){var a=void 0;if(t){if(a=e(n.reference||n.parent,i),!(Number.isSafeInteger(a)&&a>=0))return this.createError("array.ref",{ref:e.key},n,i)}else a=e;return r.length===a?r:this.createError("array.length",{limit:e,value:r},n,i)}))},_class.prototype.unique=function unique(e){s.assert(void 0===e||"function"===typeof e||"string"===typeof e,"comparator must be a function or a string");var t={};return"string"===typeof e?t.path=e:"function"===typeof e&&(t.comparator=e),this._test("unique",t,(function(e,r,i){for(var a={string:Object.create(null),number:Object.create(null),undefined:Object.create(null),boolean:Object.create(null),object:new Map,function:new Map,custom:new Map},o=t.comparator||s.deepEqual,u=0;u<e.length;++u){var l=t.path?s.reach(e[u],t.path):e[u],c=t.comparator?a.custom:a["undefined"===typeof l?"undefined":n(l)];if(c)if(c instanceof Map){for(var f=c.entries(),d=void 0;!(d=f.next()).done;)if(o(d.value[0],l)){var h={key:r.key,path:r.path.concat(u),parent:r.parent,reference:r.reference},p={pos:u,value:e[u],dupePos:d.value[1],dupeValue:e[d.value[1]]};return t.path&&(p.path=t.path),this.createError("array.unique",p,h,i)}c.set(l,u)}else{if(void 0!==c[l]){var g={key:r.key,path:r.path.concat(u),parent:r.parent,reference:r.reference},m={pos:u,value:e[u],dupePos:c[l],dupeValue:e[c[l]]};return t.path&&(m.path=t.path),this.createError("array.unique",m,g,i)}c[l]=u}}return e}))},_class.prototype.sparse=function sparse(e){var t=void 0===e||!!e;if(this._flags.sparse===t)return this;var r=this.clone();return r._flags.sparse=t,r},_class.prototype.single=function single(e){var t=void 0===e||!!e;if(this._flags.single===t)return this;var r=this.clone();return r._flags.single=t,r},_class.prototype._fillMissedErrors=function _fillMissedErrors(e,t,r,n){for(var i=[],a=0,o=0;o<t.length;++o){var s=t[o]._getLabel();s?i.push(s):++a}i.length?a?e.push(this.createError("array.includesRequiredBoth",{knownMisses:i,unknownMisses:a},{key:r.key,path:r.path},n)):e.push(this.createError("array.includesRequiredKnowns",{knownMisses:i},{key:r.key,path:r.path},n)):e.push(this.createError("array.includesRequiredUnknowns",{unknownMisses:a},{key:r.key,path:r.path},n))},_class.prototype._fillOrderedErrors=function _fillOrderedErrors(e,t,r,n){for(var i=[],a=0;a<t.length;++a){"required"===s.reach(t[a],"_flags.presence")&&i.push(t[a])}i.length&&this._fillMissedErrors.call(this,e,i,r,n)},_class}(i),u.safeParse=function(e,t){try{var r=JSON.parse(e);Array.isArray(r)&&(t.value=r)}catch(n){}},e.exports=new u.Array},function(e,t,r){"use strict";(function(t){function _inherits(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):function _defaults(e,t){for(var r=Object.getOwnPropertyNames(t),n=0;n<r.length;n++){var i=r[n],a=Object.getOwnPropertyDescriptor(t,i);a&&a.configurable&&void 0===e[i]&&Object.defineProperty(e,i,a)}return e}(e,t))}var n=r(2),i=r(0),a={};a.Binary=function(e){function _class(){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,_class);var t=function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,e.call(this));return t._type="binary",t}return _inherits(_class,e),_class.prototype._base=function _base(e,r,n){var i={value:e};if("string"===typeof e&&n.convert)try{i.value=t.from(e,this._flags.encoding)}catch(a){}return i.errors=t.isBuffer(i.value)?null:this.createError("binary.base",null,r,n),i},_class.prototype.encoding=function encoding(e){if(i.assert(t.isEncoding(e),"Invalid encoding:",e),this._flags.encoding===e)return this;var r=this.clone();return r._flags.encoding=e,r},_class.prototype.min=function min(e){return i.assert(Number.isSafeInteger(e)&&e>=0,"limit must be a positive integer"),this._test("min",e,(function(t,r,n){return t.length>=e?t:this.createError("binary.min",{limit:e,value:t},r,n)}))},_class.prototype.max=function max(e){return i.assert(Number.isSafeInteger(e)&&e>=0,"limit must be a positive integer"),this._test("max",e,(function(t,r,n){return t.length<=e?t:this.createError("binary.max",{limit:e,value:t},r,n)}))},_class.prototype.length=function length(e){return i.assert(Number.isSafeInteger(e)&&e>=0,"limit must be a positive integer"),this._test("length",e,(function(t,r,n){return t.length===e?t:this.createError("binary.length",{limit:e,value:t},r,n)}))},_class}(n),e.exports=new a.Binary}).call(t,r(3).Buffer)},function(e,t,r){"use strict";function _inherits(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):function _defaults(e,t){for(var r=Object.getOwnPropertyNames(t),n=0;n<r.length;n++){var i=r[n],a=Object.getOwnPropertyDescriptor(t,i);a&&a.configurable&&void 0===e[i]&&Object.defineProperty(e,i,a)}return e}(e,t))}var n=r(2),i=r(0),a={Set:r(9)};a.Boolean=function(e){function _class(){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,_class);var t=function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,e.call(this));return t._type="boolean",t._flags.insensitive=!0,t._inner.truthySet=new a.Set,t._inner.falsySet=new a.Set,t}return _inherits(_class,e),_class.prototype._base=function _base(e,t,r){var n={value:e};if("string"===typeof e&&r.convert){var i=this._flags.insensitive?e.toLowerCase():e;n.value="true"===i||"false"!==i&&e}return"boolean"!==typeof n.value&&(n.value=!!this._inner.truthySet.has(e,null,null,this._flags.insensitive)||!this._inner.falsySet.has(e,null,null,this._flags.insensitive)&&e),n.errors="boolean"===typeof n.value?null:this.createError("boolean.base",null,t,r),n},_class.prototype.truthy=function truthy(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=this.clone();t=i.flatten(t);for(var a=0;a<t.length;++a){var o=t[a];i.assert(void 0!==o,"Cannot call truthy with undefined"),n._inner.truthySet.add(o)}return n},_class.prototype.falsy=function falsy(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=this.clone();t=i.flatten(t);for(var a=0;a<t.length;++a){var o=t[a];i.assert(void 0!==o,"Cannot call falsy with undefined"),n._inner.falsySet.add(o)}return n},_class.prototype.insensitive=function insensitive(e){var insensitive=void 0===e||!!e;if(this._flags.insensitive===insensitive)return this;var t=this.clone();return t._flags.insensitive=insensitive,t},_class.prototype.describe=function describe(){var e=n.prototype.describe.call(this);return e.truthy=[!0].concat(this._inner.truthySet.values()),e.falsy=[!1].concat(this._inner.falsySet.values()),e},_class}(n),e.exports=new a.Boolean},function(e,t,r){"use strict";function _inherits(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):function _defaults(e,t){for(var r=Object.getOwnPropertyNames(t),n=0;n<r.length;n++){var i=r[n],a=Object.getOwnPropertyDescriptor(t,i);a&&a.configurable&&void 0===e[i]&&Object.defineProperty(e,i,a)}return e}(e,t))}var n=r(0),i=r(13),a=r(1),o={};o.Func=function(e){function _class(){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,_class);var t=function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,e.call(this));return t._flags.func=!0,t}return _inherits(_class,e),_class.prototype.arity=function arity(e){return n.assert(Number.isSafeInteger(e)&&e>=0,"n must be a positive integer"),this._test("arity",e,(function(t,r,n){return t.length===e?t:this.createError("function.arity",{n:e},r,n)}))},_class.prototype.minArity=function minArity(e){return n.assert(Number.isSafeInteger(e)&&e>0,"n must be a strict positive integer"),this._test("minArity",e,(function(t,r,n){return t.length>=e?t:this.createError("function.minArity",{n:e},r,n)}))},_class.prototype.maxArity=function maxArity(e){return n.assert(Number.isSafeInteger(e)&&e>=0,"n must be a positive integer"),this._test("maxArity",e,(function(t,r,n){return t.length<=e?t:this.createError("function.maxArity",{n:e},r,n)}))},_class.prototype.ref=function ref(){return this._test("ref",null,(function(e,t,r){return a.isRef(e)?e:this.createError("function.ref",null,t,r)}))},_class.prototype.class=function _class(){return this._test("class",null,(function(e,t,r){return/^\s*class\s/.test(e.toString())?e:this.createError("function.class",null,t,r)}))},_class}(i.constructor),e.exports=new o.Func},function(e,t,r){"use strict";function _inherits(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):function _defaults(e,t){for(var r=Object.getOwnPropertyNames(t),n=0;n<r.length;n++){var i=r[n],a=Object.getOwnPropertyDescriptor(t,i);a&&a.configurable&&void 0===e[i]&&Object.defineProperty(e,i,a)}return e}(e,t))}var n=r(2),i=r(0),a={};a.Lazy=function(e){function _class(){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,_class);var t=function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,e.call(this));return t._type="lazy",t}return _inherits(_class,e),_class.prototype._base=function _base(e,t,r){var i={value:e},a=this._flags.lazy;if(!a)return i.errors=this.createError("lazy.base",null,t,r),i;var o=a();return o instanceof n?o._validate(e,t,r):(i.errors=this.createError("lazy.schema",null,t,r),i)},_class.prototype.set=function set(e){i.assert("function"===typeof e,"You must provide a function as first argument");var t=this.clone();return t._flags.lazy=e,t},_class}(n),e.exports=new a.Lazy},function(e,t,r){"use strict";function _inherits(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):function _defaults(e,t){for(var r=Object.getOwnPropertyNames(t),n=0;n<r.length;n++){var i=r[n],a=Object.getOwnPropertyDescriptor(t,i);a&&a.configurable&&void 0===e[i]&&Object.defineProperty(e,i,a)}return e}(e,t))}var n=r(2),i=r(1),a=r(0),o={precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/};o.Number=function(e){function _class(){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,_class);var t=function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,e.call(this));return t._type="number",t._invalids.add(1/0),t._invalids.add(-1/0),t}return _inherits(_class,e),_class.prototype._base=function _base(e,t,r){var n={errors:null,value:e};if("string"===typeof e&&r.convert){var i=parseFloat(e);n.value=isNaN(i)||!isFinite(e)?NaN:i}var a="number"===typeof n.value&&!isNaN(n.value);if(r.convert&&"precision"in this._flags&&a){var o=Math.pow(10,this._flags.precision);n.value=Math.round(n.value*o)/o}return n.errors=a?null:this.createError("number.base",null,t,r),n},_class.prototype.multiple=function multiple(e){var t=i.isRef(e);return t||(a.assert("number"===typeof e&&isFinite(e),"multiple must be a number"),a.assert(e>0,"multiple must be greater than 0")),this._test("multiple",e,(function(r,n,i){var a=t?e(n.reference||n.parent,i):e;return!t||"number"===typeof a&&isFinite(a)?r%a===0?r:this.createError("number.multiple",{multiple:e,value:r},n,i):this.createError("number.ref",{ref:e.key},n,i)}))},_class.prototype.integer=function integer(){return this._test("integer",void 0,(function(e,t,r){return Number.isSafeInteger(e)?e:this.createError("number.integer",{value:e},t,r)}))},_class.prototype.negative=function negative(){return this._test("negative",void 0,(function(e,t,r){return e<0?e:this.createError("number.negative",{value:e},t,r)}))},_class.prototype.positive=function positive(){return this._test("positive",void 0,(function(e,t,r){return e>0?e:this.createError("number.positive",{value:e},t,r)}))},_class.prototype.precision=function precision(e){a.assert(Number.isSafeInteger(e),"limit must be an integer"),a.assert(!("precision"in this._flags),"precision already set");var t=this._test("precision",e,(function(t,r,n){var i=t.toString().match(o.precisionRx);return Math.max((i[1]?i[1].length:0)-(i[2]?parseInt(i[2],10):0),0)<=e?t:this.createError("number.precision",{limit:e,value:t},r,n)}));return t._flags.precision=e,t},_class.prototype.port=function port(){return this._test("port",void 0,(function(e,t,r){return!Number.isSafeInteger(e)||e<0||e>65535?this.createError("number.port",{value:e},t,r):e}))},_class}(n),o.compare=function(e,t){return function(r){var n=i.isRef(r),o="number"===typeof r&&!isNaN(r);return a.assert(o||n,"limit must be a number or reference"),this._test(e,r,(function(i,a,o){var s=void 0;if(n){if("number"!==typeof(s=r(a.reference||a.parent,o))||isNaN(s))return this.createError("number.ref",{ref:r.key},a,o)}else s=r;return t(i,s)?i:this.createError("number."+e,{limit:s,value:i},a,o)}))}},o.Number.prototype.min=o.compare("min",(function(e,t){return e>=t})),o.Number.prototype.max=o.compare("max",(function(e,t){return e<=t})),o.Number.prototype.greater=o.compare("greater",(function(e,t){return e>t})),o.Number.prototype.less=o.compare("less",(function(e,t){return e<t})),e.exports=new o.Number},function(e,t,r){"use strict";(function(t){var n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function _inherits(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):function _defaults(e,t){for(var r=Object.getOwnPropertyNames(t),n=0;n<r.length;n++){var i=r[n],a=Object.getOwnPropertyDescriptor(t,i);a&&a.configurable&&void 0===e[i]&&Object.defineProperty(e,i,a)}return e}(e,t))}var i=r(15),a=r(0),o=void 0,s=r(2),u=r(1),l=r(12),c=r(30),f=r(29),d={uriRegex:c.createUriRegex(),ipRegex:f.createIpRegex(["ipv4","ipv6","ipvfuture"],"optional"),guidBrackets:{"{":"}","[":"]","(":")","":""},guidVersions:{uuidv1:"1",uuidv2:"2",uuidv3:"3",uuidv4:"4",uuidv5:"5"},cidrPresences:["required","optional","forbidden"],normalizationForms:["NFC","NFD","NFKC","NFKD"]};d.String=function(e){function _class(){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,_class);var t=function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,e.call(this));return t._type="string",t._invalids.add(""),t}return _inherits(_class,e),_class.prototype._base=function _base(e,t,r){if("string"===typeof e&&r.convert){if(this._flags.normalize&&(e=e.normalize(this._flags.normalize)),this._flags.case&&(e="upper"===this._flags.case?e.toLocaleUpperCase():e.toLocaleLowerCase()),this._flags.trim&&(e=e.trim()),this._inner.replacements)for(var n=0;n<this._inner.replacements.length;++n){var i=this._inner.replacements[n];e=e.replace(i.pattern,i.replacement)}if(this._flags.truncate)for(var a=0;a<this._tests.length;++a){var o=this._tests[a];if("max"===o.name){e=e.slice(0,o.arg);break}}this._flags.byteAligned&&e.length%2!==0&&(e="0"+e)}return{value:e,errors:"string"===typeof e?null:this.createError("string.base",{value:e},t,r)}},_class.prototype.insensitive=function insensitive(){if(this._flags.insensitive)return this;var e=this.clone();return e._flags.insensitive=!0,e},_class.prototype.creditCard=function creditCard(){return this._test("creditCard",void 0,(function(e,t,r){for(var n=e.length,i=0,a=1;n--;){var o=e.charAt(n)*a;i+=o-9*(o>9),a^=3}return i%10===0&&i>0?e:this.createError("string.creditCard",{value:e},t,r)}))},_class.prototype.regex=function regex(e,t){a.assert(e instanceof RegExp,"pattern must be a RegExp");var r={pattern:new RegExp(e.source,e.ignoreCase?"i":void 0)};"string"===typeof t?r.name=t:"object"===("undefined"===typeof t?"undefined":n(t))&&(r.invert=!!t.invert,t.name&&(r.name=t.name));var i=["string.regex",r.invert?".invert":"",r.name?".name":".base"].join("");return this._test("regex",r,(function(e,t,n){return r.pattern.test(e)^r.invert?e:this.createError(i,{name:r.name,pattern:r.pattern,value:e},t,n)}))},_class.prototype.alphanum=function alphanum(){return this._test("alphanum",void 0,(function(e,t,r){return/^[a-zA-Z0-9]+$/.test(e)?e:this.createError("string.alphanum",{value:e},t,r)}))},_class.prototype.token=function token(){return this._test("token",void 0,(function(e,t,r){return/^\w+$/.test(e)?e:this.createError("string.token",{value:e},t,r)}))},_class.prototype.email=function email(e){return e&&(a.assert("object"===("undefined"===typeof e?"undefined":n(e)),"email options must be an object"),a.assert("undefined"===typeof e.checkDNS,"checkDNS option is not supported"),a.assert("undefined"===typeof e.tldWhitelist||"object"===n(e.tldWhitelist),"tldWhitelist must be an array or object"),a.assert("undefined"===typeof e.minDomainAtoms||Number.isSafeInteger(e.minDomainAtoms)&&e.minDomainAtoms>0,"minDomainAtoms must be a positive integer"),a.assert("undefined"===typeof e.errorLevel||"boolean"===typeof e.errorLevel||Number.isSafeInteger(e.errorLevel)&&e.errorLevel>=0,"errorLevel must be a non-negative integer or boolean")),this._test("email",e,(function(t,n,i){o=o||r(19);try{var a=o.validate(t,e);if(!0===a||0===a)return t}catch(s){}return this.createError("string.email",{value:t},n,i)}))},_class.prototype.ip=function ip(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=d.ipRegex;a.assert("object"===("undefined"===typeof e?"undefined":n(e)),"options must be an object"),e.cidr?(a.assert("string"===typeof e.cidr,"cidr must be a string"),e.cidr=e.cidr.toLowerCase(),a.assert(a.contain(d.cidrPresences,e.cidr),"cidr must be one of "+d.cidrPresences.join(", ")),e.version||"optional"===e.cidr||(t=f.createIpRegex(["ipv4","ipv6","ipvfuture"],e.cidr))):e.cidr="optional";var r=void 0;if(e.version){Array.isArray(e.version)||(e.version=[e.version]),a.assert(e.version.length>=1,"version must have at least 1 version specified"),r=[];for(var i=0;i<e.version.length;++i){var o=e.version[i];a.assert("string"===typeof o,"version at position "+i+" must be a string"),o=o.toLowerCase(),a.assert(f.versions[o],"version at position "+i+" must be one of "+Object.keys(f.versions).join(", ")),r.push(o)}r=a.unique(r),t=f.createIpRegex(r,e.cidr)}return this._test("ip",e,(function(n,i,a){return t.test(n)?n:r?this.createError("string.ipVersion",{value:n,cidr:e.cidr,version:r},i,a):this.createError("string.ip",{value:n,cidr:e.cidr},i,a)}))},_class.prototype.uri=function uri(e){var t="",r=!1,i=!1,o=d.uriRegex;if(e){if(a.assert("object"===("undefined"===typeof e?"undefined":n(e)),"options must be an object"),e.scheme){a.assert(e.scheme instanceof RegExp||"string"===typeof e.scheme||Array.isArray(e.scheme),"scheme must be a RegExp, String, or Array"),Array.isArray(e.scheme)||(e.scheme=[e.scheme]),a.assert(e.scheme.length>=1,"scheme must have at least 1 scheme specified");for(var s=0;s<e.scheme.length;++s){var u=e.scheme[s];a.assert(u instanceof RegExp||"string"===typeof u,"scheme at position "+s+" must be a RegExp or String"),t+=t?"|":"",u instanceof RegExp?t+=u.source:(a.assert(/[a-zA-Z][a-zA-Z0-9+-\.]*/.test(u),"scheme at position "+s+" must be a valid scheme"),t+=a.escapeRegex(u))}}e.allowRelative&&(r=!0),e.relativeOnly&&(i=!0)}return(t||r||i)&&(o=c.createUriRegex(t,r,i)),this._test("uri",e,(function(e,r,n){return o.test(e)?e:i?this.createError("string.uriRelativeOnly",{value:e},r,n):t?this.createError("string.uriCustomScheme",{scheme:t,value:e},r,n):this.createError("string.uri",{value:e},r,n)}))},_class.prototype.isoDate=function isoDate(){return this._test("isoDate",void 0,(function(e,t,r){if(l._isIsoDate(e)){if(!r.convert)return e;var n=new Date(e);if(!isNaN(n.getTime()))return n.toISOString()}return this.createError("string.isoDate",{value:e},t,r)}))},_class.prototype.guid=function guid(e){var t="";if(e&&e.version){Array.isArray(e.version)||(e.version=[e.version]),a.assert(e.version.length>=1,"version must have at least 1 valid version specified");for(var r=new Set,n=0;n<e.version.length;++n){var i=e.version[n];a.assert("string"===typeof i,"version at position "+n+" must be a string"),i=i.toLowerCase();var o=d.guidVersions[i];a.assert(o,"version at position "+n+" must be one of "+Object.keys(d.guidVersions).join(", ")),a.assert(!r.has(o),"version at position "+n+" must not be a duplicate."),t+=o,r.add(o)}}var s=new RegExp("^([\\[{\\(]?)[0-9A-F]{8}([:-]?)[0-9A-F]{4}\\2?["+(t||"0-9A-F")+"][0-9A-F]{3}\\2?["+(t?"89AB":"0-9A-F")+"][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$","i");return this._test("guid",e,(function(e,t,r){var n=s.exec(e);return n?d.guidBrackets[n[1]]!==n[n.length-1]?this.createError("string.guid",{value:e},t,r):e:this.createError("string.guid",{value:e},t,r)}))},_class.prototype.hex=function hex(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a.assert("object"===("undefined"===typeof e?"undefined":n(e)),"hex options must be an object"),a.assert("undefined"===typeof e.byteAligned||"boolean"===typeof e.byteAligned,"byteAligned must be boolean");var t=!0===e.byteAligned,r=/^[a-f0-9]+$/i,i=this._test("hex",r,(function(e,n,i){return r.test(e)?t&&e.length%2!==0?this.createError("string.hexAlign",{value:e},n,i):e:this.createError("string.hex",{value:e},n,i)}));return t&&(i._flags.byteAligned=!0),i},_class.prototype.base64=function base64(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a.assert("object"===("undefined"===typeof e?"undefined":n(e)),"base64 options must be an object"),a.assert("undefined"===typeof e.paddingRequired||"boolean"===typeof e.paddingRequired,"paddingRequired must be boolean");var t=!1===e.paddingRequired?e.paddingRequired:e.paddingRequired||!0,r=t?/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/:/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/;return this._test("base64",r,(function(e,t,n){return r.test(e)?e:this.createError("string.base64",{value:e},t,n)}))},_class.prototype.hostname=function hostname(){var e=/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/;return this._test("hostname",void 0,(function(t,r,n){return t.length<=255&&e.test(t)||i.isIPv6(t)?t:this.createError("string.hostname",{value:t},r,n)}))},_class.prototype.normalize=function normalize(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"NFC";a.assert(a.contain(d.normalizationForms,e),"normalization form must be one of "+d.normalizationForms.join(", "));var t=this._test("normalize",e,(function(t,r,n){return n.convert||t===t.normalize(e)?t:this.createError("string.normalize",{value:t,form:e},r,n)}));return t._flags.normalize=e,t},_class.prototype.lowercase=function lowercase(){var e=this._test("lowercase",void 0,(function(e,t,r){return r.convert||e===e.toLocaleLowerCase()?e:this.createError("string.lowercase",{value:e},t,r)}));return e._flags.case="lower",e},_class.prototype.uppercase=function uppercase(){var e=this._test("uppercase",void 0,(function(e,t,r){return r.convert||e===e.toLocaleUpperCase()?e:this.createError("string.uppercase",{value:e},t,r)}));return e._flags.case="upper",e},_class.prototype.trim=function trim(){var e=this._test("trim",void 0,(function(e,t,r){return r.convert||e===e.trim()?e:this.createError("string.trim",{value:e},t,r)}));return e._flags.trim=!0,e},_class.prototype.replace=function replace(e,t){"string"===typeof e&&(e=new RegExp(a.escapeRegex(e),"g")),a.assert(e instanceof RegExp,"pattern must be a RegExp"),a.assert("string"===typeof t,"replacement must be a String");var r=this.clone();return r._inner.replacements||(r._inner.replacements=[]),r._inner.replacements.push({pattern:e,replacement:t}),r},_class.prototype.truncate=function truncate(e){var t=void 0===e||!!e;if(this._flags.truncate===t)return this;var r=this.clone();return r._flags.truncate=t,r},_class}(s),d.compare=function(e,r){return function(n,i){var o=u.isRef(n);return a.assert(Number.isSafeInteger(n)&&n>=0||o,"limit must be a positive integer or reference"),a.assert(!i||t.isEncoding(i),"Invalid encoding:",i),this._test(e,n,(function(t,a,s){var u=void 0;if(o){if(u=n(a.reference||a.parent,s),!Number.isSafeInteger(u))return this.createError("string.ref",{ref:n.key},a,s)}else u=n;return r(t,u,i)?t:this.createError("string."+e,{limit:u,value:t,encoding:i},a,s)}))}},d.String.prototype.min=d.compare("min",(function(e,r,n){return(n?t.byteLength(e,n):e.length)>=r})),d.String.prototype.max=d.compare("max",(function(e,r,n){return(n?t.byteLength(e,n):e.length)<=r})),d.String.prototype.length=d.compare("length",(function(e,r,n){return(n?t.byteLength(e,n):e.length)===r})),d.String.prototype.uuid=d.String.prototype.guid,e.exports=new d.String}).call(t,r(3).Buffer)},function(e,t,r){"use strict";var n=r(14),i={Ip:{cidrs:{ipv4:{required:"\\/(?:"+n.ipv4Cidr+")",optional:"(?:\\/(?:"+n.ipv4Cidr+"))?",forbidden:""},ipv6:{required:"\\/"+n.ipv6Cidr,optional:"(?:\\/"+n.ipv6Cidr+")?",forbidden:""},ipvfuture:{required:"\\/"+n.ipv6Cidr,optional:"(?:\\/"+n.ipv6Cidr+")?",forbidden:""}},versions:{ipv4:n.IPv4address,ipv6:n.IPv6address,ipvfuture:n.IPvFuture}}};i.Ip.createIpRegex=function(e,t){for(var r=void 0,n=0;n<e.length;++n){var a=e[n];r?r+="|"+i.Ip.versions[a]+i.Ip.cidrs[a][t]:r="^(?:"+i.Ip.versions[a]+i.Ip.cidrs[a][t]}return new RegExp(r+")$")},e.exports=i.Ip},function(e,t,r){"use strict";var n=r(14),i={Uri:{createUriRegex:function createUriRegex(e,t,r){var i=n.scheme,a=void 0;if(r)a="(?:"+n.relativeRef+")";else{e&&(i="(?:"+e+")");var o="(?:"+i+":"+n.hierPart+")";a=t?"(?:"+o+"|"+n.relativeRef+")":o}return new RegExp("^"+a+"(?:\\?"+n.query+")?(?:#"+n.fragment+")?$")}}};e.exports=i.Uri},function(e,t,r){"use strict";var n=r(0),i={};e.exports=i.Topo=function(){this._items=[],this.nodes=[]},i.Topo.prototype.add=function(e,t){var r=this,i=[].concat((t=t||{}).before||[]),a=[].concat(t.after||[]),o=t.group||"?",s=t.sort||0;n.assert(-1===i.indexOf(o),"Item cannot come before itself:",o),n.assert(-1===i.indexOf("?"),"Item cannot come before unassociated items"),n.assert(-1===a.indexOf(o),"Item cannot come after itself:",o),n.assert(-1===a.indexOf("?"),"Item cannot come after unassociated items"),[].concat(e).forEach((function(e,t){var n={seq:r._items.length,sort:s,before:i,after:a,group:o,node:e};r._items.push(n)}));var u=this._sort();return n.assert(!u,"item","?"!==o?"added into group "+o:"","created a dependencies error"),this.nodes},i.Topo.prototype.merge=function(e){e=[].concat(e);for(var t=0;t<e.length;++t){var r=e[t];if(r)for(var a=0;a<r._items.length;++a){var o=n.shallow(r._items[a]);this._items.push(o)}}this._items.sort(i.mergeSort);for(var s=0;s<this._items.length;++s)this._items[s].seq=s;var u=this._sort();return n.assert(!u,"merge created a dependencies error"),this.nodes},i.mergeSort=function(e,t){return e.sort===t.sort?0:e.sort<t.sort?-1:1},i.Topo.prototype._sort=function(){for(var e={},t=Object.create(null),r=Object.create(null),n=0;n<this._items.length;++n){var i=this._items[n],a=i.seq,o=i.group;r[o]=r[o]||[],r[o].push(a),e[a]=i.before;for(var s=i.after,u=0;u<s.length;++u)t[s[u]]=(t[s[u]]||[]).concat(a)}for(var l=Object.keys(e),c=0;c<l.length;++c){for(var f=l[c],d=[],h=Object.keys(e[f]),p=0;p<h.length;++p){var g=e[f][h[p]];r[g]=r[g]||[];for(var m=0;m<r[g].length;++m)d.push(r[g][m])}e[f]=d}for(var v=Object.keys(t),y=0;y<v.length;++y){var _=v[y];if(r[_])for(var b=0;b<r[_].length;++b){var x=r[_][b];e[x]=e[x].concat(t[_])}}var w=void 0,k={};l=Object.keys(e);for(var S=0;S<l.length;++S){var E=l[S];w=e[E];for(var C=0;C<w.length;++C)k[w[C]]=(k[w[C]]||[]).concat(E)}for(var T={},O=[],A=0;A<this._items.length;++A){var R=A;if(k[A]){R=null;for(var D=0;D<this._items.length;++D)if(!0!==T[D]){k[D]||(k[D]=[]);for(var P=k[D].length,j=0,M=0;M<P;++M)T[k[D][M]]&&++j;if(j===P){R=D;break}}}null!==R&&(T[R]=!0,O.push(R))}if(O.length!==this._items.length)return new Error("Invalid dependencies");for(var F={},I=0;I<this._items.length;++I){var L=this._items[I];F[L.seq]=L}var N=[];this._items=O.map((function(e){var t=F[e];return N.push(t.node),t})),this.nodes=N}},function(e,t,r){"use strict";var n=r(8);e.exports=n},function(e,t,r){"use strict";t.byteLength=function byteLength(e){return 3*e.length/4-placeHoldersCount(e)},t.toByteArray=function toByteArray(e){var t,r,n,o,s,u=e.length;o=placeHoldersCount(e),s=new a(3*u/4-o),r=o>0?u-4:u;var l=0;for(t=0;t<r;t+=4)n=i[e.charCodeAt(t)]<<18|i[e.charCodeAt(t+1)]<<12|i[e.charCodeAt(t+2)]<<6|i[e.charCodeAt(t+3)],s[l++]=n>>16&255,s[l++]=n>>8&255,s[l++]=255&n;2===o?(n=i[e.charCodeAt(t)]<<2|i[e.charCodeAt(t+1)]>>4,s[l++]=255&n):1===o&&(n=i[e.charCodeAt(t)]<<10|i[e.charCodeAt(t+1)]<<4|i[e.charCodeAt(t+2)]>>2,s[l++]=n>>8&255,s[l++]=255&n);return s},t.fromByteArray=function fromByteArray(e){for(var t,r=e.length,i=r%3,a="",o=[],s=0,u=r-i;s<u;s+=16383)o.push(encodeChunk(e,s,s+16383>u?u:s+16383));1===i?(t=e[r-1],a+=n[t>>2],a+=n[t<<4&63],a+="=="):2===i&&(t=(e[r-2]<<8)+e[r-1],a+=n[t>>10],a+=n[t>>4&63],a+=n[t<<2&63],a+="=");return o.push(a),o.join("")};for(var n=[],i=[],a="undefined"!==typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=o.length;s<u;++s)n[s]=o[s],i[o.charCodeAt(s)]=s;function placeHoldersCount(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function encodeChunk(e,t,r){for(var i,a,o=[],s=t;s<r;s+=3)i=(e[s]<<16)+(e[s+1]<<8)+e[s+2],o.push(n[(a=i)>>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,r,n,i){var a,o,s=8*i-n-1,u=(1<<s)-1,l=u>>1,c=-7,f=r?i-1:0,d=r?-1:1,h=e[t+f];for(f+=d,a=h&(1<<-c)-1,h>>=-c,c+=s;c>0;a=256*a+e[t+f],f+=d,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+e[t+f],f+=d,c-=8);if(0===a)a=1-l;else{if(a===u)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,n),a-=l}return(h?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,u,l=8*a-i-1,c=(1<<l)-1,f=c>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:a-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(o++,u/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(t*u-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[r+h]=255&s,h+=p,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[r+h]=255&o,h+=p,o/=256,l-=8);e[r+h-p]|=128*g}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t){e.exports={_args:[["joi@13.4.0","/Users/jeff/projects/joi-browser"]],_development:!0,_from:"joi@13.4.0",_id:"joi@13.4.0",_inBundle:!1,_integrity:"sha512-JuK4GjEu6j7zr9FuVe2MAseZ6si/8/HaY0qMAejfDFHp7jcH4OKE937mIHM5VT4xDS0q7lpQbszbxKV9rm0yUg==",_location:"/joi",_phantomChildren:{},_requested:{type:"version",registry:!0,raw:"joi@13.4.0",name:"joi",escapedName:"joi",rawSpec:"13.4.0",saveSpec:null,fetchSpec:"13.4.0"},_requiredBy:["#DEV:/"],_resolved:"https://registry.npmjs.org/joi/-/joi-13.4.0.tgz",_spec:"13.4.0",_where:"/Users/jeff/projects/joi-browser",bugs:{url:"https://github.com/hapijs/joi/issues"},dependencies:{hoek:"5.x.x",isemail:"3.x.x",topo:"3.x.x"},description:"Object schema validation",devDependencies:{code:"5.x.x",hapitoc:"1.x.x",lab:"15.x.x"},engines:{node:">=8.9.0"},homepage:"https://github.com/hapijs/joi",keywords:["hapi","schema","validation"],license:"BSD-3-Clause",main:"lib/index.js",name:"joi",repository:{type:"git",url:"git://github.com/hapijs/joi.git"},scripts:{test:"lab -t 100 -a code -L","test-cov-html":"lab -r html -o coverage.html -a code","test-debug":"lab -a code",toc:"hapitoc",version:"npm run toc && git add API.md README.md"},version:"13.4.0"}},function(e,t,r){(function(e){function normalizeArray(e,t){for(var r=0,n=e.length-1;n>=0;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,n=function splitPath(e){return r.exec(e).slice(1)};function filter(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n<e.length;n++)t(e[n],n,e)&&r.push(e[n]);return r}t.resolve=function(){for(var t="",r=!1,n=arguments.length-1;n>=-1&&!r;n--){var i=n>=0?arguments[n]:e.cwd();if("string"!==typeof i)throw new TypeError("Arguments to path.resolve must be strings");i&&(t=i+"/"+t,r="/"===i.charAt(0))}return(r?"/":"")+(t=normalizeArray(filter(t.split("/"),(function(e){return!!e})),!r).join("/"))||"."},t.normalize=function(e){var r=t.isAbsolute(e),n="/"===i(e,-1);return(e=normalizeArray(filter(e.split("/"),(function(e){return!!e})),!r).join("/"))||r||(e="."),e&&n&&(e+="/"),(r?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(filter(e,(function(e,t){if("string"!==typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},t.relative=function(e,r){function trim(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=t.resolve(e).substr(1),r=t.resolve(r).substr(1);for(var n=trim(e.split("/")),i=trim(r.split("/")),a=Math.min(n.length,i.length),o=a,s=0;s<a;s++)if(n[s]!==i[s]){o=s;break}var u=[];for(s=o;s<n.length;s++)u.push("..");return(u=u.concat(i.slice(o))).join("/")},t.sep="/",t.delimiter=":",t.dirname=function(e){var t=n(e),r=t[0],i=t[1];return r||i?(i&&(i=i.substr(0,i.length-1)),r+i):"."},t.basename=function(e,t){var r=n(e)[2];return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},t.extname=function(e){return n(e)[3]};var i="b"==="ab".substr(-1)?function(e,t,r){return e.substr(t,r)}:function(e,t,r){return t<0&&(t=e.length+t),e.substr(t,r)}}).call(t,r(7))},function(e,t,r){(function(e,n){var i;!function(a){"object"==typeof t&&t&&t.nodeType,"object"==typeof e&&e&&e.nodeType;var o="object"==typeof n&&n;o.global!==o&&o.window!==o&&o.self;var s,u=2147483647,l=36,c=1,f=26,d=38,h=700,p=72,g=128,m="-",v=/^xn--/,y=/[^\x20-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=l-c,w=Math.floor,k=String.fromCharCode;function error(e){throw new RangeError(b[e])}function map(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function mapDomain(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+map((e=e.replace(_,".")).split("."),t).join(".")}function ucs2decode(e){for(var t,r,n=[],i=0,a=e.length;i<a;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<a?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function ucs2encode(e){return map(e,(function(e){var t="";return e>65535&&(t+=k((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=k(e)})).join("")}function digitToBasic(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function adapt(e,t,r){var n=0;for(e=r?w(e/h):e>>1,e+=w(e/t);e>x*f>>1;n+=l)e=w(e/x);return w(n+(x+1)*e/(e+d))}function decode(e){var t,r,n,i,a,o,s,d,h,v,y,_=[],b=e.length,x=0,k=g,S=p;for((r=e.lastIndexOf(m))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&error("not-basic"),_.push(e.charCodeAt(n));for(i=r>0?r+1:0;i<b;){for(a=x,o=1,s=l;i>=b&&error("invalid-input"),((d=(y=e.charCodeAt(i++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:l)>=l||d>w((u-x)/o))&&error("overflow"),x+=d*o,!(d<(h=s<=S?c:s>=S+f?f:s-S));s+=l)o>w(u/(v=l-h))&&error("overflow"),o*=v;S=adapt(x-a,t=_.length+1,0==a),w(x/t)>u-k&&error("overflow"),k+=w(x/t),x%=t,_.splice(x++,0,k)}return ucs2encode(_)}function encode(e){var t,r,n,i,a,o,s,d,h,v,y,_,b,x,S,E=[];for(_=(e=ucs2decode(e)).length,t=g,r=0,a=p,o=0;o<_;++o)(y=e[o])<128&&E.push(k(y));for(n=i=E.length,i&&E.push(m);n<_;){for(s=u,o=0;o<_;++o)(y=e[o])>=t&&y<s&&(s=y);for(s-t>w((u-r)/(b=n+1))&&error("overflow"),r+=(s-t)*b,t=s,o=0;o<_;++o)if((y=e[o])<t&&++r>u&&error("overflow"),y==t){for(d=r,h=l;!(d<(v=h<=a?c:h>=a+f?f:h-a));h+=l)S=d-v,x=l-v,E.push(k(digitToBasic(v+S%x,0))),d=w(S/x);E.push(k(digitToBasic(d,0))),a=adapt(r,b,n==i),r=0,++n}++r,++t}return E.join("")}s={version:"1.4.1",ucs2:{decode:ucs2decode,encode:ucs2encode},decode:decode,encode:encode,toASCII:function toASCII(e){return mapDomain(e,(function(e){return y.test(e)?"xn--"+encode(e):e}))},toUnicode:function toUnicode(e){return mapDomain(e,(function(e){return v.test(e)?decode(e.slice(4).toLowerCase()):e}))}},void 0===(i=function(){return s}.call(t,r,t,e))||(e.exports=i)}()}).call(t,r(41)(e),r(5))},function(e,t){"function"===typeof Object.create?e.exports=function inherits(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function inherits(e,t){e.super_=t;var r=function TempCtor(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t){e.exports=function isBuffer(e){return e&&"object"===typeof e&&"function"===typeof e.copy&&"function"===typeof e.fill&&"function"===typeof e.readUInt8}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function get(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function get(){return e.i}}),e.webpackPolyfill=1),e}}])}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.post=t.configure=void 0;var n=_interopRequireDefault(r(67)),i=_interopRequireDefault(r(26)),a=_interopRequireDefault(r(27)),o=t.configure=function(){var e=(0,a.default)(i.default.mark((function _callee(e){var t;return i.default.wrap((function _callee$(r){for(;;)switch(r.prev=r.next){case 0:t={baseUrl:c.ATHENA_URL_ROOT,jwt:!1,parse:null},e&&(t.token="JWT "+e),d.configure(t);case 3:case"end":return r.stop()}}),_callee,this)})));return function configure(t){return e.apply(this,arguments)}}(),s=t.post=function(){var e=(0,a.default)(i.default.mark((function _callee2(e,t){return i.default.wrap((function _callee2$(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,ensureInit();case 2:return r.abrupt("return",new n.default((function(r,n){d.post(e,{body:t,json:!0},(0,l.default)(r,n))})));case 3:case"end":return r.stop()}}),_callee2,this)})));return function post(t,r){return e.apply(this,arguments)}}();t.postJsonRpcPayload=function postJsonRpcPayload(e,t){return s(e,t)};var u=_interopRequireDefault(r(114)),l=_interopRequireDefault(r(76)),c=r(118);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var f,d=(0,u.default)();function ensureInit(){return f||(f=o()),f}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.refreshAccessToken=void 0;var n=_interopRequireDefault(r(26)),i=_interopRequireDefault(r(27)),a=(t.refreshAccessToken=function(){var e=(0,i.default)(n.default.mark((function _callee(e,t){var r,i;return n.default.wrap((function _callee$(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,a.postForm("v2/auth/",{code:e,redirect_uri:t});case 2:if(r=n.sent,null==(i=JSON.parse(r)).access_token){n.next=10;break}return n.next=7,a.configure(i.access_token);case 7:return n.abrupt("return",i.access_token);case 10:if(void 0===i.response){n.next=14;break}throw new Error("Could not exchange oauth code for access token: response "+i.response.status);case 14:throw new Error("Could not exchange oauth code for access token: response "+r);case 15:case"end":return n.stop()}}),_callee,this)})));return function refreshAccessToken(t,r){return e.apply(this,arguments)}}(),function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(36)));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fetchLocation=void 0;var n=_interopRequireDefault(r(26)),i=_interopRequireDefault(r(343)),a=_interopRequireDefault(r(27));t.fetchLocation=function(){var e=(0,a.default)(n.default.mark((function _callee(e){var t,r;return n.default.wrap((function _callee$(n){for(;;)switch(n.prev=n.next){case 0:return t="v1/devices/"+e+"/location",n.next=3,o.get(t);case 3:if(void 0===(r=n.sent)||void 0!==r.error){n.next=8;break}return n.abrupt("return",r);case 8:throw Error("Could not fetch device location: "+(0,i.default)(r));case 9:case"end":return n.stop()}}),_callee,this)})));return function fetchLocation(t){return e.apply(this,arguments)}}();t.listDevices=function listDevices(){return o.get("v1/me/devices/")},t.setDeviceAlias=function setDeviceAlias(e,t){return o.patch("v1/devices/"+e+"/",{alias:t})},t.setDeviceVehicleId=function setDeviceVehicleId(e,t){return o.patch("v1/devices/"+e+"/",{vehicle_id:t})},t.grantDeviceReadPermission=function grantDeviceReadPermission(e,t){return o.post("v1/devices/"+e+"/add_user",{email:t})},t.removeDeviceReadPermission=function removeDeviceReadPermission(e,t){return o.post("v1/devices/"+e+"/del_user",{email:t})},t.fetchVehicles=function fetchVehicles(e){var t="v1/vehicles/"+e;return o.get(t)},t.fetchDevice=function fetchDevice(e){var t="v1.1/devices/"+e+"/";return o.get(t)},t.pilotPair=function pilotPair(e,t,r){return o.postForm("v2/pilotpair/",{imei:e,serial:t,pair_token:r})},t.fetchDeviceStats=function fetchDeviceStats(e){return o.get("v1.1/devices/"+e+"/stats")},t.unpair=function unpair(e){return o.post("v1/devices/"+e+"/unpair")},t.fetchDeviceOwner=function fetchDeviceOwner(e){return o.get("v1/devices/"+e+"/owner")};var o=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(36));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}},function(e,t,r){e.exports={default:r(344),__esModule:!0}},function(e,t,r){var n=r(20),i=n.JSON||(n.JSON={stringify:JSON.stringify});e.exports=function stringify(e){return i.stringify.apply(i,arguments)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=_interopRequireDefault(r(26)),i=_interopRequireDefault(r(27));t.default=function routeApi(e){var t=(0,o.default)(),r=e+"/";return t.configure({baseUrl:r,parse:null}),{getCoords:function(){var e=(0,i.default)(n.default.mark((function _callee(){var e;return n.default.wrap((function _callee$(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.get("route.coords");case 2:return e=r.sent,r.abrupt("return",JSON.parse(e));case 4:case"end":return r.stop()}}),_callee,this)})));return function getCoords(){return e.apply(this,arguments)}}(),getJpegUrl:function getJpegUrl(e){return(0,a.default)(r,"sec"+e.toString()+".jpg")}}};var a=_interopRequireDefault(r(117)),o=_interopRequireDefault(r(163));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fetchRoutes=void 0;var n=_interopRequireDefault(r(347)),i=_interopRequireDefault(r(162)),a=_interopRequireDefault(r(26)),o=_interopRequireDefault(r(27));t.fetchRoutes=function(){var e=(0,o.default)(a.default.mark((function _callee(e,t,r){var n;return a.default.wrap((function _callee$(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,getSegmentMetadata(t,r,e);case 2:return n=i.sent,n=parseSegmentMetadata(t,r,n),i.abrupt("return",segmentsFromMetadata(n).reverse());case 5:case"end":return i.stop()}}),_callee,this)})));return function fetchRoutes(t,r,n){return e.apply(this,arguments)}}();t.getSegmentMetadata=getSegmentMetadata,t.getRouteInfo=function getRouteInfo(e){return s.get("v1/route/"+e+"/")},t.getShareSignature=function getShareSignature(e){return s.get("v1/route/"+e+"/share_signature")},t.getRouteSegments=function getRouteSegments(e){return s.get("v1/route/"+e+"/segments")},t.listRoutes=function listRoutes(e,t,r){var n={limit:t};"undefined"!==typeof r&&(n.createdAfter=r);return s.get("v1/devices/"+e+"/routes",n)};var s=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(36));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var u=6e4;function getSegmentMetadata(e,t,r){return s.get("v1/devices/"+r+"/segments",{from:e,to:t})}function parseSegmentMetadata(e,t,r){var n={};return r.map((function(t){if(t.offset=Math.round(t.start_time_utc_millis)-e,n[t.canonical_route_name])t.routeOffset=n[t.canonical_route_name];else{var r=Number(t.canonical_name.split("--")[2]);t.segment=r,n[t.canonical_route_name]=r>0?t.offset-u*r:t.offset,t.routeOffset=n[t.canonical_route_name]}return t.offset,t.duration=Math.round(t.end_time_utc_millis-t.start_time_utc_millis),t}))}function segmentsFromMetadata(e){var t=null,r=null,a=[];return e.forEach((function(e){if(e.url&&(40===e.proc_log||40===e.proc_qlog)){var n=e.proc_dcamera>=0,o=40===e.proc_dcamera,s=40===e.proc_camera;if(s&&null===r&&(r=e.offset),e.start_time_utc_millis,!t||t.route!==e.canonical_route_name){t&&finishSegment(t);var l=e.url,c=l.split("/");(0,i.default)(Number(c.pop()))&&(l=c.join("/")),t={dongleId:e.dongle_id,offset:e.offset-e.segment*u,route:e.canonical_route_name,startTime:e.start_time_utc_millis,startCoord:[e.start_lng,e.start_lat],duration:0,segments:0,url:l.replace("chffrprivate.blob.core.windows.net","chffrprivate-vzn.azureedge.net"),events:[],videoAvailableBetweenOffsets:[],hasVideo:s,deviceType:e.devicetype,hpgps:e.hpgps,hasDriverCamera:n,hasDriverCameraStream:o,locStart:"",locEnd:"",distanceMiles:0,cameraStreamSegCount:0,driverCameraStreamSegCount:0},a.push(t)}s||null===r||(t.videoAvailableBetweenOffsets.push([r,e.offset]),r=null),t.hasVideo=t.hasVideo||s,t.hasDriverCamera=t.hasDriverCamera||n,t.hasDriverCameraStream=t.hasDriverCameraStream||o,t.hpgps=t.hpgps||e.hpgps,t.duration=e.offset-t.offset+e.duration,t.segments=Math.max(t.segments,Number(e.canonical_name.split("--").pop())+1),t.events=t.events.concat(e.events),t.endCoord=[e.end_lng,e.end_lat],t.distanceMiles+=e.length,t.cameraStreamSegCount+=Math.floor(s),t.driverCameraStreamSegCount+=Math.floor(o)}})),t&&finishSegment(t),a;function finishSegment(e){if(e.hasVideo){var t=e.videoAvailableBetweenOffsets[e.videoAvailableBetweenOffsets.length-1]||[e.offset,e.offset+e.duration];e.videoAvailableBetweenOffsets=[].concat((0,n.default)(e.videoAvailableBetweenOffsets.slice(0,e.videoAvailableBetweenOffsets.length-1)),[[t[0],e.offset+e.duration]])}}}},function(e,t,r){"use strict";t.__esModule=!0;var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(348));t.default=function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return(0,n.default)(e)}},function(e,t,r){e.exports={default:r(349),__esModule:!0}},function(e,t,r){r(54),r(350),e.exports=r(20).Array.from},function(e,t,r){"use strict";var n=r(47),i=r(29),a=r(109),o=r(146),s=r(147),u=r(105),l=r(351),c=r(111);i(i.S+i.F*!r(152)((function(e){Array.from(e)})),"Array",{from:function from(e){var t,r,i,f,d=a(e),h="function"==typeof this?this:Array,p=arguments.length,g=p>1?arguments[1]:void 0,m=void 0!==g,v=0,y=c(d);if(m&&(g=n(g,p>2?arguments[2]:void 0,2)),void 0==y||h==Array&&s(y))for(r=new h(t=u(d.length));t>v;v++)l(r,v,m?g(d[v],v):d[v]);else for(f=y.call(d),r=new h;!(i=f.next()).done;v++)l(r,v,m?o(f,g,[i.value,v],!0):i.value);return r.length=v,r}})},function(e,t,r){"use strict";var n=r(35),i=r(56);e.exports=function(e,t,r){t in e?n.f(e,t,i(0,r)):e[t]=r}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLeaderboard=function getLeaderboard(){return n.get("v2/leaderboard/")};var n=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(36))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=_interopRequireDefault(r(26)),i=_interopRequireDefault(r(27)),a=function(){var e=(0,i.default)(n.default.mark((function _callee(e,t,r){var i,a;return n.default.wrap((function _callee$(n){for(;;)switch(n.prev=n.next){case 0:if(!u[t]){n.next=2;break}return n.abrupt("return",u[t]);case 2:return i="v1/route/"+t+"/"+e,void 0!==r&&(i+="?"+o.default.stringify(r)),n.next=6,s.get(i);case 6:return a=n.sent,u[t]=a,setTimeout((function(){delete u[t]}),27e5),n.abrupt("return",u[t]);case 10:case"end":return n.stop()}}),_callee,this)})));return function getCached(t,r,n){return e.apply(this,arguments)}}();t.getRouteFiles=function getRouteFiles(e){return a("files",e)},t.getLogUrls=function getLogUrls(e,t){return a("log_urls",e,t)};var o=_interopRequireDefault(r(113)),s=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(36));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var u={}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fetchMakes=function fetchMakes(){return n.get("v1/vehicles/makes/")},t.fetchModels=function fetchModels(e){return n.get("v1/vehicles/makes/"+e)},t.fetchVehicle=function fetchVehicle(e){return n.get("v1/vehicles/"+e.toString())};var n=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(36))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=_interopRequireDefault(r(164));t.default=function videoApi(e,t){t||(t=o.VIDEO_HOST);var r=e.split("/").slice(5,7),s=(0,n.default)(r,2),u=s[0],l=s[1],c=(0,a.default)(),f=t+"/hls/"+u+"/"+l+"/";c.configure({baseUrl:f,parse:null});var d=(0,a.default)();return d.configure({baseUrl:e+"/",parse:null}),{getRearCameraStreamIndexUrl:function getRearCameraStreamIndexUrl(){return(0,i.default)(f,"index.m3u8")},getFrontCameraStreamIndexUrl:function getFrontCameraStreamIndexUrl(){return(0,i.default)(f,"dcamera/index.m3u8")},getQcameraStreamIndexUrl:function getQcameraStreamIndexUrl(){return(0,i.default)(e,"qcamera.m3u8?t="+Date.now())},getRearCameraStreamIndex:function getRearCameraStreamIndex(){return c.get("index.m3u8")},getFrontCameraStreamIndexPath:function getFrontCameraStreamIndexPath(){return c.get("dcamera/index.m3u8")},getQcameraStreamIndex:function getQcameraStreamIndex(e){return d.get("qcamera.m3u8?t="+Date.now())}}};var i=_interopRequireDefault(r(117)),a=_interopRequireDefault(r(163)),o=r(118);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}},function(e,t,r){e.exports={default:r(357),__esModule:!0}},function(e,t,r){r(72),r(54),e.exports=r(358)},function(e,t,r){var n=r(110),i=r(23)("iterator"),a=r(48);e.exports=r(20).isIterable=function(e){var t=Object(e);return void 0!==t[i]||"@@iterator"in t||a.hasOwnProperty(n(t))}},function(e,t,r){e.exports={default:r(360),__esModule:!0}},function(e,t,r){r(72),r(54),e.exports=r(361)},function(e,t,r){var n=r(30),i=r(111);e.exports=r(20).getIterator=function(e){var t=i(e);if("function"!=typeof t)throw TypeError(e+" is not iterable!");return n(t.call(e))}},function(e,t,r){(function(t){var n=r(363),i=r(165),a=r(364),o=r(365),s=r(119),u=s.isErrorEvent,l=s.isDOMError,c=s.isDOMException,f=s.isError,d=s.isObject,h=s.isPlainObject,p=s.isUndefined,g=s.isFunction,m=s.isString,v=s.isArray,y=s.isEmptyObject,_=s.each,b=s.objectMerge,x=s.truncate,w=s.objectFrozen,k=s.hasKey,S=s.joinRegExp,E=s.urlencode,C=s.uuid4,T=s.htmlTreeAsString,O=s.isSameException,A=s.isSameStacktrace,R=s.parseUrl,D=s.fill,P=s.supportsFetch,j=s.supportsReferrerPolicy,M=s.serializeKeysForMessage,F=s.serializeException,I=s.sanitize,L=r(366).wrapMethod,N="source protocol user pass host port path".split(" "),B=/^(?:(\w+):)?\/\/(?:(\w+)(:\w+)?@)?([\w\.-]+)(?::(\d+))?(\/.*)/;function now(){return+new Date}var U="undefined"!==typeof window?window:"undefined"!==typeof t?t:"undefined"!==typeof self?self:{},z=U.document,q=U.navigator;function keepOriginalCallback(e,t){return g(t)?function(r){return t(r,e)}:t}function Raven(){for(var e in this._hasJSON=!("object"!==typeof JSON||!JSON.stringify),this._hasDocument=!p(z),this._hasNavigator=!p(q),this._lastCapturedException=null,this._lastData=null,this._lastEventId=null,this._globalServer=null,this._globalKey=null,this._globalProject=null,this._globalContext={},this._globalOptions={release:U.SENTRY_RELEASE&&U.SENTRY_RELEASE.id,logger:"javascript",ignoreErrors:[],ignoreUrls:[],whitelistUrls:[],includePaths:[],headers:null,collectWindowErrors:!0,captureUnhandledRejections:!0,maxMessageLength:0,maxUrlLength:250,stackTraceLimit:50,autoBreadcrumbs:!0,instrument:!0,sampleRate:1,sanitizeKeys:[]},this._fetchDefaults={method:"POST",referrerPolicy:j()?"origin":""},this._ignoreOnError=0,this._isRavenInstalled=!1,this._originalErrorStackTraceLimit=Error.stackTraceLimit,this._originalConsole=U.console||{},this._originalConsoleMethods={},this._plugins=[],this._startTime=now(),this._wrappedBuiltIns=[],this._breadcrumbs=[],this._lastCapturedEvent=null,this._keypressTimeout,this._location=U.location,this._lastHref=this._location&&this._location.href,this._resetBackoff(),this._originalConsole)this._originalConsoleMethods[e]=this._originalConsole[e]}Raven.prototype={VERSION:"3.27.2",debug:!1,TraceKit:n,config:function config(e,t){var r=this;if(r._globalServer)return this._logDebug("error","Error: Raven has already been configured"),r;if(!e)return r;var i=r._globalOptions;t&&_(t,(function(e,t){"tags"===e||"extra"===e||"user"===e?r._globalContext[e]=t:i[e]=t})),r.setDSN(e),i.ignoreErrors.push(/^Script error\.?$/),i.ignoreErrors.push(/^Javascript error: Script error\.? on line 0$/),i.ignoreErrors=S(i.ignoreErrors),i.ignoreUrls=!!i.ignoreUrls.length&&S(i.ignoreUrls),i.whitelistUrls=!!i.whitelistUrls.length&&S(i.whitelistUrls),i.includePaths=S(i.includePaths),i.maxBreadcrumbs=Math.max(0,Math.min(i.maxBreadcrumbs||100,100));var a={xhr:!0,console:!0,dom:!0,location:!0,sentry:!0},o=i.autoBreadcrumbs;"[object Object]"==={}.toString.call(o)?o=b(a,o):!1!==o&&(o=a),i.autoBreadcrumbs=o;var s={tryCatch:!0},u=i.instrument;return"[object Object]"==={}.toString.call(u)?u=b(s,u):!1!==u&&(u=s),i.instrument=u,n.collectWindowErrors=!!i.collectWindowErrors,r},install:function install(){var e=this;return e.isSetup()&&!e._isRavenInstalled&&(n.report.subscribe((function(){e._handleOnErrorStackInfo.apply(e,arguments)})),e._globalOptions.captureUnhandledRejections&&e._attachPromiseRejectionHandler(),e._patchFunctionToString(),e._globalOptions.instrument&&e._globalOptions.instrument.tryCatch&&e._instrumentTryCatch(),e._globalOptions.autoBreadcrumbs&&e._instrumentBreadcrumbs(),e._drainPlugins(),e._isRavenInstalled=!0),Error.stackTraceLimit=e._globalOptions.stackTraceLimit,this},setDSN:function setDSN(e){var t=this._parseDSN(e),r=t.path.lastIndexOf("/"),n=t.path.substr(1,r);this._dsn=e,this._globalKey=t.user,this._globalSecret=t.pass&&t.pass.substr(1),this._globalProject=t.path.substr(r+1),this._globalServer=this._getGlobalServer(t),this._globalEndpoint=this._globalServer+"/"+n+"api/"+this._globalProject+"/store/",this._resetBackoff()},context:function context(e,t,r){return g(e)&&(r=t||[],t=e,e={}),this.wrap(e,t).apply(this,r)},wrap:function wrap(e,t,r){var n=this;if(p(t)&&!g(e))return e;if(g(e)&&(t=e,e=void 0),!g(t))return t;try{if(t.__raven__)return t;if(t.__raven_wrapper__)return t.__raven_wrapper__}catch(a){return t}function wrapped(){var i=[],o=arguments.length,s=!e||e&&!1!==e.deep;for(r&&g(r)&&r.apply(this,arguments);o--;)i[o]=s?n.wrap(e,arguments[o]):arguments[o];try{return t.apply(this,i)}catch(a){throw n._ignoreNextOnError(),n.captureException(a,e),a}}for(var i in t)k(t,i)&&(wrapped[i]=t[i]);return wrapped.prototype=t.prototype,t.__raven_wrapper__=wrapped,wrapped.__raven__=!0,wrapped.__orig__=t,wrapped},uninstall:function uninstall(){return n.report.uninstall(),this._detachPromiseRejectionHandler(),this._unpatchFunctionToString(),this._restoreBuiltIns(),this._restoreConsole(),Error.stackTraceLimit=this._originalErrorStackTraceLimit,this._isRavenInstalled=!1,this},_promiseRejectionHandler:function _promiseRejectionHandler(e){this._logDebug("debug","Raven caught unhandled promise rejection:",e),this.captureException(e.reason,{mechanism:{type:"onunhandledrejection",handled:!1}})},_attachPromiseRejectionHandler:function _attachPromiseRejectionHandler(){return this._promiseRejectionHandler=this._promiseRejectionHandler.bind(this),U.addEventListener&&U.addEventListener("unhandledrejection",this._promiseRejectionHandler),this},_detachPromiseRejectionHandler:function _detachPromiseRejectionHandler(){return U.removeEventListener&&U.removeEventListener("unhandledrejection",this._promiseRejectionHandler),this},captureException:function captureException(e,t){if(t=b({trimHeadFrames:0},t||{}),u(e)&&e.error)e=e.error;else{if(l(e)||c(e)){var r=e.name||(l(e)?"DOMError":"DOMException"),i=e.message?r+": "+e.message:r;return this.captureMessage(i,b(t,{stacktrace:!0,trimHeadFrames:t.trimHeadFrames+1}))}if(f(e))e=e;else{if(!h(e))return this.captureMessage(e,b(t,{stacktrace:!0,trimHeadFrames:t.trimHeadFrames+1}));t=this._getCaptureExceptionOptionsFromPlainObject(t,e),e=new Error(t.message)}}this._lastCapturedException=e;try{var a=n.computeStackTrace(e);this._handleStackInfo(a,t)}catch(o){if(e!==o)throw o}return this},_getCaptureExceptionOptionsFromPlainObject:function _getCaptureExceptionOptionsFromPlainObject(e,t){var r=Object.keys(t).sort(),n=b(e,{message:"Non-Error exception captured with keys: "+M(r),fingerprint:[a(r)],extra:e.extra||{}});return n.extra.__serialized__=F(t),n},captureMessage:function captureMessage(e,t){if(!this._globalOptions.ignoreErrors.test||!this._globalOptions.ignoreErrors.test(e)){var r,i=b({message:e+=""},t=t||{});try{throw new Error(e)}catch(l){r=l}r.name=null;var a=n.computeStackTrace(r),o=v(a.stack)&&a.stack[1];o&&"Raven.captureException"===o.func&&(o=a.stack[2]);var s=o&&o.url||"";if((!this._globalOptions.ignoreUrls.test||!this._globalOptions.ignoreUrls.test(s))&&(!this._globalOptions.whitelistUrls.test||this._globalOptions.whitelistUrls.test(s))){if(this._globalOptions.stacktrace||t.stacktrace||""===i.message){i.fingerprint=null==i.fingerprint?e:i.fingerprint,(t=b({trimHeadFrames:0},t)).trimHeadFrames+=1;var u=this._prepareFrames(a,t);i.stacktrace={frames:u.reverse()}}return i.fingerprint&&(i.fingerprint=v(i.fingerprint)?i.fingerprint:[i.fingerprint]),this._send(i),this}}},captureBreadcrumb:function captureBreadcrumb(e){var t=b({timestamp:now()/1e3},e);if(g(this._globalOptions.breadcrumbCallback)){var r=this._globalOptions.breadcrumbCallback(t);if(d(r)&&!y(r))t=r;else if(!1===r)return this}return this._breadcrumbs.push(t),this._breadcrumbs.length>this._globalOptions.maxBreadcrumbs&&this._breadcrumbs.shift(),this},addPlugin:function addPlugin(e){var t=[].slice.call(arguments,1);return this._plugins.push([e,t]),this._isRavenInstalled&&this._drainPlugins(),this},setUserContext:function setUserContext(e){return this._globalContext.user=e,this},setExtraContext:function setExtraContext(e){return this._mergeContext("extra",e),this},setTagsContext:function setTagsContext(e){return this._mergeContext("tags",e),this},clearContext:function clearContext(){return this._globalContext={},this},getContext:function getContext(){return JSON.parse(i(this._globalContext))},setEnvironment:function setEnvironment(e){return this._globalOptions.environment=e,this},setRelease:function setRelease(e){return this._globalOptions.release=e,this},setDataCallback:function setDataCallback(e){var t=this._globalOptions.dataCallback;return this._globalOptions.dataCallback=keepOriginalCallback(t,e),this},setBreadcrumbCallback:function setBreadcrumbCallback(e){var t=this._globalOptions.breadcrumbCallback;return this._globalOptions.breadcrumbCallback=keepOriginalCallback(t,e),this},setShouldSendCallback:function setShouldSendCallback(e){var t=this._globalOptions.shouldSendCallback;return this._globalOptions.shouldSendCallback=keepOriginalCallback(t,e),this},setTransport:function setTransport(e){return this._globalOptions.transport=e,this},lastException:function lastException(){return this._lastCapturedException},lastEventId:function lastEventId(){return this._lastEventId},isSetup:function isSetup(){return!!this._hasJSON&&(!!this._globalServer||(this.ravenNotConfiguredError||(this.ravenNotConfiguredError=!0,this._logDebug("error","Error: Raven has not been configured.")),!1))},afterLoad:function afterLoad(){var e=U.RavenConfig;e&&this.config(e.dsn,e.config).install()},showReportDialog:function showReportDialog(e){if(z){if(!(e=b({eventId:this.lastEventId(),dsn:this._dsn,user:this._globalContext.user||{}},e)).eventId)throw new o("Missing eventId");if(!e.dsn)throw new o("Missing DSN");var t=encodeURIComponent,r=[];for(var n in e)if("user"===n){var i=e.user;i.name&&r.push("name="+t(i.name)),i.email&&r.push("email="+t(i.email))}else r.push(t(n)+"="+t(e[n]));var a=this._getGlobalServer(this._parseDSN(e.dsn)),s=z.createElement("script");s.async=!0,s.src=a+"/api/embed/error-page/?"+r.join("&"),(z.head||z.body).appendChild(s)}},_ignoreNextOnError:function _ignoreNextOnError(){var e=this;this._ignoreOnError+=1,setTimeout((function(){e._ignoreOnError-=1}))},_triggerEvent:function _triggerEvent(e,t){var r,n;if(this._hasDocument){for(n in t=t||{},e="raven"+e.substr(0,1).toUpperCase()+e.substr(1),z.createEvent?(r=z.createEvent("HTMLEvents")).initEvent(e,!0,!0):(r=z.createEventObject()).eventType=e,t)k(t,n)&&(r[n]=t[n]);if(z.createEvent)z.dispatchEvent(r);else try{z.fireEvent("on"+r.eventType.toLowerCase(),r)}catch(i){}}},_breadcrumbEventHandler:function _breadcrumbEventHandler(e){var t=this;return function(r){if(t._keypressTimeout=null,t._lastCapturedEvent!==r){var n;t._lastCapturedEvent=r;try{n=T(r.target)}catch(i){n="<unknown>"}t.captureBreadcrumb({category:"ui."+e,message:n})}}},_keypressEventHandler:function _keypressEventHandler(){var e=this;return function(t){var r;try{r=t.target}catch(a){return}var n=r&&r.tagName;if(n&&("INPUT"===n||"TEXTAREA"===n||r.isContentEditable)){var i=e._keypressTimeout;i||e._breadcrumbEventHandler("input")(t),clearTimeout(i),e._keypressTimeout=setTimeout((function(){e._keypressTimeout=null}),1e3)}}},_captureUrlChange:function _captureUrlChange(e,t){var r=R(this._location.href),n=R(t),i=R(e);this._lastHref=t,r.protocol===n.protocol&&r.host===n.host&&(t=n.relative),r.protocol===i.protocol&&r.host===i.host&&(e=i.relative),this.captureBreadcrumb({category:"navigation",data:{to:t,from:e}})},_patchFunctionToString:function _patchFunctionToString(){var e=this;e._originalFunctionToString=Function.prototype.toString,Function.prototype.toString=function(){return"function"===typeof this&&this.__raven__?e._originalFunctionToString.apply(this.__orig__,arguments):e._originalFunctionToString.apply(this,arguments)}},_unpatchFunctionToString:function _unpatchFunctionToString(){this._originalFunctionToString&&(Function.prototype.toString=this._originalFunctionToString)},_instrumentTryCatch:function _instrumentTryCatch(){var e=this,t=e._wrappedBuiltIns;function wrapTimeFn(t){return function(r,n){for(var i=new Array(arguments.length),a=0;a<i.length;++a)i[a]=arguments[a];var o=i[0];return g(o)&&(i[0]=e.wrap({mechanism:{type:"instrument",data:{function:t.name||"<anonymous>"}}},o)),t.apply?t.apply(this,i):t(i[0],i[1])}}var r=this._globalOptions.autoBreadcrumbs;function wrapEventTarget(n){var i=U[n]&&U[n].prototype;i&&i.hasOwnProperty&&i.hasOwnProperty("addEventListener")&&(D(i,"addEventListener",(function(t){return function(i,a,o,s){try{a&&a.handleEvent&&(a.handleEvent=e.wrap({mechanism:{type:"instrument",data:{target:n,function:"handleEvent",handler:a&&a.name||"<anonymous>"}}},a.handleEvent))}catch(f){}var u,l,c;return r&&r.dom&&("EventTarget"===n||"Node"===n)&&(l=e._breadcrumbEventHandler("click"),c=e._keypressEventHandler(),u=function before(e){if(e){var t;try{t=e.type}catch(r){return}return"click"===t?l(e):"keypress"===t?c(e):void 0}}),t.call(this,i,e.wrap({mechanism:{type:"instrument",data:{target:n,function:"addEventListener",handler:a&&a.name||"<anonymous>"}}},a,u),o,s)}}),t),D(i,"removeEventListener",(function(e){return function(t,r,n,i){try{r=r&&(r.__raven_wrapper__?r.__raven_wrapper__:r)}catch(a){}return e.call(this,t,r,n,i)}}),t))}D(U,"setTimeout",wrapTimeFn,t),D(U,"setInterval",wrapTimeFn,t),U.requestAnimationFrame&&D(U,"requestAnimationFrame",(function(t){return function(r){return t(e.wrap({mechanism:{type:"instrument",data:{function:"requestAnimationFrame",handler:t&&t.name||"<anonymous>"}}},r))}}),t);for(var n=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],i=0;i<n.length;i++)wrapEventTarget(n[i])},_instrumentBreadcrumbs:function _instrumentBreadcrumbs(){var e=this,t=this._globalOptions.autoBreadcrumbs,r=e._wrappedBuiltIns;function wrapProp(t,r){t in r&&g(r[t])&&D(r,t,(function(r){return e.wrap({mechanism:{type:"instrument",data:{function:t,handler:r&&r.name||"<anonymous>"}}},r)}))}if(t.xhr&&"XMLHttpRequest"in U){var n=U.XMLHttpRequest&&U.XMLHttpRequest.prototype;D(n,"open",(function(t){return function(r,n){return m(n)&&-1===n.indexOf(e._globalKey)&&(this.__raven_xhr={method:r,url:n,status_code:null}),t.apply(this,arguments)}}),r),D(n,"send",(function(t){return function(){var r=this;function onreadystatechangeHandler(){if(r.__raven_xhr&&4===r.readyState){try{r.__raven_xhr.status_code=r.status}catch(t){}e.captureBreadcrumb({type:"http",category:"xhr",data:r.__raven_xhr})}}for(var n=["onload","onerror","onprogress"],i=0;i<n.length;i++)wrapProp(n[i],r);return"onreadystatechange"in r&&g(r.onreadystatechange)?D(r,"onreadystatechange",(function(t){return e.wrap({mechanism:{type:"instrument",data:{function:"onreadystatechange",handler:t&&t.name||"<anonymous>"}}},t,onreadystatechangeHandler)})):r.onreadystatechange=onreadystatechangeHandler,t.apply(this,arguments)}}),r)}t.xhr&&P()&&D(U,"fetch",(function(t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;++n)r[n]=arguments[n];var i,a=r[0],o="GET";if("string"===typeof a?i=a:"Request"in U&&a instanceof U.Request?(i=a.url,a.method&&(o=a.method)):i=""+a,-1!==i.indexOf(e._globalKey))return t.apply(this,r);r[1]&&r[1].method&&(o=r[1].method);var s={method:o,url:i,status_code:null};return t.apply(this,r).then((function(t){return s.status_code=t.status,e.captureBreadcrumb({type:"http",category:"fetch",data:s}),t})).catch((function(t){throw e.captureBreadcrumb({type:"http",category:"fetch",data:s,level:"error"}),t}))}}),r),t.dom&&this._hasDocument&&(z.addEventListener?(z.addEventListener("click",e._breadcrumbEventHandler("click"),!1),z.addEventListener("keypress",e._keypressEventHandler(),!1)):z.attachEvent&&(z.attachEvent("onclick",e._breadcrumbEventHandler("click")),z.attachEvent("onkeypress",e._keypressEventHandler())));var i=U.chrome,a=!(i&&i.app&&i.app.runtime)&&U.history&&U.history.pushState&&U.history.replaceState;if(t.location&&a){var o=U.onpopstate;U.onpopstate=function(){var t=e._location.href;if(e._captureUrlChange(e._lastHref,t),o)return o.apply(this,arguments)};var s=function historyReplacementFunction(t){return function(){var r=arguments.length>2?arguments[2]:void 0;return r&&e._captureUrlChange(e._lastHref,r+""),t.apply(this,arguments)}};D(U.history,"pushState",s,r),D(U.history,"replaceState",s,r)}if(t.console&&"console"in U&&console.log){var u=function consoleMethodCallback(t,r){e.captureBreadcrumb({message:t,level:r.level,category:"console"})};_(["debug","info","warn","error","log"],(function(e,t){L(console,t,u)}))}},_restoreBuiltIns:function _restoreBuiltIns(){for(var e;this._wrappedBuiltIns.length;){var t=(e=this._wrappedBuiltIns.shift())[0],r=e[1],n=e[2];t[r]=n}},_restoreConsole:function _restoreConsole(){for(var e in this._originalConsoleMethods)this._originalConsole[e]=this._originalConsoleMethods[e]},_drainPlugins:function _drainPlugins(){var e=this;_(this._plugins,(function(t,r){var n=r[0],i=r[1];n.apply(e,[e].concat(i))}))},_parseDSN:function _parseDSN(e){var t=B.exec(e),r={},n=7;try{for(;n--;)r[N[n]]=t[n]||""}catch(i){throw new o("Invalid DSN: "+e)}if(r.pass&&!this._globalOptions.allowSecretKey)throw new o("Do not specify your secret key in the DSN. See: http://bit.ly/raven-secret-key");return r},_getGlobalServer:function _getGlobalServer(e){var t="//"+e.host+(e.port?":"+e.port:"");return e.protocol&&(t=e.protocol+":"+t),t},_handleOnErrorStackInfo:function _handleOnErrorStackInfo(e,t){(t=t||{}).mechanism=t.mechanism||{type:"onerror",handled:!1},this._ignoreOnError||this._handleStackInfo(e,t)},_handleStackInfo:function _handleStackInfo(e,t){var r=this._prepareFrames(e,t);this._triggerEvent("handle",{stackInfo:e,options:t}),this._processException(e.name,e.message,e.url,e.lineno,r,t)},_prepareFrames:function _prepareFrames(e,t){var r=this,n=[];if(e.stack&&e.stack.length&&(_(e.stack,(function(t,i){var a=r._normalizeFrame(i,e.url);a&&n.push(a)})),t&&t.trimHeadFrames))for(var i=0;i<t.trimHeadFrames&&i<n.length;i++)n[i].in_app=!1;return n=n.slice(0,this._globalOptions.stackTraceLimit)},_normalizeFrame:function _normalizeFrame(e,t){var r={filename:e.url,lineno:e.line,colno:e.column,function:e.func||"?"};return e.url||(r.filename=t),r.in_app=!(this._globalOptions.includePaths.test&&!this._globalOptions.includePaths.test(r.filename)||/(Raven|TraceKit)\./.test(r.function)||/raven\.(min\.)?js$/.test(r.filename)),r},_processException:function _processException(e,t,r,n,i,a){var o,s=(e?e+": ":"")+(t||"");if((!this._globalOptions.ignoreErrors.test||!this._globalOptions.ignoreErrors.test(t)&&!this._globalOptions.ignoreErrors.test(s))&&(i&&i.length?(r=i[0].filename||r,i.reverse(),o={frames:i}):r&&(o={frames:[{filename:r,lineno:n,in_app:!0}]}),(!this._globalOptions.ignoreUrls.test||!this._globalOptions.ignoreUrls.test(r))&&(!this._globalOptions.whitelistUrls.test||this._globalOptions.whitelistUrls.test(r)))){var u=b({exception:{values:[{type:e,value:t,stacktrace:o}]},transaction:r},a),l=u.exception.values[0];null==l.type&&""===l.value&&(l.value="Unrecoverable error caught"),!u.exception.mechanism&&u.mechanism&&(u.exception.mechanism=u.mechanism,delete u.mechanism),u.exception.mechanism=b({type:"generic",handled:!0},u.exception.mechanism||{}),this._send(u)}},_trimPacket:function _trimPacket(e){var t=this._globalOptions.maxMessageLength;if(e.message&&(e.message=x(e.message,t)),e.exception){var r=e.exception.values[0];r.value=x(r.value,t)}var n=e.request;return n&&(n.url&&(n.url=x(n.url,this._globalOptions.maxUrlLength)),n.Referer&&(n.Referer=x(n.Referer,this._globalOptions.maxUrlLength))),e.breadcrumbs&&e.breadcrumbs.values&&this._trimBreadcrumbs(e.breadcrumbs),e},_trimBreadcrumbs:function _trimBreadcrumbs(e){for(var t,r,n,i=["to","from","url"],a=0;a<e.values.length;++a)if((r=e.values[a]).hasOwnProperty("data")&&d(r.data)&&!w(r.data)){n=b({},r.data);for(var o=0;o<i.length;++o)t=i[o],n.hasOwnProperty(t)&&n[t]&&(n[t]=x(n[t],this._globalOptions.maxUrlLength));e.values[a].data=n}},_getHttpData:function _getHttpData(){if(this._hasNavigator||this._hasDocument){var e={};return this._hasNavigator&&q.userAgent&&(e.headers={"User-Agent":q.userAgent}),U.location&&U.location.href&&(e.url=U.location.href),this._hasDocument&&z.referrer&&(e.headers||(e.headers={}),e.headers.Referer=z.referrer),e}},_resetBackoff:function _resetBackoff(){this._backoffDuration=0,this._backoffStart=null},_shouldBackoff:function _shouldBackoff(){return this._backoffDuration&&now()-this._backoffStart<this._backoffDuration},_isRepeatData:function _isRepeatData(e){var t=this._lastData;return!(!t||e.message!==t.message||e.transaction!==t.transaction)&&(e.stacktrace||t.stacktrace?A(e.stacktrace,t.stacktrace):e.exception||t.exception?O(e.exception,t.exception):!e.fingerprint&&!t.fingerprint||Boolean(e.fingerprint&&t.fingerprint)&&JSON.stringify(e.fingerprint)===JSON.stringify(t.fingerprint))},_setBackoffState:function _setBackoffState(e){if(!this._shouldBackoff()){var t=e.status;if(400===t||401===t||429===t){var r;try{r=P()?e.headers.get("Retry-After"):e.getResponseHeader("Retry-After"),r=1e3*parseInt(r,10)}catch(n){}this._backoffDuration=r||(2*this._backoffDuration||1e3),this._backoffStart=now()}}},_send:function _send(e){var t=this._globalOptions,r={project:this._globalProject,logger:t.logger,platform:"javascript"},n=this._getHttpData();n&&(r.request=n),e.trimHeadFrames&&delete e.trimHeadFrames,(e=b(r,e)).tags=b(b({},this._globalContext.tags),e.tags),e.extra=b(b({},this._globalContext.extra),e.extra),e.extra["session:duration"]=now()-this._startTime,this._breadcrumbs&&this._breadcrumbs.length>0&&(e.breadcrumbs={values:[].slice.call(this._breadcrumbs,0)}),this._globalContext.user&&(e.user=this._globalContext.user),t.environment&&(e.environment=t.environment),t.release&&(e.release=t.release),t.serverName&&(e.server_name=t.serverName),e=this._sanitizeData(e),Object.keys(e).forEach((function(t){(null==e[t]||""===e[t]||y(e[t]))&&delete e[t]})),g(t.dataCallback)&&(e=t.dataCallback(e)||e),e&&!y(e)&&(g(t.shouldSendCallback)&&!t.shouldSendCallback(e)||(this._shouldBackoff()?this._logDebug("warn","Raven dropped error due to backoff: ",e):"number"===typeof t.sampleRate?Math.random()<t.sampleRate&&this._sendProcessedPayload(e):this._sendProcessedPayload(e)))},_sanitizeData:function _sanitizeData(e){return I(e,this._globalOptions.sanitizeKeys)},_getUuid:function _getUuid(){return C()},_sendProcessedPayload:function _sendProcessedPayload(e,t){var r=this,n=this._globalOptions;if(this.isSetup())if(e=this._trimPacket(e),this._globalOptions.allowDuplicates||!this._isRepeatData(e)){this._lastEventId=e.event_id||(e.event_id=this._getUuid()),this._lastData=e,this._logDebug("debug","Raven about to send:",e);var i={sentry_version:"7",sentry_client:"raven-js/"+this.VERSION,sentry_key:this._globalKey};this._globalSecret&&(i.sentry_secret=this._globalSecret);var a=e.exception&&e.exception.values[0];this._globalOptions.autoBreadcrumbs&&this._globalOptions.autoBreadcrumbs.sentry&&this.captureBreadcrumb({category:"sentry",message:a?(a.type?a.type+": ":"")+a.value:e.message,event_id:e.event_id,level:e.level||"error"});var o=this._globalEndpoint;(n.transport||this._makeRequest).call(this,{url:o,auth:i,data:e,options:n,onSuccess:function success(){r._resetBackoff(),r._triggerEvent("success",{data:e,src:o}),t&&t()},onError:function failure(n){r._logDebug("error","Raven transport failed to send: ",n),n.request&&r._setBackoffState(n.request),r._triggerEvent("failure",{data:e,src:o}),n=n||new Error("Raven send failed (no additional details provided)"),t&&t(n)}})}else this._logDebug("warn","Raven dropped repeat event: ",e)},_makeRequest:function _makeRequest(e){var t=e.url+"?"+E(e.auth),r=null,n={};if(e.options.headers&&(r=this._evaluateHash(e.options.headers)),e.options.fetchParameters&&(n=this._evaluateHash(e.options.fetchParameters)),P()){n.body=i(e.data);var a=b({},this._fetchDefaults),o=b(a,n);return r&&(o.headers=r),U.fetch(t,o).then((function(t){if(t.ok)e.onSuccess&&e.onSuccess();else{var r=new Error("Sentry error code: "+t.status);r.request=t,e.onError&&e.onError(r)}})).catch((function(){e.onError&&e.onError(new Error("Sentry error code: network unavailable"))}))}var s=U.XMLHttpRequest&&new U.XMLHttpRequest;s&&(("withCredentials"in s||"undefined"!==typeof XDomainRequest)&&("withCredentials"in s?s.onreadystatechange=function(){if(4===s.readyState)if(200===s.status)e.onSuccess&&e.onSuccess();else if(e.onError){var t=new Error("Sentry error code: "+s.status);t.request=s,e.onError(t)}}:(s=new XDomainRequest,t=t.replace(/^https?:/,""),e.onSuccess&&(s.onload=e.onSuccess),e.onError&&(s.onerror=function(){var t=new Error("Sentry error code: XDomainRequest");t.request=s,e.onError(t)})),s.open("POST",t),r&&_(r,(function(e,t){s.setRequestHeader(e,t)})),s.send(i(e.data))))},_evaluateHash:function _evaluateHash(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];t[r]="function"===typeof n?n():n}return t},_logDebug:function _logDebug(e){this._originalConsoleMethods[e]&&(this.debug||this._globalOptions.debug)&&Function.prototype.apply.call(this._originalConsoleMethods[e],this._originalConsole,[].slice.call(arguments,1))},_mergeContext:function _mergeContext(e,t){p(t)?delete this._globalContext[e]:this._globalContext[e]=b(this._globalContext[e]||{},t)}},Raven.prototype.setUser=Raven.prototype.setUserContext,Raven.prototype.setReleaseContext=Raven.prototype.setRelease,e.exports=Raven}).call(this,r(18))},function(e,t,r){(function(t){var n=r(119),i={collectWindowErrors:!0,debug:!1},a="undefined"!==typeof window?window:"undefined"!==typeof t?t:"undefined"!==typeof self?self:{},o=[].slice,s="?",u=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function getLocationHref(){return"undefined"===typeof document||null==document.location?"":document.location.href}i.report=function reportModuleWrapper(){var e,t,r=[],l=null,c=null,f=null;function notifyHandlers(e,t){var n=null;if(!t||i.collectWindowErrors){for(var a in r)if(r.hasOwnProperty(a))try{r[a].apply(null,[e].concat(o.call(arguments,2)))}catch(s){n=s}if(n)throw n}}function traceKitWindowOnError(t,r,a,o,l){var c=n.isErrorEvent(l)?l.error:l,d=n.isErrorEvent(t)?t.message:t;if(f)i.computeStackTrace.augmentStackTraceWithInitialElement(f,r,a,d),processLastException();else if(c&&n.isError(c))notifyHandlers(i.computeStackTrace(c),!0);else{var h,p={url:r,line:a,column:o},g=void 0;if("[object String]"==={}.toString.call(d))(h=d.match(u))&&(g=h[1],d=h[2]);p.func=s,notifyHandlers({name:g,message:d,url:getLocationHref(),stack:[p]},!0)}return!!e&&e.apply(this,arguments)}function processLastException(){var e=f,t=l;l=null,f=null,c=null,notifyHandlers.apply(null,[e,!1].concat(t))}function report(e,t){var r=o.call(arguments,1);if(f){if(c===e)return;processLastException()}var n=i.computeStackTrace(e);if(f=n,c=e,l=r,setTimeout((function(){c===e&&processLastException()}),n.incomplete?2e3:0),!1!==t)throw e}return report.subscribe=function subscribe(n){!function installGlobalHandler(){if(t)return;e=a.onerror,a.onerror=traceKitWindowOnError,t=!0}(),r.push(n)},report.unsubscribe=function unsubscribe(e){for(var t=r.length-1;t>=0;--t)r[t]===e&&r.splice(t,1)},report.uninstall=function unsubscribeAll(){!function uninstallGlobalHandler(){if(!t)return;a.onerror=e,t=!1,e=void 0}(),r=[]},report}(),i.computeStackTrace=function computeStackTraceWrapper(){function computeStackTraceFromStackProp(e){if("undefined"!==typeof e.stack&&e.stack){for(var t,r,n,i=/^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|[a-z]:|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,a=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx(?:-web)|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,o=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|moz-extension).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js))(?::(\d+))?(?::(\d+))?\s*$/i,u=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,l=/\((\S*)(?::(\d+))(?::(\d+))\)/,c=e.stack.split("\n"),f=[],d=(/^(.*) is undefined$/.exec(e.message),0),h=c.length;d<h;++d){if(r=i.exec(c[d])){var p=r[2]&&0===r[2].indexOf("native");r[2]&&0===r[2].indexOf("eval")&&(t=l.exec(r[2]))&&(r[2]=t[1],r[3]=t[2],r[4]=t[3]),n={url:p?null:r[2],func:r[1]||s,args:p?[r[2]]:[],line:r[3]?+r[3]:null,column:r[4]?+r[4]:null}}else if(r=a.exec(c[d]))n={url:r[2],func:r[1]||s,args:[],line:+r[3],column:r[4]?+r[4]:null};else{if(!(r=o.exec(c[d])))continue;r[3]&&r[3].indexOf(" > eval")>-1&&(t=u.exec(r[3]))?(r[3]=t[1],r[4]=t[2],r[5]=null):0!==d||r[5]||"undefined"===typeof e.columnNumber||(f[0].column=e.columnNumber+1),n={url:r[3],func:r[1]||s,args:r[2]?r[2].split(","):[],line:r[4]?+r[4]:null,column:r[5]?+r[5]:null}}if(!n.func&&n.line&&(n.func=s),n.url&&"blob:"===n.url.substr(0,5)){var g=new XMLHttpRequest;if(g.open("GET",n.url,!1),g.send(null),200===g.status){var m=g.responseText||"",v=(m=m.slice(-300)).match(/\/\/# sourceMappingURL=(.*)$/);if(v){var y=v[1];"~"===y.charAt(0)&&(y=("undefined"===typeof document||null==document.location?"":document.location.origin?document.location.origin:document.location.protocol+"//"+document.location.hostname+(document.location.port?":"+document.location.port:""))+y.slice(1)),n.url=y.slice(0,-4)}}}f.push(n)}return f.length?{name:e.name,message:e.message,url:getLocationHref(),stack:f}:null}}function augmentStackTraceWithInitialElement(e,t,r,n){var i={url:t,line:r};if(i.url&&i.line){if(e.incomplete=!1,i.func||(i.func=s),e.stack.length>0&&e.stack[0].url===i.url){if(e.stack[0].line===i.line)return!1;if(!e.stack[0].line&&e.stack[0].func===i.func)return e.stack[0].line=i.line,!1}return e.stack.unshift(i),e.partial=!0,!0}return e.incomplete=!0,!1}function computeStackTraceByWalkingCallerChain(e,t){for(var r,n,a=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,o=[],u={},l=!1,c=computeStackTraceByWalkingCallerChain.caller;c&&!l;c=c.caller)if(c!==computeStackTrace&&c!==i.report){if(n={url:null,func:s,line:null,column:null},c.name?n.func=c.name:(r=a.exec(c.toString()))&&(n.func=r[1]),"undefined"===typeof n.func)try{n.func=r.input.substring(0,r.input.indexOf("{"))}catch(d){}u[""+c]?l=!0:u[""+c]=!0,o.push(n)}t&&o.splice(0,t);var f={name:e.name,message:e.message,url:getLocationHref(),stack:o};return augmentStackTraceWithInitialElement(f,e.sourceURL||e.fileName,e.line||e.lineNumber,e.message||e.description),f}function computeStackTrace(e,t){var r=null;t=null==t?0:+t;try{if(r=computeStackTraceFromStackProp(e))return r}catch(n){if(i.debug)throw n}try{if(r=computeStackTraceByWalkingCallerChain(e,t+1))return r}catch(n){if(i.debug)throw n}return{name:e.name,message:e.message,url:getLocationHref()}}return computeStackTrace.augmentStackTraceWithInitialElement=augmentStackTraceWithInitialElement,computeStackTrace.computeStackTraceFromStackProp=computeStackTraceFromStackProp,computeStackTrace}(),e.exports=i}).call(this,r(18))},function(e,t){function safeAdd(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function md5cmn(e,t,r,n,i,a){return safeAdd(function bitRotateLeft(e,t){return e<<t|e>>>32-t}(safeAdd(safeAdd(t,e),safeAdd(n,a)),i),r)}function md5ff(e,t,r,n,i,a,o){return md5cmn(t&r|~t&n,e,t,i,a,o)}function md5gg(e,t,r,n,i,a,o){return md5cmn(t&n|r&~n,e,t,i,a,o)}function md5hh(e,t,r,n,i,a,o){return md5cmn(t^r^n,e,t,i,a,o)}function md5ii(e,t,r,n,i,a,o){return md5cmn(r^(t|~n),e,t,i,a,o)}function binlMD5(e,t){var r,n,i,a,o;e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;var s=1732584193,u=-271733879,l=-1732584194,c=271733878;for(r=0;r<e.length;r+=16)n=s,i=u,a=l,o=c,s=md5ff(s,u,l,c,e[r],7,-680876936),c=md5ff(c,s,u,l,e[r+1],12,-389564586),l=md5ff(l,c,s,u,e[r+2],17,606105819),u=md5ff(u,l,c,s,e[r+3],22,-1044525330),s=md5ff(s,u,l,c,e[r+4],7,-176418897),c=md5ff(c,s,u,l,e[r+5],12,1200080426),l=md5ff(l,c,s,u,e[r+6],17,-1473231341),u=md5ff(u,l,c,s,e[r+7],22,-45705983),s=md5ff(s,u,l,c,e[r+8],7,1770035416),c=md5ff(c,s,u,l,e[r+9],12,-1958414417),l=md5ff(l,c,s,u,e[r+10],17,-42063),u=md5ff(u,l,c,s,e[r+11],22,-1990404162),s=md5ff(s,u,l,c,e[r+12],7,1804603682),c=md5ff(c,s,u,l,e[r+13],12,-40341101),l=md5ff(l,c,s,u,e[r+14],17,-1502002290),s=md5gg(s,u=md5ff(u,l,c,s,e[r+15],22,1236535329),l,c,e[r+1],5,-165796510),c=md5gg(c,s,u,l,e[r+6],9,-1069501632),l=md5gg(l,c,s,u,e[r+11],14,643717713),u=md5gg(u,l,c,s,e[r],20,-373897302),s=md5gg(s,u,l,c,e[r+5],5,-701558691),c=md5gg(c,s,u,l,e[r+10],9,38016083),l=md5gg(l,c,s,u,e[r+15],14,-660478335),u=md5gg(u,l,c,s,e[r+4],20,-405537848),s=md5gg(s,u,l,c,e[r+9],5,568446438),c=md5gg(c,s,u,l,e[r+14],9,-1019803690),l=md5gg(l,c,s,u,e[r+3],14,-187363961),u=md5gg(u,l,c,s,e[r+8],20,1163531501),s=md5gg(s,u,l,c,e[r+13],5,-1444681467),c=md5gg(c,s,u,l,e[r+2],9,-51403784),l=md5gg(l,c,s,u,e[r+7],14,1735328473),s=md5hh(s,u=md5gg(u,l,c,s,e[r+12],20,-1926607734),l,c,e[r+5],4,-378558),c=md5hh(c,s,u,l,e[r+8],11,-2022574463),l=md5hh(l,c,s,u,e[r+11],16,1839030562),u=md5hh(u,l,c,s,e[r+14],23,-35309556),s=md5hh(s,u,l,c,e[r+1],4,-1530992060),c=md5hh(c,s,u,l,e[r+4],11,1272893353),l=md5hh(l,c,s,u,e[r+7],16,-155497632),u=md5hh(u,l,c,s,e[r+10],23,-1094730640),s=md5hh(s,u,l,c,e[r+13],4,681279174),c=md5hh(c,s,u,l,e[r],11,-358537222),l=md5hh(l,c,s,u,e[r+3],16,-722521979),u=md5hh(u,l,c,s,e[r+6],23,76029189),s=md5hh(s,u,l,c,e[r+9],4,-640364487),c=md5hh(c,s,u,l,e[r+12],11,-421815835),l=md5hh(l,c,s,u,e[r+15],16,530742520),s=md5ii(s,u=md5hh(u,l,c,s,e[r+2],23,-995338651),l,c,e[r],6,-198630844),c=md5ii(c,s,u,l,e[r+7],10,1126891415),l=md5ii(l,c,s,u,e[r+14],15,-1416354905),u=md5ii(u,l,c,s,e[r+5],21,-57434055),s=md5ii(s,u,l,c,e[r+12],6,1700485571),c=md5ii(c,s,u,l,e[r+3],10,-1894986606),l=md5ii(l,c,s,u,e[r+10],15,-1051523),u=md5ii(u,l,c,s,e[r+1],21,-2054922799),s=md5ii(s,u,l,c,e[r+8],6,1873313359),c=md5ii(c,s,u,l,e[r+15],10,-30611744),l=md5ii(l,c,s,u,e[r+6],15,-1560198380),u=md5ii(u,l,c,s,e[r+13],21,1309151649),s=md5ii(s,u,l,c,e[r+4],6,-145523070),c=md5ii(c,s,u,l,e[r+11],10,-1120210379),l=md5ii(l,c,s,u,e[r+2],15,718787259),u=md5ii(u,l,c,s,e[r+9],21,-343485551),s=safeAdd(s,n),u=safeAdd(u,i),l=safeAdd(l,a),c=safeAdd(c,o);return[s,u,l,c]}function binl2rstr(e){var t,r="",n=32*e.length;for(t=0;t<n;t+=8)r+=String.fromCharCode(e[t>>5]>>>t%32&255);return r}function rstr2binl(e){var t,r=[];for(r[(e.length>>2)-1]=void 0,t=0;t<r.length;t+=1)r[t]=0;var n=8*e.length;for(t=0;t<n;t+=8)r[t>>5]|=(255&e.charCodeAt(t/8))<<t%32;return r}function rstr2hex(e){var t,r,n="";for(r=0;r<e.length;r+=1)t=e.charCodeAt(r),n+="0123456789abcdef".charAt(t>>>4&15)+"0123456789abcdef".charAt(15&t);return n}function str2rstrUTF8(e){return unescape(encodeURIComponent(e))}function rawMD5(e){return function rstrMD5(e){return binl2rstr(binlMD5(rstr2binl(e),8*e.length))}(str2rstrUTF8(e))}function rawHMACMD5(e,t){return function rstrHMACMD5(e,t){var r,n,i=rstr2binl(e),a=[],o=[];for(a[15]=o[15]=void 0,i.length>16&&(i=binlMD5(i,8*e.length)),r=0;r<16;r+=1)a[r]=909522486^i[r],o[r]=1549556828^i[r];return n=binlMD5(a.concat(rstr2binl(t)),512+8*t.length),binl2rstr(binlMD5(o.concat(n),640))}(str2rstrUTF8(e),str2rstrUTF8(t))}e.exports=function md5(e,t,r){return t?r?rawHMACMD5(t,e):function hexHMACMD5(e,t){return rstr2hex(rawHMACMD5(e,t))}(t,e):r?rawMD5(e):function hexMD5(e){return rstr2hex(rawMD5(e))}(e)}},function(e,t){function RavenConfigError(e){this.name="RavenConfigError",this.message=e}RavenConfigError.prototype=new Error,RavenConfigError.prototype.constructor=RavenConfigError,e.exports=RavenConfigError},function(e,t,r){var n=r(119);e.exports={wrapMethod:function wrapMethod(e,t,r){var i=e[t],a=e;if(t in e){var o="warn"===t?"warning":t;e[t]=function(){var e=[].slice.call(arguments),s=n.safeJoin(e," "),u={level:o,logger:"console",extra:{arguments:e}};"assert"===t?!1===e[0]&&(s="Assertion failed: "+(n.safeJoin(e.slice(1)," ")||"console.assert"),u.extra.arguments=e.slice(1),r&&r(s,u)):r&&r(s,u),i&&Function.prototype.apply.call(i,a,e)}}}}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=_interopRequireDefault(r(26)),i=_interopRequireDefault(r(27)),a=_interopRequireDefault(r(120)),o=_interopRequireDefault(r(166)),s=r(167),u=_interopRequireDefault(r(168)),l=r(169),c=(_interopRequireDefault(r(121)),_interopRequireDefault(r(170)));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var f=(0,u.default)(),d=(0,u.default)(),h=(0,u.default)(),p=function(){function Panda(e,t){(0,a.default)(this,Panda),this.usb=t,this.device=null,this.onError=(0,l.partial)(f.listen,this),this.onConnect=(0,l.partial)(d.listen,this),this.onDisconnect=(0,l.partial)(h.listen,this)}return(0,o.default)(Panda,[{key:"connect",value:function(){var e=(0,i.default)(n.default.mark((function _callee(){return n.default.wrap((function _callee$(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.usb.requestDevice({filters:[{vendorId:48042}]});case 2:return this.device=e.sent,e.next=5,this.device.open();case 5:return e.next=7,this.device.selectConfiguration(1);case 7:return e.next=9,this.device.claimInterface(0);case 9:return e.abrupt("return",!0);case 10:case"end":return e.stop()}}),_callee,this)})));return function connect(){return e.apply(this,arguments)}}()},{key:"disconnect",value:function(){var e=(0,i.default)(n.default.mark((function _callee2(){return n.default.wrap((function _callee2$(e){for(;;)switch(e.prev=e.next){case 0:if(this.device){e.next=2;break}return e.abrupt("return",!1);case 2:return e.next=4,this.device.close();case 4:return this.device=null,e.abrupt("return",!0);case 6:case"end":return e.stop()}}),_callee2,this)})));return function disconnect(){return e.apply(this,arguments)}}()},{key:"vendorRequest",value:function(){var t=(0,i.default)(n.default.mark((function _callee3(t,r){var i,a;return n.default.wrap((function _callee3$(n){for(;;)switch(n.prev=n.next){case 0:return i={requestType:"vendor",recipient:"device",request:t.request,value:t.value,index:t.index},n.next=3,this.device.controlTransferIn(i,r);case 3:return a=n.sent,a={data:e.from(a.data.buffer),status:a.status},n.abrupt("return",a);case 6:case"end":return n.stop()}}),_callee3,this)})));return function vendorRequest(e,r){return t.apply(this,arguments)}}()},{key:"vendorWrite",value:function(){var e=(0,i.default)(n.default.mark((function _callee4(e,t){var r;return n.default.wrap((function _callee4$(n){for(;;)switch(n.prev=n.next){case 0:return r={requestType:"vendor",recipient:"device",request:e.request,value:e.value,index:e.index},n.next=3,this.device.controlTransferOut(r,t);case 3:return n.abrupt("return",!0);case 4:case"end":return n.stop()}}),_callee4,this)})));return function vendorWrite(t,r){return e.apply(this,arguments)}}()},{key:"nextFakeMessage",value:function(){var e=(0,i.default)(n.default.mark((function _callee5(){return n.default.wrap((function _callee5$(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,c.default)(10);case 2:return e.abrupt("return",(0,s.packCAN)({address:0,busTime:~~(65e3*Math.random()),data:"".padEnd(16,"0"),bus:0}));case 3:case"end":return e.stop()}}),_callee5,this)})));return function nextFakeMessage(){return e.apply(this,arguments)}}()},{key:"nextMessage",value:function(){var e=(0,i.default)(n.default.mark((function _callee6(){var e,t;return n.default.wrap((function _callee6$(r){for(;;)switch(r.prev=r.next){case 0:e=null,t=0;case 2:if(null!==e){r.next=17;break}return r.prev=3,r.next=6,this.device.transferIn(1,4096);case 6:e=r.sent,r.next=15;break;case 9:return r.prev=9,r.t0=r.catch(3),console.warn("can_recv failed, retrying"),t=Math.min(++t,10),r.next=15,(0,c.default)(100*t);case 15:r.next=2;break;case 17:return r.abrupt("return",e.data.buffer);case 18:case"end":return r.stop()}}),_callee6,this,[[3,9]])})));return function nextMessage(){return e.apply(this,arguments)}}()}]),Panda}();t.default=p}).call(this,r(21).Buffer)},function(e,t,r){"use strict";t.byteLength=function byteLength(e){var t=getLens(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function toByteArray(e){var t,r,n=getLens(e),o=n[0],s=n[1],u=new a(function _byteLength(e,t,r){return 3*(t+r)/4-r}(0,o,s)),l=0,c=s>0?o-4:o;for(r=0;r<c;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],u[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===s&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[l++]=255&t);1===s&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function fromByteArray(e){for(var t,r=e.length,i=r%3,a=[],o=0,s=r-i;o<s;o+=16383)a.push(encodeChunk(e,o,o+16383>s?s:o+16383));1===i?(t=e[r-1],a.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],a.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return a.join("")};for(var n=[],i=[],a="undefined"!==typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=o.length;s<u;++s)n[s]=o[s],i[o.charCodeAt(s)]=s;function getLens(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function encodeChunk(e,t,r){for(var i,a,o=[],s=t;s<r;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(n[(a=i)>>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,r,n,i){var a,o,s=8*i-n-1,u=(1<<s)-1,l=u>>1,c=-7,f=r?i-1:0,d=r?-1:1,h=e[t+f];for(f+=d,a=h&(1<<-c)-1,h>>=-c,c+=s;c>0;a=256*a+e[t+f],f+=d,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+e[t+f],f+=d,c-=8);if(0===a)a=1-l;else{if(a===u)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,n),a-=l}return(h?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,u,l=8*a-i-1,c=(1<<l)-1,f=c>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:a-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(o++,u/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(t*u-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[r+h]=255&s,h+=p,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[r+h]=255&o,h+=p,o/=256,l-=8);e[r+h-p]|=128*g}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){e.exports={default:r(372),__esModule:!0}},function(e,t,r){r(373);var n=r(20).Object;e.exports=function defineProperty(e,t,r){return n.defineProperty(e,t,r)}},function(e,t,r){var n=r(29);n(n.S+n.F*!r(39),"Object",{defineProperty:r(35).f})},function(e,t){function ListItem(e){this.fn=e,this.deleted=!1}e.exports=function Event(){var e=[];return{broadcast:function broadcast(t){for(var r=e.slice(),n=0;n<r.length;n++)r[n].deleted||r[n].fn(t)},listen:function event(t){return e.push(new ListItem(t)),function removeListener(){for(var r=0;r<e.length;r++)if(e[r].fn===t){e[r].deleted=!0,e.splice(r,1);break}}}}}},function(e,t,r){var n=r(376);e.exports=function createStore(){var e={};return function(t){if(("object"!==typeof t||null===t)&&"function"!==typeof t)throw new Error("Weakmap-shim: Key must be object");var r=t.valueOf(e);return r&&r.identity===e?r:n(t,e)}}},function(e,t){e.exports=function hiddenStore(e,t){var r={identity:t},n=e.valueOf;return Object.defineProperty(e,"valueOf",{value:function value(e){return e!==t?n.apply(this,arguments):r},writable:!0}),r}},function(e,t,r){"use strict";var n=r(75);function forEach(e,t){return Object.keys(e()).forEach(t)}e.exports=function createHashListener(e){return function listenToHash(t,r){var i=n(t);function listenKey(n){e(t[n],r)}forEach(t,listenKey),t((function onChange(){forEach(t,(function(e){i[e]!==t[e]&&listenKey(e)})),i=n(t)}))}}},function(e,t,r){"use strict";var n=r(75);e.exports=function createArrayListener(e){return function listenToArray(t,r){var i=n(t._list);t.forEach((function(t){e(t,r)})),t((function onChange(a){if(!t.getLength())return;a._diff.forEach((function(n){for(var a=n[0];a<n.length;a++)i[a]!==t.get(a)&&t.get(a)&&e(t.get(a),r)})),i=n(t._list)}))}}},function(e,t,r){"use strict";t.__esModule=!0;var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(171));t.default=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==("undefined"===typeof t?"undefined":(0,n.default)(t))&&"function"!==typeof t?e:t}},function(e,t,r){e.exports={default:r(381),__esModule:!0}},function(e,t,r){r(54),r(72),e.exports=r(122).f("iterator")},function(e,t,r){e.exports={default:r(383),__esModule:!0}},function(e,t,r){r(384),r(140),r(389),r(390),e.exports=r(20).Symbol},function(e,t,r){"use strict";var n=r(22),i=r(44),a=r(39),o=r(29),s=r(143),u=r(385).KEY,l=r(69),c=r(107),f=r(71),d=r(70),h=r(23),p=r(122),g=r(123),m=r(386),v=r(387),y=r(30),_=r(38),b=r(109),x=r(49),w=r(102),k=r(56),S=r(103),E=r(388),C=r(174),T=r(172),O=r(35),A=r(104),R=C.f,D=O.f,P=E.f,j=n.Symbol,M=n.JSON,F=M&&M.stringify,I=h("_hidden"),L=h("toPrimitive"),N={}.propertyIsEnumerable,B=c("symbol-registry"),U=c("symbols"),z=c("op-symbols"),q=Object.prototype,W="function"==typeof j&&!!T.f,G=n.QObject,H=!G||!G.prototype||!G.prototype.findChild,V=a&&l((function(){return 7!=S(D({},"a",{get:function get(){return D(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=R(q,t);n&&delete q[t],D(e,t,r),n&&e!==q&&D(q,t,n)}:D,Y=function wrap(e){var t=U[e]=S(j.prototype);return t._k=e,t},$=W&&"symbol"==typeof j.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof j},X=function defineProperty(e,t,r){return e===q&&X(z,t,r),y(e),t=w(t,!0),y(r),i(U,t)?(r.enumerable?(i(e,I)&&e[I][t]&&(e[I][t]=!1),r=S(r,{enumerable:k(0,!1)})):(i(e,I)||D(e,I,k(1,{})),e[I][t]=!0),V(e,t,r)):D(e,t,r)},K=function defineProperties(e,t){y(e);for(var r,n=m(t=x(t)),i=0,a=n.length;a>i;)X(e,r=n[i++],t[r]);return e},J=function propertyIsEnumerable(e){var t=N.call(this,e=w(e,!0));return!(this===q&&i(U,e)&&!i(z,e))&&(!(t||!i(this,e)||!i(U,e)||i(this,I)&&this[I][e])||t)},Q=function getOwnPropertyDescriptor(e,t){if(e=x(e),t=w(t,!0),e!==q||!i(U,t)||i(z,t)){var r=R(e,t);return!r||!i(U,t)||i(e,I)&&e[I][t]||(r.enumerable=!0),r}},Z=function getOwnPropertyNames(e){for(var t,r=P(x(e)),n=[],a=0;r.length>a;)i(U,t=r[a++])||t==I||t==u||n.push(t);return n},ee=function getOwnPropertySymbols(e){for(var t,r=e===q,n=P(r?z:x(e)),a=[],o=0;n.length>o;)!i(U,t=n[o++])||r&&!i(q,t)||a.push(U[t]);return a};W||(s((j=function Symbol(){if(this instanceof j)throw TypeError("Symbol is not a constructor!");var e=d(arguments.length>0?arguments[0]:void 0),t=function $set(t){this===q&&$set.call(z,t),i(this,I)&&i(this[I],e)&&(this[I][e]=!1),V(this,e,k(1,t))};return a&&H&&V(q,e,{configurable:!0,set:t}),Y(e)}).prototype,"toString",(function toString(){return this._k})),C.f=Q,O.f=X,r(173).f=E.f=Z,r(124).f=J,T.f=ee,a&&!r(55)&&s(q,"propertyIsEnumerable",J,!0),p.f=function(e){return Y(h(e))}),o(o.G+o.W+o.F*!W,{Symbol:j});for(var te="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),re=0;te.length>re;)h(te[re++]);for(var ne=A(h.store),ie=0;ne.length>ie;)g(ne[ie++]);o(o.S+o.F*!W,"Symbol",{for:function _for(e){return i(B,e+="")?B[e]:B[e]=j(e)},keyFor:function keyFor(e){if(!$(e))throw TypeError(e+" is not a symbol!");for(var t in B)if(B[t]===e)return t},useSetter:function useSetter(){H=!0},useSimple:function useSimple(){H=!1}}),o(o.S+o.F*!W,"Object",{create:function create(e,t){return void 0===t?S(e):K(S(e),t)},defineProperty:X,defineProperties:K,getOwnPropertyDescriptor:Q,getOwnPropertyNames:Z,getOwnPropertySymbols:ee});var ae=l((function(){T.f(1)}));o(o.S+o.F*ae,"Object",{getOwnPropertySymbols:function getOwnPropertySymbols(e){return T.f(b(e))}}),M&&o(o.S+o.F*(!W||l((function(){var e=j();return"[null]"!=F([e])||"{}"!=F({a:e})||"{}"!=F(Object(e))}))),"JSON",{stringify:function stringify(e){for(var t,r,n=[e],i=1;arguments.length>i;)n.push(arguments[i++]);if(r=t=n[1],(_(t)||void 0!==e)&&!$(e))return v(t)||(t=function replacer(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!$(t))return t}),n[1]=t,F.apply(M,n)}}),j.prototype[L]||r(43)(j.prototype,L,j.prototype.valueOf),f(j,"Symbol"),f(Math,"Math",!0),f(n.JSON,"JSON",!0)},function(e,t,r){var n=r(70)("meta"),i=r(38),a=r(44),o=r(35).f,s=0,u=Object.isExtensible||function(){return!0},l=!r(69)((function(){return u(Object.preventExtensions({}))})),c=function setMeta(e){o(e,n,{value:{i:"O"+ ++s,w:{}}})},f=e.exports={KEY:n,NEED:!1,fastKey:function fastKey(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!a(e,n)){if(!u(e))return"F";if(!t)return"E";c(e)}return e[n].i},getWeak:function getWeak(e,t){if(!a(e,n)){if(!u(e))return!0;if(!t)return!1;c(e)}return e[n].w},onFreeze:function onFreeze(e){return l&&f.NEED&&u(e)&&!a(e,n)&&c(e),e}}},function(e,t,r){var n=r(104),i=r(172),a=r(124);e.exports=function(e){var t=n(e),r=i.f;if(r)for(var o,s=r(e),u=a.f,l=0;s.length>l;)u.call(e,o=s[l++])&&t.push(o);return t}},function(e,t,r){var n=r(57);e.exports=Array.isArray||function isArray(e){return"Array"==n(e)}},function(e,t,r){var n=r(49),i=r(173).f,a={}.toString,o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function getOwnPropertyNames(e){return o&&"[object Window]"==a.call(e)?function getWindowNames(e){try{return i(e)}catch(t){return o.slice()}}(e):i(n(e))}},function(e,t,r){r(123)("asyncIterator")},function(e,t,r){r(123)("observable")},function(e,t,r){"use strict";t.__esModule=!0;var n=_interopRequireDefault(r(392)),i=_interopRequireDefault(r(396)),a=_interopRequireDefault(r(171));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+("undefined"===typeof t?"undefined":(0,a.default)(t)));e.prototype=(0,i.default)(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(n.default?(0,n.default)(e,t):e.__proto__=t)}},function(e,t,r){e.exports={default:r(393),__esModule:!0}},function(e,t,r){r(394),e.exports=r(20).Object.setPrototypeOf},function(e,t,r){var n=r(29);n(n.S,"Object",{setPrototypeOf:r(395).set})},function(e,t,r){var n=r(38),i=r(30),a=function check(e,t){if(i(e),!n(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,n){try{(n=r(47)(Function.call,r(174).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(i){t=!0}return function setPrototypeOf(e,r){return a(e,r),t?e.__proto__=r:n(e,r),e}}({},!1):void 0),check:a}},function(e,t,r){e.exports={default:r(397),__esModule:!0}},function(e,t,r){r(398);var n=r(20).Object;e.exports=function create(e,t){return n.create(e,t)}},function(e,t,r){var n=r(29);n(n.S,"Object",{create:r(103)})},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=_interopRequireDefault(r(164)),i=_interopRequireDefault(r(26)),a=_interopRequireDefault(r(27)),o=_interopRequireDefault(r(120)),s=_interopRequireDefault(r(166)),u=r(167),l=_interopRequireDefault(r(168)),c=r(169),f=_interopRequireDefault(r(121)),d=_interopRequireDefault(r(400)),h=r(86),p=_interopRequireDefault(r(170));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var g=(0,l.default)(),m=(0,l.default)(),v=(0,l.default)(),y=(0,l.default)(),_=function(){function Panda(e){(0,o.default)(this,Panda),this.onMessage=(0,c.partial)(g.listen,this),this.onError=(0,c.partial)(m.listen,this),this.onConnect=(0,c.partial)(v.listen,this),this.onDisconnect=(0,c.partial)(y.listen,this),this.device=e.device,this.device.onError((0,c.partial)(m.broadcast,this)),this.device.onConnect(this.connectHandler.bind(this)),this.device.onDisconnect(this.disconnectHandler.bind(this)),this.paused=!0,this.messageQueue=[],this.readLoop=this.readLoop.bind(this),this.flushMessageQueue=this.flushMessageQueue.bind(this)}return(0,s.default)(Panda,[{key:"isConnected",value:function isConnected(){return!!this.connected}},{key:"isPaused",value:function isPaused(){return!!this.paused}},{key:"connect",value:function(){var e=(0,a.default)(i.default.mark((function _callee(){var e;return i.default.wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:if(!this.isConnected()){t.next=2;break}return t.abrupt("return",this.connected);case 2:return t.next=4,this.device.connect();case 4:return t.next=6,this.getSerialNumber();case 6:return e=t.sent,this.connectHandler(e),t.abrupt("return",e);case 9:case"end":return t.stop()}}),_callee,this)})));return function connect(){return e.apply(this,arguments)}}()},{key:"disconnect",value:function(){var e=(0,a.default)(i.default.mark((function _callee2(){return i.default.wrap((function _callee2$(e){for(;;)switch(e.prev=e.next){case 0:if(this.isConnected()){e.next=2;break}return e.abrupt("return",!1);case 2:return e.abrupt("return",this.device.disconnect());case 3:case"end":return e.stop()}}),_callee2,this)})));return function disconnect(){return e.apply(this,arguments)}}()},{key:"start",value:function(){var e=(0,a.default)(i.default.mark((function _callee3(){return i.default.wrap((function _callee3$(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.connect();case 2:return e.abrupt("return",this.unpause());case 3:case"end":return e.stop()}}),_callee3,this)})));return function start(){return e.apply(this,arguments)}}()},{key:"pause",value:function(){var e=(0,a.default)(i.default.mark((function _callee4(){var e;return i.default.wrap((function _callee4$(t){for(;;)switch(t.prev=t.next){case 0:return e=this.isPaused(),this.paused=!0,t.abrupt("return",!e);case 3:case"end":return t.stop()}}),_callee4,this)})));return function pause(){return e.apply(this,arguments)}}()},{key:"resume",value:function(){var e=(0,a.default)(i.default.mark((function _callee5(){return i.default.wrap((function _callee5$(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.unpause());case 1:case"end":return e.stop()}}),_callee5,this)})));return function resume(){return e.apply(this,arguments)}}()},{key:"unpause",value:function(){var e=(0,a.default)(i.default.mark((function _callee6(){var e;return i.default.wrap((function _callee6$(t){for(;;)switch(t.prev=t.next){case 0:if(e=this.isPaused()){t.next=3;break}return t.abrupt("return",!1);case 3:return this.paused=!1,this.startReading(),t.abrupt("return",e);case 6:case"end":return t.stop()}}),_callee6,this)})));return function unpause(){return e.apply(this,arguments)}}()},{key:"getHealth",value:function(){var e=(0,a.default)(i.default.mark((function _callee7(){var e,t,r,n,a,o,s,u;return i.default.wrap((function _callee7$(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,this.vendorRequest("health",{request:210,value:0,index:0},13);case 2:return e=i.sent,t=e.readUInt32LE(0)/1e3,r=e.readUInt32LE(4)/1e3,n=1===e.readInt8(8),a=1===e.readInt8(9),o=1===e.readInt8(10),s=1===e.readInt8(11),u=1===e.readInt8(12),i.abrupt("return",{voltage:t,current:r,isStarted:n,controlsAreAllowed:a,isGasInterceptorDetector:o,isStartSignalDetected:s,isStartedAlt:u});case 11:case"end":return i.stop()}}),_callee7,this)})));return function getHealth(){return e.apply(this,arguments)}}()},{key:"getDeviceMetadata",value:function(){var e=(0,a.default)(i.default.mark((function _callee8(){var e,t,r;return i.default.wrap((function _callee8$(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.vendorRequest("getDeviceMetadata",{request:208,value:0,index:0},32);case 2:return e=n.sent,t=e.slice(0,16),r=e.slice(16,26),e.slice(28),n.abrupt("return",[t.toString(),r.toString()]);case 7:case"end":return n.stop()}}),_callee8,this)})));return function getDeviceMetadata(){return e.apply(this,arguments)}}()},{key:"getSerialNumber",value:function(){var e=(0,a.default)(i.default.mark((function _callee9(){var e,t,r;return i.default.wrap((function _callee9$(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,this.getDeviceMetadata();case 2:return e=i.sent,t=(0,n.default)(e,2),r=t[0],t[1],i.abrupt("return",r);case 7:case"end":return i.stop()}}),_callee9,this)})));return function getSerialNumber(){return e.apply(this,arguments)}}()},{key:"getSecret",value:function(){var e=(0,a.default)(i.default.mark((function _callee10(){var e,t,r;return i.default.wrap((function _callee10$(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,this.getDeviceMetadata();case 2:return e=i.sent,t=(0,n.default)(e,2),t[0],r=t[1],i.abrupt("return",r);case 7:case"end":return i.stop()}}),_callee10,this)})));return function getSecret(){return e.apply(this,arguments)}}()},{key:"getVersion",value:function(){var e=(0,a.default)(i.default.mark((function _callee11(){var e;return i.default.wrap((function _callee11$(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.vendorRequest("getVersion",{request:214,value:0,index:0},64);case 2:return e=t.sent,t.abrupt("return",e.toString());case 4:case"end":return t.stop()}}),_callee11,this)})));return function getVersion(){return e.apply(this,arguments)}}()},{key:"isGrey",value:function(){var e=(0,a.default)(i.default.mark((function _callee12(){var e;return i.default.wrap((function _callee12$(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.vendorRequest("isGrey",{request:193,value:0,index:0},64);case 2:return e=t.sent,t.abrupt("return",!(!e.length||1!==e[0]));case 4:case"end":return t.stop()}}),_callee12,this)})));return function isGrey(){return e.apply(this,arguments)}}()},{key:"setSafetyMode",value:function(){var e=(0,a.default)(i.default.mark((function _callee13(e){var t;return i.default.wrap((function _callee13$(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.vendorWrite("setSafetyMode",{request:220,value:e,index:0});case 2:return t=r.sent,r.abrupt("return",t.toString());case 4:case"end":return r.stop()}}),_callee13,this)})));return function setSafetyMode(t){return e.apply(this,arguments)}}()},{key:"vendorRequest",value:function(){var e=(0,a.default)(i.default.mark((function _callee14(e,t,r){var n;return i.default.wrap((function _callee14$(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,i.next=3,this.device.vendorRequest(t,r);case 3:return n=i.sent,i.abrupt("return",n.data);case 7:throw i.prev=7,i.t0=i.catch(0),m.broadcast(this,{event:"Panda."+e+" failed",error:i.t0}),i.t0;case 11:case"end":return i.stop()}}),_callee14,this,[[0,7]])})));return function vendorRequest(t,r,n){return e.apply(this,arguments)}}()},{key:"vendorWrite",value:function(){var t=(0,a.default)(i.default.mark((function _callee15(t,r,n){var a;return i.default.wrap((function _callee15$(i){for(;;)switch(i.prev=i.next){case 0:return n&&n.length||(n=e.from([])),i.prev=1,i.next=4,this.device.vendorWrite(r,n);case 4:return a=i.sent,i.abrupt("return",a.data);case 8:throw i.prev=8,i.t0=i.catch(1),m.broadcast(this,{event:"Panda."+t+" failed",error:i.t0}),i.t0;case 12:case"end":return i.stop()}}),_callee15,this,[[1,8]])})));return function vendorWrite(e,r,n){return t.apply(this,arguments)}}()},{key:"connectHandler",value:function connectHandler(e){this.connected=e,v.broadcast(this,e)}},{key:"disconnectHandler",value:function disconnectHandler(){var e=this.connected;this.connected=!1,this.paused=!0,y.broadcast(this,e)}},{key:"needsFlushMessageQueue",value:function needsFlushMessageQueue(){var e=this;if(this.needsFlush=!0,this.flushEvent)return this.flushEvent;var t=(0,d.default)(this.flushMessageQueue);return this.flushEvent=function(){d.default.cancel(t),e.flushEvent=!1},this.flushEvent}},{key:"flushMessageQueue",value:function flushMessageQueue(){if(this.flushEvent(),this.needsFlush&&this.messageQueue.length){var e=this.messageQueue;this.messageQueue=[],this.needsFlush=!1,g.broadcast(this,e)}}},{key:"startReading",value:function startReading(){return!!this.isReading||!this.isPaused()&&(this.isReading=!0,void this.readLoop())}},{key:"readLoop",value:function(){var e=(0,a.default)(i.default.mark((function _callee16(){var e,t,r,n;return i.default.wrap((function _callee16$(i){for(;;)switch(i.prev=i.next){case 0:if(!this.isPaused()){i.next=3;break}return this.isReading=!1,i.abrupt("return",!1);case 3:this.isReading=!0,e=0;case 5:if(!(e<5e3)){i.next=20;break}return i.next=8,this.device.nextMessage();case 8:if(t=i.sent,r=(0,f.default)()/1e3,(n=(0,u.unpackCAN)(t)).length){i.next=15;break}return i.next=14,(0,p.default)(1);case 14:return i.abrupt("continue",17);case 15:this.messageQueue.push({time:r,canMessages:n}),this.needsFlushMessageQueue();case 17:++e,i.next=5;break;case 20:this.needsFlushMessageQueue(),(0,h.timeout)(this.readLoop);case 22:case"end":return i.stop()}}),_callee16,this)})));return function readLoop(){return e.apply(this,arguments)}}()}]),Panda}();t.default=_}).call(this,r(21).Buffer)},function(e,t,r){(function(t){for(var n=r(121),i="undefined"===typeof window?t:window,a=["moz","webkit"],o="AnimationFrame",s=i["request"+o],u=i["cancel"+o]||i["cancelRequest"+o],l=0;!s&&l<a.length;l++)s=i[a[l]+"Request"+o],u=i[a[l]+"Cancel"+o]||i[a[l]+"CancelRequest"+o];if(!s||!u){var c=0,f=0,d=[];s=function raf(e){if(0===d.length){var t=n(),r=Math.max(0,1e3/60-(t-c));c=r+t,setTimeout((function(){var e=d.slice(0);d.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(c)}catch(r){setTimeout((function(){throw r}),0)}}),Math.round(r))}return d.push({handle:++f,callback:e,cancelled:!1}),f},u=function caf(e){for(var t=0;t<d.length;t++)d[t].handle===e&&(d[t].cancelled=!0)}}e.exports=function(e){return s.call(i,e)},e.exports.cancel=function(){u.apply(i,arguments)},e.exports.polyfill=function(e){e||(e=i),e.requestAnimationFrame=s,e.cancelAnimationFrame=u}}).call(this,r(18))},function(e,t,r){"use strict";e.exports=function assertFunction(e){if("function"!==typeof e)throw new TypeError("Expected function, got: "+e)}},function(e,t,r){t.UINT32=r(403),t.UINT64=r(404)},function(e,t,r){var n;!function(r){UINT32(Math.pow(36,5)),UINT32(Math.pow(16,7)),UINT32(Math.pow(10,9)),UINT32(Math.pow(2,30)),UINT32(36),UINT32(16),UINT32(10),UINT32(2);function UINT32(e,t){return this instanceof UINT32?(this._low=0,this._high=0,this.remainder=null,"undefined"==typeof t?fromNumber.call(this,e):"string"==typeof e?fromString.call(this,e,t):void fromBits.call(this,e,t)):new UINT32(e,t)}function fromBits(e,t){return this._low=0|e,this._high=0|t,this}function fromNumber(e){return this._low=65535&e,this._high=e>>>16,this}function fromString(e,t){var r=parseInt(e,t||10);return this._low=65535&r,this._high=r>>>16,this}UINT32.prototype.fromBits=fromBits,UINT32.prototype.fromNumber=fromNumber,UINT32.prototype.fromString=fromString,UINT32.prototype.toNumber=function(){return 65536*this._high+this._low},UINT32.prototype.toString=function(e){return this.toNumber().toString(e||10)},UINT32.prototype.add=function(e){var t=this._low+e._low,r=t>>>16;return r+=this._high+e._high,this._low=65535&t,this._high=65535&r,this},UINT32.prototype.subtract=function(e){return this.add(e.clone().negate())},UINT32.prototype.multiply=function(e){var t,r,n=this._high,i=this._low,a=e._high,o=e._low;return t=(r=i*o)>>>16,t+=n*o,t&=65535,t+=i*a,this._low=65535&r,this._high=65535&t,this},UINT32.prototype.div=function(e){if(0==e._low&&0==e._high)throw Error("division by zero");if(0==e._high&&1==e._low)return this.remainder=new UINT32(0),this;if(e.gt(this))return this.remainder=this.clone(),this._low=0,this._high=0,this;if(this.eq(e))return this.remainder=new UINT32(0),this._low=1,this._high=0,this;for(var t=e.clone(),r=-1;!this.lt(t);)t.shiftLeft(1,!0),r++;for(this.remainder=this.clone(),this._low=0,this._high=0;r>=0;r--)t.shiftRight(1),this.remainder.lt(t)||(this.remainder.subtract(t),r>=16?this._high|=1<<r-16:this._low|=1<<r);return this},UINT32.prototype.negate=function(){var e=1+(65535&~this._low);return this._low=65535&e,this._high=~this._high+(e>>>16)&65535,this},UINT32.prototype.equals=UINT32.prototype.eq=function(e){return this._low==e._low&&this._high==e._high},UINT32.prototype.greaterThan=UINT32.prototype.gt=function(e){return this._high>e._high||!(this._high<e._high)&&this._low>e._low},UINT32.prototype.lessThan=UINT32.prototype.lt=function(e){return this._high<e._high||!(this._high>e._high)&&this._low<e._low},UINT32.prototype.or=function(e){return this._low|=e._low,this._high|=e._high,this},UINT32.prototype.and=function(e){return this._low&=e._low,this._high&=e._high,this},UINT32.prototype.not=function(){return this._low=65535&~this._low,this._high=65535&~this._high,this},UINT32.prototype.xor=function(e){return this._low^=e._low,this._high^=e._high,this},UINT32.prototype.shiftRight=UINT32.prototype.shiftr=function(e){return e>16?(this._low=this._high>>e-16,this._high=0):16==e?(this._low=this._high,this._high=0):(this._low=this._low>>e|this._high<<16-e&65535,this._high>>=e),this},UINT32.prototype.shiftLeft=UINT32.prototype.shiftl=function(e,t){return e>16?(this._high=this._low<<e-16,this._low=0,t||(this._high&=65535)):16==e?(this._high=this._low,this._low=0):(this._high=this._high<<e|this._low>>16-e,this._low=this._low<<e&65535,t||(this._high&=65535)),this},UINT32.prototype.rotateLeft=UINT32.prototype.rotl=function(e){var t=this._high<<16|this._low;return t=t<<e|t>>>32-e,this._low=65535&t,this._high=t>>>16,this},UINT32.prototype.rotateRight=UINT32.prototype.rotr=function(e){var t=this._high<<16|this._low;return t=t>>>e|t<<32-e,this._low=65535&t,this._high=t>>>16,this},UINT32.prototype.clone=function(){return new UINT32(this._low,this._high)},void 0===(n=function(){return UINT32}.apply(t,[]))||(e.exports=n)}()},function(e,t,r){var n;!function(r){var i={16:UINT64(Math.pow(16,5)),10:UINT64(Math.pow(10,5)),2:UINT64(Math.pow(2,5))},a={16:UINT64(16),10:UINT64(10),2:UINT64(2)};function UINT64(e,t,r,n){return this instanceof UINT64?(this.remainder=null,"string"==typeof e?fromString.call(this,e,t):"undefined"==typeof t?fromNumber.call(this,e):void fromBits.apply(this,arguments)):new UINT64(e,t,r,n)}function fromBits(e,t,r,n){return"undefined"==typeof r?(this._a00=65535&e,this._a16=e>>>16,this._a32=65535&t,this._a48=t>>>16,this):(this._a00=0|e,this._a16=0|t,this._a32=0|r,this._a48=0|n,this)}function fromNumber(e){return this._a00=65535&e,this._a16=e>>>16,this._a32=0,this._a48=0,this}function fromString(e,t){t=t||10,this._a00=0,this._a16=0,this._a32=0,this._a48=0;for(var r=i[t]||new UINT64(Math.pow(t,5)),n=0,a=e.length;n<a;n+=5){var o=Math.min(5,a-n),s=parseInt(e.slice(n,n+o),t);this.multiply(o<5?new UINT64(Math.pow(t,o)):r).add(new UINT64(s))}return this}UINT64.prototype.fromBits=fromBits,UINT64.prototype.fromNumber=fromNumber,UINT64.prototype.fromString=fromString,UINT64.prototype.toNumber=function(){return 65536*this._a16+this._a00},UINT64.prototype.toString=function(e){var t=a[e=e||10]||new UINT64(e);if(!this.gt(t))return this.toNumber().toString(e);for(var r=this.clone(),n=new Array(64),i=63;i>=0&&(r.div(t),n[i]=r.remainder.toNumber().toString(e),r.gt(t));i--);return n[i-1]=r.toNumber().toString(e),n.join("")},UINT64.prototype.add=function(e){var t=this._a00+e._a00,r=t>>>16,n=(r+=this._a16+e._a16)>>>16,i=(n+=this._a32+e._a32)>>>16;return i+=this._a48+e._a48,this._a00=65535&t,this._a16=65535&r,this._a32=65535&n,this._a48=65535&i,this},UINT64.prototype.subtract=function(e){return this.add(e.clone().negate())},UINT64.prototype.multiply=function(e){var t=this._a00,r=this._a16,n=this._a32,i=this._a48,a=e._a00,o=e._a16,s=e._a32,u=t*a,l=u>>>16,c=(l+=t*o)>>>16;l&=65535,c+=(l+=r*a)>>>16;var f=(c+=t*s)>>>16;return c&=65535,f+=(c+=r*o)>>>16,c&=65535,f+=(c+=n*a)>>>16,f+=t*e._a48,f&=65535,f+=r*s,f&=65535,f+=n*o,f&=65535,f+=i*a,this._a00=65535&u,this._a16=65535&l,this._a32=65535&c,this._a48=65535&f,this},UINT64.prototype.div=function(e){if(0==e._a16&&0==e._a32&&0==e._a48){if(0==e._a00)throw Error("division by zero");if(1==e._a00)return this.remainder=new UINT64(0),this}if(e.gt(this))return this.remainder=this.clone(),this._a00=0,this._a16=0,this._a32=0,this._a48=0,this;if(this.eq(e))return this.remainder=new UINT64(0),this._a00=1,this._a16=0,this._a32=0,this._a48=0,this;for(var t=e.clone(),r=-1;!this.lt(t);)t.shiftLeft(1,!0),r++;for(this.remainder=this.clone(),this._a00=0,this._a16=0,this._a32=0,this._a48=0;r>=0;r--)t.shiftRight(1),this.remainder.lt(t)||(this.remainder.subtract(t),r>=48?this._a48|=1<<r-48:r>=32?this._a32|=1<<r-32:r>=16?this._a16|=1<<r-16:this._a00|=1<<r);return this},UINT64.prototype.negate=function(){var e=1+(65535&~this._a00);return this._a00=65535&e,e=(65535&~this._a16)+(e>>>16),this._a16=65535&e,e=(65535&~this._a32)+(e>>>16),this._a32=65535&e,this._a48=~this._a48+(e>>>16)&65535,this},UINT64.prototype.equals=UINT64.prototype.eq=function(e){return this._a48==e._a48&&this._a00==e._a00&&this._a32==e._a32&&this._a16==e._a16},UINT64.prototype.greaterThan=UINT64.prototype.gt=function(e){return this._a48>e._a48||!(this._a48<e._a48)&&(this._a32>e._a32||!(this._a32<e._a32)&&(this._a16>e._a16||!(this._a16<e._a16)&&this._a00>e._a00))},UINT64.prototype.lessThan=UINT64.prototype.lt=function(e){return this._a48<e._a48||!(this._a48>e._a48)&&(this._a32<e._a32||!(this._a32>e._a32)&&(this._a16<e._a16||!(this._a16>e._a16)&&this._a00<e._a00))},UINT64.prototype.or=function(e){return this._a00|=e._a00,this._a16|=e._a16,this._a32|=e._a32,this._a48|=e._a48,this},UINT64.prototype.and=function(e){return this._a00&=e._a00,this._a16&=e._a16,this._a32&=e._a32,this._a48&=e._a48,this},UINT64.prototype.xor=function(e){return this._a00^=e._a00,this._a16^=e._a16,this._a32^=e._a32,this._a48^=e._a48,this},UINT64.prototype.not=function(){return this._a00=65535&~this._a00,this._a16=65535&~this._a16,this._a32=65535&~this._a32,this._a48=65535&~this._a48,this},UINT64.prototype.shiftRight=UINT64.prototype.shiftr=function(e){return(e%=64)>=48?(this._a00=this._a48>>e-48,this._a16=0,this._a32=0,this._a48=0):e>=32?(e-=32,this._a00=65535&(this._a32>>e|this._a48<<16-e),this._a16=this._a48>>e&65535,this._a32=0,this._a48=0):e>=16?(e-=16,this._a00=65535&(this._a16>>e|this._a32<<16-e),this._a16=65535&(this._a32>>e|this._a48<<16-e),this._a32=this._a48>>e&65535,this._a48=0):(this._a00=65535&(this._a00>>e|this._a16<<16-e),this._a16=65535&(this._a16>>e|this._a32<<16-e),this._a32=65535&(this._a32>>e|this._a48<<16-e),this._a48=this._a48>>e&65535),this},UINT64.prototype.shiftLeft=UINT64.prototype.shiftl=function(e,t){return(e%=64)>=48?(this._a48=this._a00<<e-48,this._a32=0,this._a16=0,this._a00=0):e>=32?(e-=32,this._a48=this._a16<<e|this._a00>>16-e,this._a32=this._a00<<e&65535,this._a16=0,this._a00=0):e>=16?(e-=16,this._a48=this._a32<<e|this._a16>>16-e,this._a32=65535&(this._a16<<e|this._a00>>16-e),this._a16=this._a00<<e&65535,this._a00=0):(this._a48=this._a48<<e|this._a32>>16-e,this._a32=65535&(this._a32<<e|this._a16>>16-e),this._a16=65535&(this._a16<<e|this._a00>>16-e),this._a00=this._a00<<e&65535),t||(this._a48&=65535),this},UINT64.prototype.rotateLeft=UINT64.prototype.rotl=function(e){if(0==(e%=64))return this;if(e>=32){var t=this._a00;if(this._a00=this._a32,this._a32=t,t=this._a48,this._a48=this._a16,this._a16=t,32==e)return this;e-=32}var r=this._a48<<16|this._a32,n=this._a16<<16|this._a00,i=r<<e|n>>>32-e,a=n<<e|r>>>32-e;return this._a00=65535&a,this._a16=a>>>16,this._a32=65535&i,this._a48=i>>>16,this},UINT64.prototype.rotateRight=UINT64.prototype.rotr=function(e){if(0==(e%=64))return this;if(e>=32){var t=this._a00;if(this._a00=this._a32,this._a32=t,t=this._a48,this._a48=this._a16,this._a16=t,32==e)return this;e-=32}var r=this._a48<<16|this._a32,n=this._a16<<16|this._a00,i=r>>>e|n<<32-e,a=n>>>e|r<<32-e;return this._a00=65535&a,this._a16=a>>>16,this._a32=65535&i,this._a48=i>>>16,this},UINT64.prototype.clone=function(){return new UINT64(this._a00,this._a16,this._a32,this._a48)},void 0===(n=function(){return UINT64}.apply(t,[]))||(e.exports=n)}()},function(e,t,r){var n,i,a;i=[e,r(406)],void 0===(a="function"===typeof(n=function(e,t){"use strict";var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(t),n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&defineProperties(e.prototype,t),r&&defineProperties(e,r),e}}(),a=function(){function ClipboardAction(e){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,ClipboardAction),this.resolveOptions(e),this.initSelection()}return i(ClipboardAction,[{key:"resolveOptions",value:function resolveOptions(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action=e.action,this.container=e.container,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""}},{key:"initSelection",value:function initSelection(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function selectFake(){var e=this,t="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[t?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,r.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function removeFake(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function selectTarget(){this.selectedText=(0,r.default)(this.target),this.copyText()}},{key:"copyText",value:function copyText(){var e=void 0;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function handleResult(e){this.emitter.emit(e?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function clearSelection(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function destroy(){this.removeFake()}},{key:"action",set:function set(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function get(){return this._action}},{key:"target",set:function set(e){if(void 0!==e){if(!e||"object"!==("undefined"===typeof e?"undefined":n(e))||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:function get(){return this._target}}]),ClipboardAction}();e.exports=a})?n.apply(t,i):n)||(e.exports=a)},function(e,t){e.exports=function select(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var r=e.hasAttribute("readonly");r||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),r||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var n=window.getSelection(),i=document.createRange();i.selectNodeContents(e),n.removeAllRanges(),n.addRange(i),t=n.toString()}return t}},function(e,t){function E(){}E.prototype={on:function on(e,t,r){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:t,ctx:r}),this},once:function once(e,t,r){var n=this;function listener(){n.off(e,listener),t.apply(r,arguments)}return listener._=t,this.on(e,listener,r)},emit:function emit(e){for(var t=[].slice.call(arguments,1),r=((this.e||(this.e={}))[e]||[]).slice(),n=0,i=r.length;n<i;n++)r[n].fn.apply(r[n].ctx,t);return this},off:function off(e,t){var r=this.e||(this.e={}),n=r[e],i=[];if(n&&t)for(var a=0,o=n.length;a<o;a++)n[a].fn!==t&&n[a].fn._!==t&&i.push(n[a]);return i.length?r[e]=i:delete r[e],this}},e.exports=E,e.exports.TinyEmitter=E},function(e,t,r){var n=r(409),i=r(410);e.exports=function listen(e,t,r){if(!e&&!t&&!r)throw new Error("Missing required arguments");if(!n.string(t))throw new TypeError("Second argument must be a String");if(!n.fn(r))throw new TypeError("Third argument must be a Function");if(n.node(e))return function listenNode(e,t,r){return e.addEventListener(t,r),{destroy:function destroy(){e.removeEventListener(t,r)}}}(e,t,r);if(n.nodeList(e))return function listenNodeList(e,t,r){return Array.prototype.forEach.call(e,(function(e){e.addEventListener(t,r)})),{destroy:function destroy(){Array.prototype.forEach.call(e,(function(e){e.removeEventListener(t,r)}))}}}(e,t,r);if(n.string(e))return function listenSelector(e,t,r){return i(document.body,e,t,r)}(e,t,r);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},function(e,t){t.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var r=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===r||"[object HTMLCollection]"===r)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"===typeof e||e instanceof String},t.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},function(e,t,r){var n=r(411);function _delegate(e,t,r,n,i){var a=listener.apply(this,arguments);return e.addEventListener(r,a,i),{destroy:function destroy(){e.removeEventListener(r,a,i)}}}function listener(e,t,r,i){return function(r){r.delegateTarget=n(r.target,t),r.delegateTarget&&i.call(e,r)}}e.exports=function delegate(e,t,r,n,i){return"function"===typeof e.addEventListener?_delegate.apply(null,arguments):"function"===typeof r?_delegate.bind(null,document).apply(null,arguments):("string"===typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return _delegate(e,t,r,n,i)})))}},function(e,t){var r=9;if("undefined"!==typeof Element&&!Element.prototype.matches){var n=Element.prototype;n.matches=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector}e.exports=function closest(e,t){for(;e&&e.nodeType!==r;){if("function"===typeof e.matches&&e.matches(t))return e;e=e.parentNode}}},function(e,t,r){"use strict";var n=e.exports={};n.linearRegression=r(413),n.linearRegressionLine=r(414),n.standardDeviation=r(175),n.rSquared=r(415),n.mode=r(416),n.modeFast=r(417),n.modeSorted=r(179),n.min=r(180),n.max=r(181),n.minSorted=r(418),n.maxSorted=r(419),n.sum=r(177),n.sumSimple=r(420),n.product=r(421),n.quantile=r(126),n.quantileSorted=r(127),n.interquartileRange=n.iqr=r(423),n.medianAbsoluteDeviation=n.mad=r(424),n.chunk=r(425),n.sampleWithReplacement=r(426),n.shuffle=r(183),n.shuffleInPlace=r(184),n.sample=r(427),n.ckmeans=r(428),n.uniqueCountSorted=r(185),n.sumNthPowerDeviations=r(125),n.equalIntervalBreaks=r(429),n.sampleCovariance=r(186),n.sampleCorrelation=r(430),n.sampleVariance=r(128),n.sampleStandardDeviation=r(187),n.sampleSkewness=r(431),n.sampleKurtosis=r(432),n.permutationsHeap=r(433),n.combinations=r(434),n.combinationsReplacement=r(435),n.addToMean=r(436),n.combineMeans=r(188),n.combineVariances=r(437),n.geometricMean=r(438),n.harmonicMean=r(439),n.mean=n.average=r(40),n.median=r(182),n.medianSorted=r(440),n.subtractFromMean=r(441),n.rootMeanSquare=n.rms=r(442),n.variance=r(176),n.tTest=r(443),n.tTestTwoSample=r(444),n.BayesianClassifier=n.bayesian=r(445),n.PerceptronModel=n.perceptron=r(446),n.epsilon=r(78),n.factorial=r(447),n.bernoulliDistribution=r(448),n.binomialDistribution=r(449),n.poissonDistribution=r(450),n.chiSquaredGoodnessOfFit=r(451),n.zScore=r(453),n.cumulativeStdNormalProbability=r(454),n.standardNormalTable=r(189),n.errorFunction=n.erf=r(455),n.inverseErrorFunction=r(190),n.probit=r(456),n.bisect=r(457)},function(e,t,r){"use strict";e.exports=function linearRegression(e){var t,r,n=e.length;if(1===n)t=0,r=e[0][1];else{for(var i,a,o,s=0,u=0,l=0,c=0,f=0;f<n;f++)s+=a=(i=e[f])[0],u+=o=i[1],l+=a*a,c+=a*o;r=u/n-(t=(n*c-s*u)/(n*l-s*s))*s/n}return{m:t,b:r}}},function(e,t,r){"use strict";e.exports=function linearRegressionLine(e){return function(t){return e.b+e.m*t}}},function(e,t,r){"use strict";e.exports=function rSquared(e,t){if(e.length<2)return 1;for(var r,n=0,i=0;i<e.length;i++)n+=e[i][1];r=n/e.length;for(var a=0,o=0;o<e.length;o++)a+=Math.pow(r-e[o][1],2);for(var s=0,u=0;u<e.length;u++)s+=Math.pow(e[u][1]-t(e[u][0]),2);return 1-s/a}},function(e,t,r){"use strict";var n=r(178),i=r(179);e.exports=function mode(e){return i(n(e))}},function(e,t,r){"use strict";e.exports=function modeFast(e){for(var t,r=new Map,n=0,i=0;i<e.length;i++){var a=r.get(e[i]);void 0===a?a=1:a++,a>n&&(t=e[i],n=a),r.set(e[i],a)}if(0===n)throw new Error("mode requires at last one data point");return t}},function(e,t,r){"use strict";e.exports=function minSorted(e){return e[0]}},function(e,t,r){"use strict";e.exports=function maxSorted(e){return e[e.length-1]}},function(e,t,r){"use strict";e.exports=function sumSimple(e){for(var t=0,r=0;r<e.length;r++)t+=e[r];return t}},function(e,t,r){"use strict";e.exports=function product(e){for(var t=1,r=0;r<e.length;r++)t*=e[r];return t}},function(e,t,r){"use strict";function swap(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}e.exports=function quickselect(e,t,r,n){r=r||0;n=n||e.length-1;for(;n>r;){if(n-r>600){var i=n-r+1,a=t-r+1,o=Math.log(i),s=.5*Math.exp(2*o/3),u=.5*Math.sqrt(o*s*(i-s)/i);a-i/2<0&&(u*=-1);var l=Math.max(r,Math.floor(t-a*s/i+u)),c=Math.min(n,Math.floor(t+(i-a)*s/i+u));quickselect(e,t,l,c)}var f=e[t],d=r,h=n;for(swap(e,r,t),e[n]>f&&swap(e,r,n);d<h;){for(swap(e,d,h),d++,h--;e[d]<f;)d++;for(;e[h]>f;)h--}e[r]===f?swap(e,r,h):swap(e,++h,n),h<=t&&(r=h+1),t<=h&&(n=h-1)}}},function(e,t,r){"use strict";var n=r(126);e.exports=function interquartileRange(e){var t=n(e,.75),r=n(e,.25);if("number"===typeof t&&"number"===typeof r)return t-r}},function(e,t,r){"use strict";var n=r(182);e.exports=function medianAbsoluteDeviation(e){for(var t=n(e),r=[],i=0;i<e.length;i++)r.push(Math.abs(e[i]-t));return n(r)}},function(e,t,r){"use strict";e.exports=function chunk(e,t){var r=[];if(t<1)throw new Error("chunk size must be a positive number");if(Math.floor(t)!==t)throw new Error("chunk size must be an integer");for(var n=0;n<e.length;n+=t)r.push(e.slice(n,n+t));return r}},function(e,t,r){"use strict";e.exports=function sampleWithReplacement(e,t,r){if(0===e.length)return[];r=r||Math.random;for(var n=e.length,i=[],a=0;a<t;a++){var o=Math.floor(r()*n);i.push(e[o])}return i}},function(e,t,r){"use strict";var n=r(183);e.exports=function sample(e,t,r){return n(e,r).slice(0,t)}},function(e,t,r){"use strict";var n=r(185),i=r(178);function makeMatrix(e,t){for(var r=[],n=0;n<e;n++){for(var i=[],a=0;a<t;a++)i.push(0);r.push(i)}return r}function ssq(e,t,r,n){var i;if(e>0){var a=(r[t]-r[e-1])/(t-e+1);i=n[t]-n[e-1]-(t-e+1)*a*a}else i=n[t]-r[t]*r[t]/(t+1);return i<0?0:i}function fillMatrixColumn(e,t,r,n,i,a,o){if(!(e>t)){var s=Math.floor((e+t)/2);n[r][s]=n[r-1][s-1],i[r][s]=s;var u=r;e>r&&(u=Math.max(u,i[r][e-1]||0)),u=Math.max(u,i[r-1][s]||0);var l,c,f,d=s-1;t<n.length-1&&(d=Math.min(d,i[r][t+1]||0));for(var h=d;h>=u&&!((l=ssq(h,s,a,o))+n[r-1][u-1]>=n[r][s]);--h)(c=ssq(u,s,a,o)+n[r-1][u-1])<n[r][s]&&(n[r][s]=c,i[r][s]=u),u++,(f=l+n[r-1][h-1])<n[r][s]&&(n[r][s]=f,i[r][s]=h);fillMatrixColumn(e,s-1,r,n,i,a,o),fillMatrixColumn(s+1,t,r,n,i,a,o)}}e.exports=function ckmeans(e,t){if(t>e.length)throw new Error("cannot generate more classes than there are data values");var r=i(e);if(1===n(r))return[r];var a=makeMatrix(t,r.length),o=makeMatrix(t,r.length);!function fillMatrices(e,t,r){for(var n,i=t[0].length,a=e[Math.floor(i/2)],o=[],s=[],u=0;u<i;++u)n=e[u]-a,0===u?(o.push(n),s.push(n*n)):(o.push(o[u-1]+n),s.push(s[u-1]+n*n)),t[0][u]=ssq(0,u,o,s),r[0][u]=0;for(var l=1;l<t.length;++l)fillMatrixColumn(l<t.length-1?l:i-1,i-1,l,t,r,o,s)}(r,a,o);for(var s=[],u=o[0].length-1,l=o.length-1;l>=0;l--){var c=o[l][u];s[l]=r.slice(c,u+1),l>0&&(u=c-1)}return s}},function(e,t,r){"use strict";var n=r(181),i=r(180);e.exports=function equalIntervalBreaks(e,t){if(e.length<2)return e;for(var r=i(e),a=n(e),o=[r],s=(a-r)/t,u=1;u<t;u++)o.push(o[0]+s*u);return o.push(a),o}},function(e,t,r){"use strict";var n=r(186),i=r(187);e.exports=function sampleCorrelation(e,t){return n(e,t)/i(e)/i(t)}},function(e,t,r){"use strict";var n=r(40);e.exports=function sampleSkewness(e){if(e.length<3)throw new Error("sampleSkewness requires at least three data points");for(var t,r=n(e),i=0,a=0,o=0;o<e.length;o++)i+=(t=e[o]-r)*t,a+=t*t*t;var s=e.length-1,u=Math.sqrt(i/s),l=e.length;return l*a/((l-1)*(l-2)*Math.pow(u,3))}},function(e,t,r){"use strict";var n=r(40);e.exports=function sampleKurtosis(e){var t=e.length;if(t<4)throw new Error("sampleKurtosis requires at least four data points");for(var r,i=n(e),a=0,o=0,s=0;s<t;s++)a+=(r=e[s]-i)*r,o+=r*r*r*r;return(t-1)/((t-2)*(t-3))*(t*(t+1)*o/(a*a)-3*(t-1))}},function(e,t,r){"use strict";e.exports=function permutationsHeap(e){for(var t=new Array(e.length),r=[e.slice()],n=0;n<e.length;n++)t[n]=0;for(n=0;n<e.length;)if(t[n]<n){var i=0;n%2!==0&&(i=t[n]);var a=e[i];e[i]=e[n],e[n]=a,r.push(e.slice()),t[n]++,n=0}else t[n]=0,n++;return r}},function(e,t,r){"use strict";e.exports=function combinations(e,t){var r,n,i,a,o=[];for(r=0;r<e.length;r++)if(1===t)o.push([e[r]]);else for(i=combinations(e.slice(r+1,e.length),t-1),n=0;n<i.length;n++)(a=i[n]).unshift(e[r]),o.push(a);return o}},function(e,t,r){"use strict";e.exports=function combinationsReplacement(e,t){for(var r=[],n=0;n<e.length;n++)if(1===t)r.push([e[n]]);else for(var i=combinationsReplacement(e.slice(n,e.length),t-1),a=0;a<i.length;a++)r.push([e[n]].concat(i[a]));return r}},function(e,t,r){"use strict";e.exports=function addToMean(e,t,r){return e+(r-e)/(t+1)}},function(e,t,r){"use strict";var n=r(188);e.exports=function combineVariances(e,t,r,i,a,o){var s=n(t,r,a,o);return(r*(e+Math.pow(t-s,2))+o*(i+Math.pow(a-s,2)))/(r+o)}},function(e,t,r){"use strict";e.exports=function geometricMean(e){if(0===e.length)throw new Error("geometricMean requires at least one data point");for(var t=1,r=0;r<e.length;r++){if(e[r]<=0)throw new Error("geometricMean requires only positive numbers as input");t*=e[r]}return Math.pow(t,1/e.length)}},function(e,t,r){"use strict";e.exports=function harmonicMean(e){if(0===e.length)throw new Error("harmonicMean requires at least one data point");for(var t=0,r=0;r<e.length;r++){if(e[r]<=0)throw new Error("harmonicMean requires only positive numbers as input");t+=1/e[r]}return e.length/t}},function(e,t,r){"use strict";var n=r(127);e.exports=function medianSorted(e){return n(e,.5)}},function(e,t,r){"use strict";e.exports=function subtractFromMean(e,t,r){return(e*t-r)/(t-1)}},function(e,t,r){"use strict";e.exports=function rootMeanSquare(e){if(0===e.length)throw new Error("rootMeanSquare requires at least one data point");for(var t=0,r=0;r<e.length;r++)t+=Math.pow(e[r],2);return Math.sqrt(t/e.length)}},function(e,t,r){"use strict";var n=r(175),i=r(40);e.exports=function tTest(e,t){return(i(e)-t)/(n(e)/Math.sqrt(e.length))}},function(e,t,r){"use strict";var n=r(40),i=r(128);e.exports=function tTestTwoSample(e,t,r){var a=e.length,o=t.length;if(!a||!o)return null;r||(r=0);var s=n(e),u=n(t),l=i(e),c=i(t);if("number"===typeof s&&"number"===typeof u&&"number"===typeof l&&"number"===typeof c){var f=((a-1)*l+(o-1)*c)/(a+o-2);return(s-u-r)/Math.sqrt(f*(1/a+1/o))}}},function(e,t,r){"use strict";function BayesianClassifier(){this.totalCount=0,this.data={}}BayesianClassifier.prototype.train=function(e,t){for(var r in this.data[t]||(this.data[t]={}),e){var n=e[r];void 0===this.data[t][r]&&(this.data[t][r]={}),void 0===this.data[t][r][n]&&(this.data[t][r][n]=0),this.data[t][r][n]++}this.totalCount++},BayesianClassifier.prototype.score=function(e){var t,r={};for(var n in e){var i=e[n];for(t in this.data)r[t]={},this.data[t][n]?r[t][n+"_"+i]=(this.data[t][n][i]||0)/this.totalCount:r[t][n+"_"+i]=0}var a={};for(t in r)for(var o in a[t]=0,r[t])a[t]+=r[t][o];return a},e.exports=BayesianClassifier},function(e,t,r){"use strict";function PerceptronModel(){this.weights=[],this.bias=0}PerceptronModel.prototype.predict=function(e){if(e.length!==this.weights.length)return null;for(var t=0,r=0;r<this.weights.length;r++)t+=this.weights[r]*e[r];return(t+=this.bias)>0?1:0},PerceptronModel.prototype.train=function(e,t){if(0!==t&&1!==t)return null;e.length!==this.weights.length&&(this.weights=e,this.bias=1);var r=this.predict(e);if(r!==t){for(var n=t-r,i=0;i<this.weights.length;i++)this.weights[i]+=n*e[i];this.bias+=n}return this},e.exports=PerceptronModel},function(e,t,r){"use strict";e.exports=function factorial(e){if(e<0)throw new Error("factorial requires a non-negative value");if(Math.floor(e)!==e)throw new Error("factorial requires an integer input");for(var t=1,r=2;r<=e;r++)t*=r;return t}},function(e,t,r){"use strict";e.exports=function bernoulliDistribution(e){if(e<0||e>1)throw new Error("bernoulliDistribution requires probability to be between 0 and 1 inclusive");return[1-e,e]}},function(e,t,r){"use strict";var n=r(78);e.exports=function binomialDistribution(e,t){if(!(t<0||t>1||e<=0||e%1!==0)){var r=0,i=0,a=[],o=1;do{a[r]=o*Math.pow(t,r)*Math.pow(1-t,e-r),i+=a[r],o=o*(e-++r+1)/r}while(i<1-n);return a}}},function(e,t,r){"use strict";var n=r(78);e.exports=function poissonDistribution(e){if(!(e<=0)){var t=0,r=0,i=[],a=1;do{i[t]=Math.exp(-e)*Math.pow(e,t)/a,r+=i[t],a*=++t}while(r<1-n);return i}}},function(e,t,r){"use strict";var n=r(40),i=r(452);e.exports=function chiSquaredGoodnessOfFit(e,t,r){for(var a,o,s=0,u=t(n(e)),l=[],c=[],f=0;f<e.length;f++)void 0===l[e[f]]&&(l[e[f]]=0),l[e[f]]++;for(f=0;f<l.length;f++)void 0===l[f]&&(l[f]=0);for(o in u)o in l&&(c[+o]=u[o]*e.length);for(o=c.length-1;o>=0;o--)c[o]<3&&(c[o-1]+=c[o],c.pop(),l[o-1]+=l[o],l.pop());for(o=0;o<l.length;o++)s+=Math.pow(l[o]-c[o],2)/c[o];return a=l.length-1-1,i[a][r]<s}},function(e,t,r){"use strict";e.exports={1:{.995:0,.99:0,.975:0,.95:0,.9:.02,.5:.45,.1:2.71,.05:3.84,.025:5.02,.01:6.63,.005:7.88},2:{.995:.01,.99:.02,.975:.05,.95:.1,.9:.21,.5:1.39,.1:4.61,.05:5.99,.025:7.38,.01:9.21,.005:10.6},3:{.995:.07,.99:.11,.975:.22,.95:.35,.9:.58,.5:2.37,.1:6.25,.05:7.81,.025:9.35,.01:11.34,.005:12.84},4:{.995:.21,.99:.3,.975:.48,.95:.71,.9:1.06,.5:3.36,.1:7.78,.05:9.49,.025:11.14,.01:13.28,.005:14.86},5:{.995:.41,.99:.55,.975:.83,.95:1.15,.9:1.61,.5:4.35,.1:9.24,.05:11.07,.025:12.83,.01:15.09,.005:16.75},6:{.995:.68,.99:.87,.975:1.24,.95:1.64,.9:2.2,.5:5.35,.1:10.65,.05:12.59,.025:14.45,.01:16.81,.005:18.55},7:{.995:.99,.99:1.25,.975:1.69,.95:2.17,.9:2.83,.5:6.35,.1:12.02,.05:14.07,.025:16.01,.01:18.48,.005:20.28},8:{.995:1.34,.99:1.65,.975:2.18,.95:2.73,.9:3.49,.5:7.34,.1:13.36,.05:15.51,.025:17.53,.01:20.09,.005:21.96},9:{.995:1.73,.99:2.09,.975:2.7,.95:3.33,.9:4.17,.5:8.34,.1:14.68,.05:16.92,.025:19.02,.01:21.67,.005:23.59},10:{.995:2.16,.99:2.56,.975:3.25,.95:3.94,.9:4.87,.5:9.34,.1:15.99,.05:18.31,.025:20.48,.01:23.21,.005:25.19},11:{.995:2.6,.99:3.05,.975:3.82,.95:4.57,.9:5.58,.5:10.34,.1:17.28,.05:19.68,.025:21.92,.01:24.72,.005:26.76},12:{.995:3.07,.99:3.57,.975:4.4,.95:5.23,.9:6.3,.5:11.34,.1:18.55,.05:21.03,.025:23.34,.01:26.22,.005:28.3},13:{.995:3.57,.99:4.11,.975:5.01,.95:5.89,.9:7.04,.5:12.34,.1:19.81,.05:22.36,.025:24.74,.01:27.69,.005:29.82},14:{.995:4.07,.99:4.66,.975:5.63,.95:6.57,.9:7.79,.5:13.34,.1:21.06,.05:23.68,.025:26.12,.01:29.14,.005:31.32},15:{.995:4.6,.99:5.23,.975:6.27,.95:7.26,.9:8.55,.5:14.34,.1:22.31,.05:25,.025:27.49,.01:30.58,.005:32.8},16:{.995:5.14,.99:5.81,.975:6.91,.95:7.96,.9:9.31,.5:15.34,.1:23.54,.05:26.3,.025:28.85,.01:32,.005:34.27},17:{.995:5.7,.99:6.41,.975:7.56,.95:8.67,.9:10.09,.5:16.34,.1:24.77,.05:27.59,.025:30.19,.01:33.41,.005:35.72},18:{.995:6.26,.99:7.01,.975:8.23,.95:9.39,.9:10.87,.5:17.34,.1:25.99,.05:28.87,.025:31.53,.01:34.81,.005:37.16},19:{.995:6.84,.99:7.63,.975:8.91,.95:10.12,.9:11.65,.5:18.34,.1:27.2,.05:30.14,.025:32.85,.01:36.19,.005:38.58},20:{.995:7.43,.99:8.26,.975:9.59,.95:10.85,.9:12.44,.5:19.34,.1:28.41,.05:31.41,.025:34.17,.01:37.57,.005:40},21:{.995:8.03,.99:8.9,.975:10.28,.95:11.59,.9:13.24,.5:20.34,.1:29.62,.05:32.67,.025:35.48,.01:38.93,.005:41.4},22:{.995:8.64,.99:9.54,.975:10.98,.95:12.34,.9:14.04,.5:21.34,.1:30.81,.05:33.92,.025:36.78,.01:40.29,.005:42.8},23:{.995:9.26,.99:10.2,.975:11.69,.95:13.09,.9:14.85,.5:22.34,.1:32.01,.05:35.17,.025:38.08,.01:41.64,.005:44.18},24:{.995:9.89,.99:10.86,.975:12.4,.95:13.85,.9:15.66,.5:23.34,.1:33.2,.05:36.42,.025:39.36,.01:42.98,.005:45.56},25:{.995:10.52,.99:11.52,.975:13.12,.95:14.61,.9:16.47,.5:24.34,.1:34.28,.05:37.65,.025:40.65,.01:44.31,.005:46.93},26:{.995:11.16,.99:12.2,.975:13.84,.95:15.38,.9:17.29,.5:25.34,.1:35.56,.05:38.89,.025:41.92,.01:45.64,.005:48.29},27:{.995:11.81,.99:12.88,.975:14.57,.95:16.15,.9:18.11,.5:26.34,.1:36.74,.05:40.11,.025:43.19,.01:46.96,.005:49.65},28:{.995:12.46,.99:13.57,.975:15.31,.95:16.93,.9:18.94,.5:27.34,.1:37.92,.05:41.34,.025:44.46,.01:48.28,.005:50.99},29:{.995:13.12,.99:14.26,.975:16.05,.95:17.71,.9:19.77,.5:28.34,.1:39.09,.05:42.56,.025:45.72,.01:49.59,.005:52.34},30:{.995:13.79,.99:14.95,.975:16.79,.95:18.49,.9:20.6,.5:29.34,.1:40.26,.05:43.77,.025:46.98,.01:50.89,.005:53.67},40:{.995:20.71,.99:22.16,.975:24.43,.95:26.51,.9:29.05,.5:39.34,.1:51.81,.05:55.76,.025:59.34,.01:63.69,.005:66.77},50:{.995:27.99,.99:29.71,.975:32.36,.95:34.76,.9:37.69,.5:49.33,.1:63.17,.05:67.5,.025:71.42,.01:76.15,.005:79.49},60:{.995:35.53,.99:37.48,.975:40.48,.95:43.19,.9:46.46,.5:59.33,.1:74.4,.05:79.08,.025:83.3,.01:88.38,.005:91.95},70:{.995:43.28,.99:45.44,.975:48.76,.95:51.74,.9:55.33,.5:69.33,.1:85.53,.05:90.53,.025:95.02,.01:100.42,.005:104.22},80:{.995:51.17,.99:53.54,.975:57.15,.95:60.39,.9:64.28,.5:79.33,.1:96.58,.05:101.88,.025:106.63,.01:112.33,.005:116.32},90:{.995:59.2,.99:61.75,.975:65.65,.95:69.13,.9:73.29,.5:89.33,.1:107.57,.05:113.14,.025:118.14,.01:124.12,.005:128.3},100:{.995:67.33,.99:70.06,.975:74.22,.95:77.93,.9:82.36,.5:99.33,.1:118.5,.05:124.34,.025:129.56,.01:135.81,.005:140.17}}},function(e,t,r){"use strict";e.exports=function zScore(e,t,r){return(e-t)/r}},function(e,t,r){"use strict";var n=r(189);e.exports=function cumulativeStdNormalProbability(e){var t=Math.abs(e),r=Math.min(Math.round(100*t),n.length-1);return e>=0?n[r]:+(1-n[r]).toFixed(4)}},function(e,t,r){"use strict";e.exports=function errorFunction(e){var t=1/(1+.5*Math.abs(e)),r=t*Math.exp(-Math.pow(e,2)-1.26551223+1.00002368*t+.37409196*Math.pow(t,2)+.09678418*Math.pow(t,3)-.18628806*Math.pow(t,4)+.27886807*Math.pow(t,5)-1.13520398*Math.pow(t,6)+1.48851587*Math.pow(t,7)-.82215223*Math.pow(t,8)+.17087277*Math.pow(t,9));return e>=0?1-r:r-1}},function(e,t,r){"use strict";var n=r(78),i=r(190);e.exports=function probit(e){return 0===e?e=n:e>=1&&(e=1-n),Math.sqrt(2)*i(2*e-1)}},function(e,t,r){"use strict";var n=r(458);e.exports=function bisect(e,t,r,i,a){if("function"!==typeof e)throw new TypeError("func must be a function");for(var o=0;o<i;o++){var s=(t+r)/2;if(0===e(s)||Math.abs((r-t)/2)<a)return s;n(e(s))===n(e(t))?t=s:r=s}throw new Error("maximum number of iterations exceeded")}},function(e,t,r){"use strict";e.exports=function sign(e){if("number"===typeof e)return e<0?-1:0===e?0:1;throw new TypeError("not a number")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(129),i=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(193));t.default=(0,i.default)(!1,n.defaultSelectorHandlers),e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function createPrefixer(e){var t=e.prefixMap,r=e.plugins;return function prefixAll(e){for(var s in e){var u=e[s];if((0,o.default)(u))e[s]=prefixAll(u);else if(Array.isArray(u)){for(var l=[],c=0,f=u.length;c<f;++c){var d=(0,i.default)(r,s,u[c],e,t);(0,a.default)(l,d||u[c])}l.length>0&&(e[s]=l)}else{var h=(0,i.default)(r,s,u,e,t);h&&(e[s]=h),(0,n.default)(t,s,e)}}return e}};var n=_interopRequireDefault(r(461)),i=_interopRequireDefault(r(462)),a=_interopRequireDefault(r(463)),o=_interopRequireDefault(r(464));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function prefixProperty(e,t,r){if(e.hasOwnProperty(t))for(var i=e[t],a=0,o=i.length;a<o;++a)r[i[a]+(0,n.default)(t)]=r[t]};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(191));e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function prefixValue(e,t,r,n,i){for(var a=0,o=e.length;a<o;++a){var s=e[a](t,r,n,i);if(s)return s}},e.exports=t.default},function(e,t,r){"use strict";function addIfNew(e,t){-1===e.indexOf(t)&&e.push(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function addNewValuesOnly(e,t){if(Array.isArray(t))for(var r=0,n=t.length;r<n;++r)addIfNew(e,t[r]);else addIfNew(e,t)},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isObject(e){return e instanceof Object&&!Array.isArray(e)},e.exports=t.default},function(e,t,r){var n=r(466),i=r(467),a=r(468),o=r(469),s=r(470),u=r(471),l=r(472),c=r(473),f=r(474),d=r(475),h=r(476),p=r(477);e.exports={plugins:[n,i,a,o,s,u,l,c,f,d,h,p],prefixMap:{transform:["Webkit","ms"],transformOrigin:["Webkit","ms"],transformOriginX:["Webkit","ms"],transformOriginY:["Webkit","ms"],backfaceVisibility:["Webkit"],perspective:["Webkit"],perspectiveOrigin:["Webkit"],transformStyle:["Webkit"],transformOriginZ:["Webkit"],animation:["Webkit"],animationDelay:["Webkit"],animationDirection:["Webkit"],animationFillMode:["Webkit"],animationDuration:["Webkit"],animationIterationCount:["Webkit"],animationName:["Webkit"],animationPlayState:["Webkit"],animationTimingFunction:["Webkit"],appearance:["Webkit","Moz"],userSelect:["Webkit","Moz","ms"],fontKerning:["Webkit"],textEmphasisPosition:["Webkit"],textEmphasis:["Webkit"],textEmphasisStyle:["Webkit"],textEmphasisColor:["Webkit"],boxDecorationBreak:["Webkit"],clipPath:["Webkit"],maskImage:["Webkit"],maskMode:["Webkit"],maskRepeat:["Webkit"],maskPosition:["Webkit"],maskClip:["Webkit"],maskOrigin:["Webkit"],maskSize:["Webkit"],maskComposite:["Webkit"],mask:["Webkit"],maskBorderSource:["Webkit"],maskBorderMode:["Webkit"],maskBorderSlice:["Webkit"],maskBorderWidth:["Webkit"],maskBorderOutset:["Webkit"],maskBorderRepeat:["Webkit"],maskBorder:["Webkit"],maskType:["Webkit"],textDecorationStyle:["Webkit","Moz"],textDecorationSkip:["Webkit","Moz"],textDecorationLine:["Webkit","Moz"],textDecorationColor:["Webkit","Moz"],filter:["Webkit"],fontFeatureSettings:["Webkit","Moz"],breakAfter:["Webkit","Moz","ms"],breakBefore:["Webkit","Moz","ms"],breakInside:["Webkit","Moz","ms"],columnCount:["Webkit","Moz"],columnFill:["Webkit","Moz"],columnGap:["Webkit","Moz"],columnRule:["Webkit","Moz"],columnRuleColor:["Webkit","Moz"],columnRuleStyle:["Webkit","Moz"],columnRuleWidth:["Webkit","Moz"],columns:["Webkit","Moz"],columnSpan:["Webkit","Moz"],columnWidth:["Webkit","Moz"],flex:["Webkit","ms"],flexBasis:["Webkit"],flexDirection:["Webkit","ms"],flexGrow:["Webkit"],flexFlow:["Webkit","ms"],flexShrink:["Webkit"],flexWrap:["Webkit","ms"],alignContent:["Webkit"],alignItems:["Webkit"],alignSelf:["Webkit"],justifyContent:["Webkit"],order:["Webkit"],transitionDelay:["Webkit"],transitionDuration:["Webkit"],transitionProperty:["Webkit"],transitionTimingFunction:["Webkit"],backdropFilter:["Webkit"],scrollSnapType:["Webkit","ms"],scrollSnapPointsX:["Webkit","ms"],scrollSnapPointsY:["Webkit","ms"],scrollSnapDestination:["Webkit","ms"],scrollSnapCoordinate:["Webkit","ms"],shapeImageThreshold:["Webkit"],shapeImageMargin:["Webkit"],shapeImageOutside:["Webkit"],hyphens:["Webkit","Moz","ms"],flowInto:["Webkit","ms"],flowFrom:["Webkit","ms"],regionFragment:["Webkit","ms"],boxSizing:["Moz"],textAlignLast:["Moz"],tabSize:["Moz"],wrapFlow:["ms"],wrapThrough:["ms"],wrapMargin:["ms"],touchAction:["ms"],gridTemplateColumns:["ms"],gridTemplateRows:["ms"],gridTemplateAreas:["ms"],gridTemplate:["ms"],gridAutoColumns:["ms"],gridAutoRows:["ms"],gridAutoFlow:["ms"],grid:["ms"],gridRowStart:["ms"],gridColumnStart:["ms"],gridRowEnd:["ms"],gridRow:["ms"],gridColumn:["ms"],gridColumnEnd:["ms"],gridColumnGap:["ms"],gridRowGap:["ms"],gridArea:["ms"],gridGap:["ms"],textSizeAdjust:["Webkit","ms"],borderImage:["Webkit"],borderImageOutset:["Webkit"],borderImageRepeat:["Webkit"],borderImageSlice:["Webkit"],borderImageSource:["Webkit"],borderImageWidth:["Webkit"]}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function calc(e,t){if("string"===typeof t&&!(0,n.default)(t)&&t.indexOf("calc(")>-1)return i.map((function(e){return t.replace(/calc\(/g,e+"calc(")}))};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(50));var i=["-webkit-","-moz-",""];e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function crossFade(e,t){if("string"===typeof t&&!(0,n.default)(t)&&t.indexOf("cross-fade(")>-1)return i.map((function(e){return t.replace(/cross-fade\(/g,e+"cross-fade(")}))};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(50));var i=["-webkit-",""];e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function cursor(e,t){if("cursor"===e&&i.hasOwnProperty(t))return n.map((function(e){return e+t}))};var n=["-webkit-","-moz-",""],i={"zoom-in":!0,"zoom-out":!0,grab:!0,grabbing:!0};e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function filter(e,t){if("string"===typeof t&&!(0,n.default)(t)&&t.indexOf("filter(")>-1)return i.map((function(e){return t.replace(/filter\(/g,e+"filter(")}))};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(50));var i=["-webkit-",""];e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function flex(e,t){if("display"===e&&n.hasOwnProperty(t))return n[t]};var n={flex:["-webkit-box","-moz-box","-ms-flexbox","-webkit-flex","flex"],"inline-flex":["-webkit-inline-box","-moz-inline-box","-ms-inline-flexbox","-webkit-inline-flex","inline-flex"]};e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function flexboxIE(e,t,r){i.hasOwnProperty(e)&&(r[i[e]]=n[t]||t)};var n={"space-around":"distribute","space-between":"justify","flex-start":"start","flex-end":"end"},i={alignContent:"msFlexLinePack",alignSelf:"msFlexItemAlign",alignItems:"msFlexAlign",justifyContent:"msFlexPack",order:"msFlexOrder",flexGrow:"msFlexPositive",flexShrink:"msFlexNegative",flexBasis:"msFlexPreferredSize"};e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function flexboxOld(e,t,r){"flexDirection"===e&&"string"===typeof t&&(t.indexOf("column")>-1?r.WebkitBoxOrient="vertical":r.WebkitBoxOrient="horizontal",t.indexOf("reverse")>-1?r.WebkitBoxDirection="reverse":r.WebkitBoxDirection="normal");i.hasOwnProperty(e)&&(r[i[e]]=n[t]||t)};var n={"space-around":"justify","space-between":"justify","flex-start":"start","flex-end":"end","wrap-reverse":"multiple",wrap:"multiple"},i={alignItems:"WebkitBoxAlign",justifyContent:"WebkitBoxPack",flexWrap:"WebkitBoxLines"};e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function gradient(e,t){if("string"===typeof t&&!(0,n.default)(t)&&a.test(t))return i.map((function(e){return e+t}))};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(50));var i=["-webkit-","-moz-",""],a=/linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient/;e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function imageSet(e,t){if("string"===typeof t&&!(0,n.default)(t)&&t.indexOf("image-set(")>-1)return i.map((function(e){return t.replace(/image-set\(/g,e+"image-set(")}))};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(50));var i=["-webkit-",""];e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function position(e,t){if("position"===e&&"sticky"===t)return["-webkit-sticky","sticky"]},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function sizing(e,t){if(i.hasOwnProperty(e)&&a.hasOwnProperty(t))return n.map((function(e){return e+t}))};var n=["-webkit-","-moz-",""],i={maxHeight:!0,maxWidth:!0,width:!0,height:!0,columnWidth:!0,minWidth:!0,minHeight:!0},a={"min-content":!0,"max-content":!0,"fill-available":!0,"fit-content":!0,"contain-floats":!0};e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function transition(e,t,r,u){if("string"===typeof t&&o.hasOwnProperty(e)){var l=function prefixValue(e,t){if((0,i.default)(e))return e;for(var r=e.split(/,(?![^()]*(?:\([^()]*\))?\))/g),a=0,o=r.length;a<o;++a){var u=r[a],l=[u];for(var c in t){var f=(0,n.default)(c);if(u.indexOf(f)>-1&&"order"!==f)for(var d=t[c],h=0,p=d.length;h<p;++h)l.unshift(u.replace(f,s[d[h]]+f))}r[a]=l.join(",")}return r.join(",")}(t,u),c=l.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter((function(e){return!/-moz-|-ms-/.test(e)})).join(",");if(e.indexOf("Webkit")>-1)return c;var f=l.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter((function(e){return!/-webkit-|-ms-/.test(e)})).join(",");return e.indexOf("Moz")>-1?f:(r["Webkit"+(0,a.default)(e)]=c,r["Moz"+(0,a.default)(e)]=f,l)}};var n=_interopRequireDefault(r(478)),i=_interopRequireDefault(r(50)),a=_interopRequireDefault(r(191));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var o={transition:!0,transitionProperty:!0,WebkitTransition:!0,WebkitTransitionProperty:!0,MozTransition:!0,MozTransitionProperty:!0},s={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-"};e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function hyphenateProperty(e){return(0,n.default)(e)};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(479));e.exports=t.default},function(e,t,r){"use strict";r.r(t);var n=/[A-Z]/g,i=/^ms-/,a={};function toHyphenLower(e){return"-"+e.toLowerCase()}t.default=function hyphenateStyleName(e){if(a.hasOwnProperty(e))return a[e];var t=e.replace(n,toHyphenLower);return a[e]=i.test(t)?"-"+t:t}},function(e,t,r){"use strict";e.exports=function hash(e){for(var t=5381,r=e.length;r;)t=33*t^e.charCodeAt(--r);return t>>>0}},function(e,t,r){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var n=_interopRequireDefault(r(482)),i=_interopRequireDefault(r(192)),a=r(129),o=r(130),s=null,u={fontFamily:function fontFamily(e){return Array.isArray(e)?e.map(fontFamily).join(","):"object"===typeof e?(h(e.src,"@font-face",[e],!1),'"'+e.fontFamily+'"'):e},animationName:function animationName(e,t){if(Array.isArray(e))return e.map((function(e){return animationName(e,t)})).join(",");if("object"===typeof e){var r="keyframe_"+(0,o.hashObject)(e),n="@keyframes "+r+"{";return e instanceof i.default?e.forEach((function(e,r){n+=(0,a.generateCSS)(r,[e],t,u,!1)})):Object.keys(e).forEach((function(r){n+=(0,a.generateCSS)(r,[e[r]],t,u,!1)})),d(r,n+="}"),r}return e}},l={},c="",f=!1,d=function injectGeneratedCSSOnce(e,t){if(!l[e]){if(!f){if("undefined"===typeof document)throw new Error("Cannot automatically buffer without a document");f=!0,(0,n.default)(g)}c+=t,l[e]=!0}},h=function injectStyleOnce(e,t,r,n){var i=arguments.length<=4||void 0===arguments[4]?[]:arguments[4];if(!l[e]){var o=(0,a.generateCSS)(t,r,i,u,n);d(e,o)}};t.injectStyleOnce=h;t.reset=function reset(){c="",l={},f=!1,s=null};t.startBuffering=function startBuffering(){if(f)throw new Error("Cannot buffer while already buffering");f=!0};var p=function flushToString(){f=!1;var e=c;return c="",e};t.flushToString=p;var g=function flushToStyleTag(){var e=p();e.length>0&&function injectStyleTag(e){if(null==s&&null==(s=document.querySelector("style[data-aphrodite]"))){var t=document.head||document.getElementsByTagName("head")[0];(s=document.createElement("style")).type="text/css",s.setAttribute("data-aphrodite",""),t.appendChild(s)}s.styleSheet?s.styleSheet.cssText+=e:s.appendChild(document.createTextNode(e))}(e)};t.flushToStyleTag=g;t.getRenderedClassNames=function getRenderedClassNames(){return Object.keys(l)};t.addRenderedClassNames=function addRenderedClassNames(e){e.forEach((function(e){l[e]=!0}))};t.injectAndGetClassName=function injectAndGetClassName(e,t,r){var n={classNameBits:[],definitionBits:[]};if(function processStyleDefinitions(e,t){for(var r=0;r<e.length;r+=1)e[r]&&(Array.isArray(e[r])?processStyleDefinitions(e[r],t):(t.classNameBits.push(e[r]._name),t.definitionBits.push(e[r]._definition)))}(t,n),0===n.classNameBits.length)return"";var i=void 0;return i=1===n.classNameBits.length?"_"+n.classNameBits[0]:"_"+(0,o.hashString)(n.classNameBits.join())+function getStyleDefinitionsLengthHash(e){return(e.reduce((function(e,t){return e+(t?t._len:0)}),0)%36).toString(36)}(t),h(i,"."+i,n.definitionBits,e,r),i}},function(e,t,r){"use strict";var n=r(483),i=[],a=[],o=n.makeRequestCallFromTimer((function throwFirstError(){if(a.length)throw a.shift()}));function asap(e){var t;(t=i.length?i.pop():new RawTask).task=e,n(t)}function RawTask(){this.task=null}e.exports=asap,RawTask.prototype.call=function(){try{this.task.call()}catch(e){asap.onerror?asap.onerror(e):(a.push(e),o())}finally{this.task=null,i[i.length]=this}}},function(e,t,r){"use strict";(function(t){function rawAsap(e){n.length||(r(),!0),n[n.length]=e}e.exports=rawAsap;var r,n=[],i=0,a=1024;function flush(){for(;i<n.length;){var e=i;if(i+=1,n[e].call(),i>a){for(var t=0,r=n.length-i;t<r;t++)n[t]=n[t+i];n.length-=i,i=0}}n.length=0,i=0,!1}var o="undefined"!==typeof t?t:self,s=o.MutationObserver||o.WebKitMutationObserver;function makeRequestCallFromTimer(e){return function requestCall(){var t=setTimeout(handleTimer,0),r=setInterval(handleTimer,50);function handleTimer(){clearTimeout(t),clearInterval(r),e()}}}r="function"===typeof s?function makeRequestCallFromMutationObserver(e){var t=1,r=new s(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function requestCall(){t=-t,n.data=t}}(flush):makeRequestCallFromTimer(flush),rawAsap.requestFlush=r,rawAsap.makeRequestCallFromTimer=makeRequestCallFromTimer}).call(this,r(18))},function(e,t,r){"use strict";var n=r(485);function emptyFunction(){}function emptyFunctionWithReset(){}emptyFunctionWithReset.resetWarningCache=emptyFunction,e.exports=function(){function shim(e,t,r,i,a,o){if(o!==n){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function getShim(){return shim}shim.isRequired=shim;var e={array:shim,bool:shim,func:shim,number:shim,object:shim,string:shim,symbol:shim,any:shim,arrayOf:getShim,element:shim,elementType:shim,instanceOf:getShim,node:shim,objectOf:getShim,oneOf:getShim,oneOfType:getShim,shape:getShim,exact:getShim,checkPropTypes:emptyFunctionWithReset,resetWarningCache:emptyFunction};return e.PropTypes=e,e}},function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t){var r;"function"!==typeof(r=window.Element.prototype).matches&&(r.matches=r.msMatchesSelector||r.mozMatchesSelector||r.webkitMatchesSelector||function matches(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),r=0;t[r]&&t[r]!==this;)++r;return Boolean(t[r])}),"function"!==typeof r.closest&&(r.closest=function closest(e){for(var t=this;t&&1===t.nodeType;){if(t.matches(e))return t;t=t.parentNode}return null})},function(e,t,r){(function(e,n){var i;(function(){var a,o=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",u="Expected a function",l="__lodash_hash_undefined__",c=500,f="__lodash_placeholder__",d=1,h=2,p=4,g=1,m=2,v=1,y=2,_=4,b=8,x=16,w=32,k=64,S=128,E=256,C=512,T=30,O="...",A=800,R=16,D=1,P=2,j=1/0,M=9007199254740991,F=17976931348623157e292,I=NaN,L=4294967295,N=L-1,B=L>>>1,U=[["ary",S],["bind",v],["bindKey",y],["curry",b],["curryRight",x],["flip",C],["partial",w],["partialRight",k],["rearg",E]],z="[object Arguments]",q="[object Array]",W="[object AsyncFunction]",G="[object Boolean]",H="[object Date]",V="[object DOMException]",Y="[object Error]",$="[object Function]",X="[object GeneratorFunction]",K="[object Map]",J="[object Number]",Q="[object Null]",Z="[object Object]",ee="[object Proxy]",te="[object RegExp]",re="[object Set]",ne="[object String]",ie="[object Symbol]",ae="[object Undefined]",oe="[object WeakMap]",se="[object WeakSet]",ue="[object ArrayBuffer]",le="[object DataView]",ce="[object Float32Array]",fe="[object Float64Array]",de="[object Int8Array]",he="[object Int16Array]",pe="[object Int32Array]",ge="[object Uint8Array]",me="[object Uint8ClampedArray]",ve="[object Uint16Array]",ye="[object Uint32Array]",_e=/\b__p \+= '';/g,be=/\b(__p \+=) '' \+/g,xe=/(__e\(.*?\)|\b__t\)) \+\n'';/g,we=/&(?:amp|lt|gt|quot|#39);/g,ke=/[&<>"']/g,Se=RegExp(we.source),Ee=RegExp(ke.source),Ce=/<%-([\s\S]+?)%>/g,Te=/<%([\s\S]+?)%>/g,Oe=/<%=([\s\S]+?)%>/g,Ae=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Re=/^\w*$/,De=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pe=/[\\^$.*+?()[\]{}|]/g,je=RegExp(Pe.source),Me=/^\s+|\s+$/g,Fe=/^\s+/,Ie=/\s+$/,Le=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ne=/\{\n\/\* \[wrapped with (.+)\] \*/,Be=/,? & /,Ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ze=/\\(\\)?/g,qe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,We=/\w*$/,Ge=/^[-+]0x[0-9a-f]+$/i,He=/^0b[01]+$/i,Ve=/^\[object .+?Constructor\]$/,Ye=/^0o[0-7]+$/i,$e=/^(?:0|[1-9]\d*)$/,Xe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ke=/($^)/,Je=/['\n\r\u2028\u2029\\]/g,Qe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ze="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",et="[\\ud800-\\udfff]",tt="["+Ze+"]",rt="["+Qe+"]",nt="\\d+",it="[\\u2700-\\u27bf]",at="[a-z\\xdf-\\xf6\\xf8-\\xff]",ot="[^\\ud800-\\udfff"+Ze+nt+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",st="\\ud83c[\\udffb-\\udfff]",ut="[^\\ud800-\\udfff]",lt="(?:\\ud83c[\\udde6-\\uddff]){2}",ct="[\\ud800-\\udbff][\\udc00-\\udfff]",ft="[A-Z\\xc0-\\xd6\\xd8-\\xde]",dt="(?:"+at+"|"+ot+")",ht="(?:"+ft+"|"+ot+")",pt="(?:"+rt+"|"+st+")"+"?",gt="[\\ufe0e\\ufe0f]?"+pt+("(?:\\u200d(?:"+[ut,lt,ct].join("|")+")[\\ufe0e\\ufe0f]?"+pt+")*"),mt="(?:"+[it,lt,ct].join("|")+")"+gt,vt="(?:"+[ut+rt+"?",rt,lt,ct,et].join("|")+")",yt=RegExp("['\u2019]","g"),_t=RegExp(rt,"g"),bt=RegExp(st+"(?="+st+")|"+vt+gt,"g"),xt=RegExp([ft+"?"+at+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?="+[tt,ft,"$"].join("|")+")",ht+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?="+[tt,ft+dt,"$"].join("|")+")",ft+"?"+dt+"+(?:['\u2019](?:d|ll|m|re|s|t|ve))?",ft+"+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",nt,mt].join("|"),"g"),wt=RegExp("[\\u200d\\ud800-\\udfff"+Qe+"\\ufe0e\\ufe0f]"),kt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,St=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Et=-1,Ct={};Ct[ce]=Ct[fe]=Ct[de]=Ct[he]=Ct[pe]=Ct[ge]=Ct[me]=Ct[ve]=Ct[ye]=!0,Ct[z]=Ct[q]=Ct[ue]=Ct[G]=Ct[le]=Ct[H]=Ct[Y]=Ct[$]=Ct[K]=Ct[J]=Ct[Z]=Ct[te]=Ct[re]=Ct[ne]=Ct[oe]=!1;var Tt={};Tt[z]=Tt[q]=Tt[ue]=Tt[le]=Tt[G]=Tt[H]=Tt[ce]=Tt[fe]=Tt[de]=Tt[he]=Tt[pe]=Tt[K]=Tt[J]=Tt[Z]=Tt[te]=Tt[re]=Tt[ne]=Tt[ie]=Tt[ge]=Tt[me]=Tt[ve]=Tt[ye]=!0,Tt[Y]=Tt[$]=Tt[oe]=!1;var Ot={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},At=parseFloat,Rt=parseInt,Dt="object"==typeof e&&e&&e.Object===Object&&e,Pt="object"==typeof self&&self&&self.Object===Object&&self,jt=Dt||Pt||Function("return this")(),Mt=t&&!t.nodeType&&t,Ft=Mt&&"object"==typeof n&&n&&!n.nodeType&&n,It=Ft&&Ft.exports===Mt,Lt=It&&Dt.process,Nt=function(){try{var e=Ft&&Ft.require&&Ft.require("util").types;return e||Lt&&Lt.binding&&Lt.binding("util")}catch(t){}}(),Bt=Nt&&Nt.isArrayBuffer,Ut=Nt&&Nt.isDate,zt=Nt&&Nt.isMap,qt=Nt&&Nt.isRegExp,Wt=Nt&&Nt.isSet,Gt=Nt&&Nt.isTypedArray;function apply(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function arrayAggregator(e,t,r,n){for(var i=-1,a=null==e?0:e.length;++i<a;){var o=e[i];t(n,o,r(o),e)}return n}function arrayEach(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function arrayEachRight(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function arrayEvery(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}function arrayFilter(e,t){for(var r=-1,n=null==e?0:e.length,i=0,a=[];++r<n;){var o=e[r];t(o,r,e)&&(a[i++]=o)}return a}function arrayIncludes(e,t){return!!(null==e?0:e.length)&&baseIndexOf(e,t,0)>-1}function arrayIncludesWith(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}function arrayMap(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function arrayPush(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function arrayReduce(e,t,r,n){var i=-1,a=null==e?0:e.length;for(n&&a&&(r=e[++i]);++i<a;)r=t(r,e[i],i,e);return r}function arrayReduceRight(e,t,r,n){var i=null==e?0:e.length;for(n&&i&&(r=e[--i]);i--;)r=t(r,e[i],i,e);return r}function arraySome(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var Ht=baseProperty("length");function baseFindKey(e,t,r){var n;return r(e,(function(e,r,i){if(t(e,r,i))return n=r,!1})),n}function baseFindIndex(e,t,r,n){for(var i=e.length,a=r+(n?1:-1);n?a--:++a<i;)if(t(e[a],a,e))return a;return-1}function baseIndexOf(e,t,r){return t===t?function strictIndexOf(e,t,r){var n=r-1,i=e.length;for(;++n<i;)if(e[n]===t)return n;return-1}(e,t,r):baseFindIndex(e,baseIsNaN,r)}function baseIndexOfWith(e,t,r,n){for(var i=r-1,a=e.length;++i<a;)if(n(e[i],t))return i;return-1}function baseIsNaN(e){return e!==e}function baseMean(e,t){var r=null==e?0:e.length;return r?baseSum(e,t)/r:I}function baseProperty(e){return function(t){return null==t?a:t[e]}}function basePropertyOf(e){return function(t){return null==e?a:e[t]}}function baseReduce(e,t,r,n,i){return i(e,(function(e,i,a){r=n?(n=!1,e):t(r,e,i,a)})),r}function baseSum(e,t){for(var r,n=-1,i=e.length;++n<i;){var o=t(e[n]);o!==a&&(r=r===a?o:r+o)}return r}function baseTimes(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function baseUnary(e){return function(t){return e(t)}}function baseValues(e,t){return arrayMap(t,(function(t){return e[t]}))}function cacheHas(e,t){return e.has(t)}function charsStartIndex(e,t){for(var r=-1,n=e.length;++r<n&&baseIndexOf(t,e[r],0)>-1;);return r}function charsEndIndex(e,t){for(var r=e.length;r--&&baseIndexOf(t,e[r],0)>-1;);return r}var Vt=basePropertyOf({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),Yt=basePropertyOf({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function escapeStringChar(e){return"\\"+Ot[e]}function hasUnicode(e){return wt.test(e)}function mapToArray(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function overArg(e,t){return function(r){return e(t(r))}}function replaceHolders(e,t){for(var r=-1,n=e.length,i=0,a=[];++r<n;){var o=e[r];o!==t&&o!==f||(e[r]=f,a[i++]=r)}return a}function setToArray(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}function setToPairs(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=[e,e]})),r}function stringSize(e){return hasUnicode(e)?function unicodeSize(e){var t=bt.lastIndex=0;for(;bt.test(e);)++t;return t}(e):Ht(e)}function stringToArray(e){return hasUnicode(e)?function unicodeToArray(e){return e.match(bt)||[]}(e):function asciiToArray(e){return e.split("")}(e)}var $t=basePropertyOf({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var Xt=function runInContext(e){var t=(e=null==e?jt:Xt.defaults(jt.Object(),e,Xt.pick(jt,St))).Array,r=e.Date,n=e.Error,i=e.Function,Qe=e.Math,Ze=e.Object,et=e.RegExp,tt=e.String,rt=e.TypeError,nt=t.prototype,it=i.prototype,at=Ze.prototype,ot=e["__core-js_shared__"],st=it.toString,ut=at.hasOwnProperty,lt=0,ct=function(){var e=/[^.]+$/.exec(ot&&ot.keys&&ot.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),ft=at.toString,dt=st.call(Ze),ht=jt._,pt=et("^"+st.call(ut).replace(Pe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),gt=It?e.Buffer:a,mt=e.Symbol,vt=e.Uint8Array,bt=gt?gt.allocUnsafe:a,wt=overArg(Ze.getPrototypeOf,Ze),Ot=Ze.create,Dt=at.propertyIsEnumerable,Pt=nt.splice,Mt=mt?mt.isConcatSpreadable:a,Ft=mt?mt.iterator:a,Lt=mt?mt.toStringTag:a,Nt=function(){try{var e=getNative(Ze,"defineProperty");return e({},"",{}),e}catch(t){}}(),Ht=e.clearTimeout!==jt.clearTimeout&&e.clearTimeout,Kt=r&&r.now!==jt.Date.now&&r.now,Jt=e.setTimeout!==jt.setTimeout&&e.setTimeout,Qt=Qe.ceil,Zt=Qe.floor,er=Ze.getOwnPropertySymbols,tr=gt?gt.isBuffer:a,rr=e.isFinite,nr=nt.join,ir=overArg(Ze.keys,Ze),ar=Qe.max,or=Qe.min,sr=r.now,ur=e.parseInt,lr=Qe.random,cr=nt.reverse,fr=getNative(e,"DataView"),dr=getNative(e,"Map"),hr=getNative(e,"Promise"),pr=getNative(e,"Set"),gr=getNative(e,"WeakMap"),mr=getNative(Ze,"create"),vr=gr&&new gr,yr={},_r=toSource(fr),br=toSource(dr),xr=toSource(hr),wr=toSource(pr),kr=toSource(gr),Sr=mt?mt.prototype:a,Er=Sr?Sr.valueOf:a,Cr=Sr?Sr.toString:a;function lodash(e){if(isObjectLike(e)&&!Dn(e)&&!(e instanceof LazyWrapper)){if(e instanceof LodashWrapper)return e;if(ut.call(e,"__wrapped__"))return wrapperClone(e)}return new LodashWrapper(e)}var Tr=function(){function object(){}return function(e){if(!isObject(e))return{};if(Ot)return Ot(e);object.prototype=e;var t=new object;return object.prototype=a,t}}();function baseLodash(){}function LodashWrapper(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=a}function LazyWrapper(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=L,this.__views__=[]}function Hash(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ListCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function MapCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function SetCache(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new MapCache;++t<r;)this.add(e[t])}function Stack(e){var t=this.__data__=new ListCache(e);this.size=t.size}function arrayLikeKeys(e,t){var r=Dn(e),n=!r&&Rn(e),i=!r&&!n&&jn(e),a=!r&&!n&&!i&&Nn(e),o=r||n||i||a,s=o?baseTimes(e.length,tt):[],u=s.length;for(var l in e)!t&&!ut.call(e,l)||o&&("length"==l||i&&("offset"==l||"parent"==l)||a&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||isIndex(l,u))||s.push(l);return s}function arraySample(e){var t=e.length;return t?e[baseRandom(0,t-1)]:a}function arraySampleSize(e,t){return shuffleSelf(copyArray(e),baseClamp(t,0,e.length))}function arrayShuffle(e){return shuffleSelf(copyArray(e))}function assignMergeValue(e,t,r){(r===a||eq(e[t],r))&&(r!==a||t in e)||baseAssignValue(e,t,r)}function assignValue(e,t,r){var n=e[t];ut.call(e,t)&&eq(n,r)&&(r!==a||t in e)||baseAssignValue(e,t,r)}function assocIndexOf(e,t){for(var r=e.length;r--;)if(eq(e[r][0],t))return r;return-1}function baseAggregator(e,t,r,n){return Or(e,(function(e,i,a){t(n,e,r(e),a)})),n}function baseAssign(e,t){return e&&copyObject(t,keys(t),e)}function baseAssignValue(e,t,r){"__proto__"==t&&Nt?Nt(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function baseAt(e,r){for(var n=-1,i=r.length,o=t(i),s=null==e;++n<i;)o[n]=s?a:get(e,r[n]);return o}function baseClamp(e,t,r){return e===e&&(r!==a&&(e=e<=r?e:r),t!==a&&(e=e>=t?e:t)),e}function baseClone(e,t,r,n,i,o){var s,u=t&d,l=t&h,c=t&p;if(r&&(s=i?r(e,n,i,o):r(e)),s!==a)return s;if(!isObject(e))return e;var f=Dn(e);if(f){if(s=function initCloneArray(e){var t=e.length,r=new e.constructor(t);t&&"string"==typeof e[0]&&ut.call(e,"index")&&(r.index=e.index,r.input=e.input);return r}(e),!u)return copyArray(e,s)}else{var g=Ur(e),m=g==$||g==X;if(jn(e))return cloneBuffer(e,u);if(g==Z||g==z||m&&!i){if(s=l||m?{}:initCloneObject(e),!u)return l?function copySymbolsIn(e,t){return copyObject(e,Br(e),t)}(e,function baseAssignIn(e,t){return e&&copyObject(t,keysIn(t),e)}(s,e)):function copySymbols(e,t){return copyObject(e,Nr(e),t)}(e,baseAssign(s,e))}else{if(!Tt[g])return i?e:{};s=function initCloneByTag(e,t,r){var n=e.constructor;switch(t){case ue:return cloneArrayBuffer(e);case G:case H:return new n(+e);case le:return function cloneDataView(e,t){var r=t?cloneArrayBuffer(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case ce:case fe:case de:case he:case pe:case ge:case me:case ve:case ye:return cloneTypedArray(e,r);case K:return new n;case J:case ne:return new n(e);case te:return function cloneRegExp(e){var t=new e.constructor(e.source,We.exec(e));return t.lastIndex=e.lastIndex,t}(e);case re:return new n;case ie:return function cloneSymbol(e){return Er?Ze(Er.call(e)):{}}(e)}}(e,g,u)}}o||(o=new Stack);var v=o.get(e);if(v)return v;o.set(e,s),Ln(e)?e.forEach((function(n){s.add(baseClone(n,t,r,n,e,o))})):Fn(e)&&e.forEach((function(n,i){s.set(i,baseClone(n,t,r,i,e,o))}));var y=f?a:(c?l?getAllKeysIn:getAllKeys:l?keysIn:keys)(e);return arrayEach(y||e,(function(n,i){y&&(n=e[i=n]),assignValue(s,i,baseClone(n,t,r,i,e,o))})),s}function baseConformsTo(e,t,r){var n=r.length;if(null==e)return!n;for(e=Ze(e);n--;){var i=r[n],o=t[i],s=e[i];if(s===a&&!(i in e)||!o(s))return!1}return!0}function baseDelay(e,t,r){if("function"!=typeof e)throw new rt(u);return Wr((function(){e.apply(a,r)}),t)}function baseDifference(e,t,r,n){var i=-1,a=arrayIncludes,s=!0,u=e.length,l=[],c=t.length;if(!u)return l;r&&(t=arrayMap(t,baseUnary(r))),n?(a=arrayIncludesWith,s=!1):t.length>=o&&(a=cacheHas,s=!1,t=new SetCache(t));e:for(;++i<u;){var f=e[i],d=null==r?f:r(f);if(f=n||0!==f?f:0,s&&d===d){for(var h=c;h--;)if(t[h]===d)continue e;l.push(f)}else a(t,d,n)||l.push(f)}return l}lodash.templateSettings={escape:Ce,evaluate:Te,interpolate:Oe,variable:"",imports:{_:lodash}},lodash.prototype=baseLodash.prototype,lodash.prototype.constructor=lodash,LodashWrapper.prototype=Tr(baseLodash.prototype),LodashWrapper.prototype.constructor=LodashWrapper,LazyWrapper.prototype=Tr(baseLodash.prototype),LazyWrapper.prototype.constructor=LazyWrapper,Hash.prototype.clear=function hashClear(){this.__data__=mr?mr(null):{},this.size=0},Hash.prototype.delete=function hashDelete(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Hash.prototype.get=function hashGet(e){var t=this.__data__;if(mr){var r=t[e];return r===l?a:r}return ut.call(t,e)?t[e]:a},Hash.prototype.has=function hashHas(e){var t=this.__data__;return mr?t[e]!==a:ut.call(t,e)},Hash.prototype.set=function hashSet(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=mr&&t===a?l:t,this},ListCache.prototype.clear=function listCacheClear(){this.__data__=[],this.size=0},ListCache.prototype.delete=function listCacheDelete(e){var t=this.__data__,r=assocIndexOf(t,e);return!(r<0)&&(r==t.length-1?t.pop():Pt.call(t,r,1),--this.size,!0)},ListCache.prototype.get=function listCacheGet(e){var t=this.__data__,r=assocIndexOf(t,e);return r<0?a:t[r][1]},ListCache.prototype.has=function listCacheHas(e){return assocIndexOf(this.__data__,e)>-1},ListCache.prototype.set=function listCacheSet(e,t){var r=this.__data__,n=assocIndexOf(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},MapCache.prototype.clear=function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(dr||ListCache),string:new Hash}},MapCache.prototype.delete=function mapCacheDelete(e){var t=getMapData(this,e).delete(e);return this.size-=t?1:0,t},MapCache.prototype.get=function mapCacheGet(e){return getMapData(this,e).get(e)},MapCache.prototype.has=function mapCacheHas(e){return getMapData(this,e).has(e)},MapCache.prototype.set=function mapCacheSet(e,t){var r=getMapData(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},SetCache.prototype.add=SetCache.prototype.push=function setCacheAdd(e){return this.__data__.set(e,l),this},SetCache.prototype.has=function setCacheHas(e){return this.__data__.has(e)},Stack.prototype.clear=function stackClear(){this.__data__=new ListCache,this.size=0},Stack.prototype.delete=function stackDelete(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Stack.prototype.get=function stackGet(e){return this.__data__.get(e)},Stack.prototype.has=function stackHas(e){return this.__data__.has(e)},Stack.prototype.set=function stackSet(e,t){var r=this.__data__;if(r instanceof ListCache){var n=r.__data__;if(!dr||n.length<o-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new MapCache(n)}return r.set(e,t),this.size=r.size,this};var Or=createBaseEach(baseForOwn),Ar=createBaseEach(baseForOwnRight,!0);function baseEvery(e,t){var r=!0;return Or(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function baseExtremum(e,t,r){for(var n=-1,i=e.length;++n<i;){var o=e[n],s=t(o);if(null!=s&&(u===a?s===s&&!isSymbol(s):r(s,u)))var u=s,l=o}return l}function baseFilter(e,t){var r=[];return Or(e,(function(e,n,i){t(e,n,i)&&r.push(e)})),r}function baseFlatten(e,t,r,n,i){var a=-1,o=e.length;for(r||(r=isFlattenable),i||(i=[]);++a<o;){var s=e[a];t>0&&r(s)?t>1?baseFlatten(s,t-1,r,n,i):arrayPush(i,s):n||(i[i.length]=s)}return i}var Rr=createBaseFor(),Dr=createBaseFor(!0);function baseForOwn(e,t){return e&&Rr(e,t,keys)}function baseForOwnRight(e,t){return e&&Dr(e,t,keys)}function baseFunctions(e,t){return arrayFilter(t,(function(t){return isFunction(e[t])}))}function baseGet(e,t){for(var r=0,n=(t=castPath(t,e)).length;null!=e&&r<n;)e=e[toKey(t[r++])];return r&&r==n?e:a}function baseGetAllKeys(e,t,r){var n=t(e);return Dn(e)?n:arrayPush(n,r(e))}function baseGetTag(e){return null==e?e===a?ae:Q:Lt&&Lt in Ze(e)?function getRawTag(e){var t=ut.call(e,Lt),r=e[Lt];try{e[Lt]=a;var n=!0}catch(o){}var i=ft.call(e);n&&(t?e[Lt]=r:delete e[Lt]);return i}(e):function objectToString(e){return ft.call(e)}(e)}function baseGt(e,t){return e>t}function baseHas(e,t){return null!=e&&ut.call(e,t)}function baseHasIn(e,t){return null!=e&&t in Ze(e)}function baseIntersection(e,r,n){for(var i=n?arrayIncludesWith:arrayIncludes,o=e[0].length,s=e.length,u=s,l=t(s),c=1/0,f=[];u--;){var d=e[u];u&&r&&(d=arrayMap(d,baseUnary(r))),c=or(d.length,c),l[u]=!n&&(r||o>=120&&d.length>=120)?new SetCache(u&&d):a}d=e[0];var h=-1,p=l[0];e:for(;++h<o&&f.length<c;){var g=d[h],m=r?r(g):g;if(g=n||0!==g?g:0,!(p?cacheHas(p,m):i(f,m,n))){for(u=s;--u;){var v=l[u];if(!(v?cacheHas(v,m):i(e[u],m,n)))continue e}p&&p.push(m),f.push(g)}}return f}function baseInvoke(e,t,r){var n=null==(e=parent(e,t=castPath(t,e)))?e:e[toKey(last(t))];return null==n?a:apply(n,e,r)}function baseIsArguments(e){return isObjectLike(e)&&baseGetTag(e)==z}function baseIsEqual(e,t,r,n,i){return e===t||(null==e||null==t||!isObjectLike(e)&&!isObjectLike(t)?e!==e&&t!==t:function baseIsEqualDeep(e,t,r,n,i,o){var s=Dn(e),u=Dn(t),l=s?q:Ur(e),c=u?q:Ur(t),f=(l=l==z?Z:l)==Z,d=(c=c==z?Z:c)==Z,h=l==c;if(h&&jn(e)){if(!jn(t))return!1;s=!0,f=!1}if(h&&!f)return o||(o=new Stack),s||Nn(e)?equalArrays(e,t,r,n,i,o):function equalByTag(e,t,r,n,i,a,o){switch(r){case le:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case ue:return!(e.byteLength!=t.byteLength||!a(new vt(e),new vt(t)));case G:case H:case J:return eq(+e,+t);case Y:return e.name==t.name&&e.message==t.message;case te:case ne:return e==t+"";case K:var s=mapToArray;case re:var u=n&g;if(s||(s=setToArray),e.size!=t.size&&!u)return!1;var l=o.get(e);if(l)return l==t;n|=m,o.set(e,t);var c=equalArrays(s(e),s(t),n,i,a,o);return o.delete(e),c;case ie:if(Er)return Er.call(e)==Er.call(t)}return!1}(e,t,l,r,n,i,o);if(!(r&g)){var p=f&&ut.call(e,"__wrapped__"),v=d&&ut.call(t,"__wrapped__");if(p||v){var y=p?e.value():e,_=v?t.value():t;return o||(o=new Stack),i(y,_,r,n,o)}}if(!h)return!1;return o||(o=new Stack),function equalObjects(e,t,r,n,i,o){var s=r&g,u=getAllKeys(e),l=u.length,c=getAllKeys(t).length;if(l!=c&&!s)return!1;var f=l;for(;f--;){var d=u[f];if(!(s?d in t:ut.call(t,d)))return!1}var h=o.get(e);if(h&&o.get(t))return h==t;var p=!0;o.set(e,t),o.set(t,e);var m=s;for(;++f<l;){d=u[f];var v=e[d],y=t[d];if(n)var _=s?n(y,v,d,t,e,o):n(v,y,d,e,t,o);if(!(_===a?v===y||i(v,y,r,n,o):_)){p=!1;break}m||(m="constructor"==d)}if(p&&!m){var b=e.constructor,x=t.constructor;b!=x&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof x&&x instanceof x)&&(p=!1)}return o.delete(e),o.delete(t),p}(e,t,r,n,i,o)}(e,t,r,n,baseIsEqual,i))}function baseIsMatch(e,t,r,n){var i=r.length,o=i,s=!n;if(null==e)return!o;for(e=Ze(e);i--;){var u=r[i];if(s&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++i<o;){var l=(u=r[i])[0],c=e[l],f=u[1];if(s&&u[2]){if(c===a&&!(l in e))return!1}else{var d=new Stack;if(n)var h=n(c,f,l,e,t,d);if(!(h===a?baseIsEqual(f,c,g|m,n,d):h))return!1}}return!0}function baseIsNative(e){return!(!isObject(e)||function isMasked(e){return!!ct&&ct in e}(e))&&(isFunction(e)?pt:Ve).test(toSource(e))}function baseIteratee(e){return"function"==typeof e?e:null==e?identity:"object"==typeof e?Dn(e)?baseMatchesProperty(e[0],e[1]):baseMatches(e):property(e)}function baseKeys(e){if(!isPrototype(e))return ir(e);var t=[];for(var r in Ze(e))ut.call(e,r)&&"constructor"!=r&&t.push(r);return t}function baseKeysIn(e){if(!isObject(e))return function nativeKeysIn(e){var t=[];if(null!=e)for(var r in Ze(e))t.push(r);return t}(e);var t=isPrototype(e),r=[];for(var n in e)("constructor"!=n||!t&&ut.call(e,n))&&r.push(n);return r}function baseLt(e,t){return e<t}function baseMap(e,r){var n=-1,i=isArrayLike(e)?t(e.length):[];return Or(e,(function(e,t,a){i[++n]=r(e,t,a)})),i}function baseMatches(e){var t=getMatchData(e);return 1==t.length&&t[0][2]?matchesStrictComparable(t[0][0],t[0][1]):function(r){return r===e||baseIsMatch(r,e,t)}}function baseMatchesProperty(e,t){return isKey(e)&&isStrictComparable(t)?matchesStrictComparable(toKey(e),t):function(r){var n=get(r,e);return n===a&&n===t?hasIn(r,e):baseIsEqual(t,n,g|m)}}function baseMerge(e,t,r,n,i){e!==t&&Rr(t,(function(o,s){if(i||(i=new Stack),isObject(o))!function baseMergeDeep(e,t,r,n,i,o,s){var u=safeGet(e,r),l=safeGet(t,r),c=s.get(l);if(c)return void assignMergeValue(e,r,c);var f=o?o(u,l,r+"",e,t,s):a,d=f===a;if(d){var h=Dn(l),p=!h&&jn(l),g=!h&&!p&&Nn(l);f=l,h||p||g?Dn(u)?f=u:isArrayLikeObject(u)?f=copyArray(u):p?(d=!1,f=cloneBuffer(l,!0)):g?(d=!1,f=cloneTypedArray(l,!0)):f=[]:isPlainObject(l)||Rn(l)?(f=u,Rn(u)?f=toPlainObject(u):isObject(u)&&!isFunction(u)||(f=initCloneObject(l))):d=!1}d&&(s.set(l,f),i(f,l,n,o,s),s.delete(l));assignMergeValue(e,r,f)}(e,t,s,r,baseMerge,n,i);else{var u=n?n(safeGet(e,s),o,s+"",e,t,i):a;u===a&&(u=o),assignMergeValue(e,s,u)}}),keysIn)}function baseNth(e,t){var r=e.length;if(r)return isIndex(t+=t<0?r:0,r)?e[t]:a}function baseOrderBy(e,t,r){var n=-1;return t=arrayMap(t.length?t:[identity],baseUnary(getIteratee())),function baseSortBy(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}(baseMap(e,(function(e,r,i){return{criteria:arrayMap(t,(function(t){return t(e)})),index:++n,value:e}})),(function(e,t){return function compareMultiple(e,t,r){var n=-1,i=e.criteria,a=t.criteria,o=i.length,s=r.length;for(;++n<o;){var u=compareAscending(i[n],a[n]);if(u){if(n>=s)return u;var l=r[n];return u*("desc"==l?-1:1)}}return e.index-t.index}(e,t,r)}))}function basePickBy(e,t,r){for(var n=-1,i=t.length,a={};++n<i;){var o=t[n],s=baseGet(e,o);r(s,o)&&baseSet(a,castPath(o,e),s)}return a}function basePullAll(e,t,r,n){var i=n?baseIndexOfWith:baseIndexOf,a=-1,o=t.length,s=e;for(e===t&&(t=copyArray(t)),r&&(s=arrayMap(e,baseUnary(r)));++a<o;)for(var u=0,l=t[a],c=r?r(l):l;(u=i(s,c,u,n))>-1;)s!==e&&Pt.call(s,u,1),Pt.call(e,u,1);return e}function basePullAt(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==a){var a=i;isIndex(i)?Pt.call(e,i,1):baseUnset(e,i)}}return e}function baseRandom(e,t){return e+Zt(lr()*(t-e+1))}function baseRepeat(e,t){var r="";if(!e||t<1||t>M)return r;do{t%2&&(r+=e),(t=Zt(t/2))&&(e+=e)}while(t);return r}function baseRest(e,t){return Gr(overRest(e,t,identity),e+"")}function baseSample(e){return arraySample(values(e))}function baseSampleSize(e,t){var r=values(e);return shuffleSelf(r,baseClamp(t,0,r.length))}function baseSet(e,t,r,n){if(!isObject(e))return e;for(var i=-1,o=(t=castPath(t,e)).length,s=o-1,u=e;null!=u&&++i<o;){var l=toKey(t[i]),c=r;if(i!=s){var f=u[l];(c=n?n(f,l,u):a)===a&&(c=isObject(f)?f:isIndex(t[i+1])?[]:{})}assignValue(u,l,c),u=u[l]}return e}var Pr=vr?function(e,t){return vr.set(e,t),e}:identity,jr=Nt?function(e,t){return Nt(e,"toString",{configurable:!0,enumerable:!1,value:constant(t),writable:!0})}:identity;function baseShuffle(e){return shuffleSelf(values(e))}function baseSlice(e,r,n){var i=-1,a=e.length;r<0&&(r=-r>a?0:a+r),(n=n>a?a:n)<0&&(n+=a),a=r>n?0:n-r>>>0,r>>>=0;for(var o=t(a);++i<a;)o[i]=e[i+r];return o}function baseSome(e,t){var r;return Or(e,(function(e,n,i){return!(r=t(e,n,i))})),!!r}function baseSortedIndex(e,t,r){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t===t&&i<=B){for(;n<i;){var a=n+i>>>1,o=e[a];null!==o&&!isSymbol(o)&&(r?o<=t:o<t)?n=a+1:i=a}return i}return baseSortedIndexBy(e,t,identity,r)}function baseSortedIndexBy(e,t,r,n){t=r(t);for(var i=0,o=null==e?0:e.length,s=t!==t,u=null===t,l=isSymbol(t),c=t===a;i<o;){var f=Zt((i+o)/2),d=r(e[f]),h=d!==a,p=null===d,g=d===d,m=isSymbol(d);if(s)var v=n||g;else v=c?g&&(n||h):u?g&&h&&(n||!p):l?g&&h&&!p&&(n||!m):!p&&!m&&(n?d<=t:d<t);v?i=f+1:o=f}return or(o,N)}function baseSortedUniq(e,t){for(var r=-1,n=e.length,i=0,a=[];++r<n;){var o=e[r],s=t?t(o):o;if(!r||!eq(s,u)){var u=s;a[i++]=0===o?0:o}}return a}function baseToNumber(e){return"number"==typeof e?e:isSymbol(e)?I:+e}function baseToString(e){if("string"==typeof e)return e;if(Dn(e))return arrayMap(e,baseToString)+"";if(isSymbol(e))return Cr?Cr.call(e):"";var t=e+"";return"0"==t&&1/e==-j?"-0":t}function baseUniq(e,t,r){var n=-1,i=arrayIncludes,a=e.length,s=!0,u=[],l=u;if(r)s=!1,i=arrayIncludesWith;else if(a>=o){var c=t?null:Ir(e);if(c)return setToArray(c);s=!1,i=cacheHas,l=new SetCache}else l=t?[]:u;e:for(;++n<a;){var f=e[n],d=t?t(f):f;if(f=r||0!==f?f:0,s&&d===d){for(var h=l.length;h--;)if(l[h]===d)continue e;t&&l.push(d),u.push(f)}else i(l,d,r)||(l!==u&&l.push(d),u.push(f))}return u}function baseUnset(e,t){return null==(e=parent(e,t=castPath(t,e)))||delete e[toKey(last(t))]}function baseUpdate(e,t,r,n){return baseSet(e,t,r(baseGet(e,t)),n)}function baseWhile(e,t,r,n){for(var i=e.length,a=n?i:-1;(n?a--:++a<i)&&t(e[a],a,e););return r?baseSlice(e,n?0:a,n?a+1:i):baseSlice(e,n?a+1:0,n?i:a)}function baseWrapperValue(e,t){var r=e;return r instanceof LazyWrapper&&(r=r.value()),arrayReduce(t,(function(e,t){return t.func.apply(t.thisArg,arrayPush([e],t.args))}),r)}function baseXor(e,r,n){var i=e.length;if(i<2)return i?baseUniq(e[0]):[];for(var a=-1,o=t(i);++a<i;)for(var s=e[a],u=-1;++u<i;)u!=a&&(o[a]=baseDifference(o[a]||s,e[u],r,n));return baseUniq(baseFlatten(o,1),r,n)}function baseZipObject(e,t,r){for(var n=-1,i=e.length,o=t.length,s={};++n<i;){var u=n<o?t[n]:a;r(s,e[n],u)}return s}function castArrayLikeObject(e){return isArrayLikeObject(e)?e:[]}function castFunction(e){return"function"==typeof e?e:identity}function castPath(e,t){return Dn(e)?e:isKey(e,t)?[e]:Hr(toString(e))}var Mr=baseRest;function castSlice(e,t,r){var n=e.length;return r=r===a?n:r,!t&&r>=n?e:baseSlice(e,t,r)}var Fr=Ht||function(e){return jt.clearTimeout(e)};function cloneBuffer(e,t){if(t)return e.slice();var r=e.length,n=bt?bt(r):new e.constructor(r);return e.copy(n),n}function cloneArrayBuffer(e){var t=new e.constructor(e.byteLength);return new vt(t).set(new vt(e)),t}function cloneTypedArray(e,t){var r=t?cloneArrayBuffer(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function compareAscending(e,t){if(e!==t){var r=e!==a,n=null===e,i=e===e,o=isSymbol(e),s=t!==a,u=null===t,l=t===t,c=isSymbol(t);if(!u&&!c&&!o&&e>t||o&&s&&l&&!u&&!c||n&&s&&l||!r&&l||!i)return 1;if(!n&&!o&&!c&&e<t||c&&r&&i&&!n&&!o||u&&r&&i||!s&&i||!l)return-1}return 0}function composeArgs(e,r,n,i){for(var a=-1,o=e.length,s=n.length,u=-1,l=r.length,c=ar(o-s,0),f=t(l+c),d=!i;++u<l;)f[u]=r[u];for(;++a<s;)(d||a<o)&&(f[n[a]]=e[a]);for(;c--;)f[u++]=e[a++];return f}function composeArgsRight(e,r,n,i){for(var a=-1,o=e.length,s=-1,u=n.length,l=-1,c=r.length,f=ar(o-u,0),d=t(f+c),h=!i;++a<f;)d[a]=e[a];for(var p=a;++l<c;)d[p+l]=r[l];for(;++s<u;)(h||a<o)&&(d[p+n[s]]=e[a++]);return d}function copyArray(e,r){var n=-1,i=e.length;for(r||(r=t(i));++n<i;)r[n]=e[n];return r}function copyObject(e,t,r,n){var i=!r;r||(r={});for(var o=-1,s=t.length;++o<s;){var u=t[o],l=n?n(r[u],e[u],u,r,e):a;l===a&&(l=e[u]),i?baseAssignValue(r,u,l):assignValue(r,u,l)}return r}function createAggregator(e,t){return function(r,n){var i=Dn(r)?arrayAggregator:baseAggregator,a=t?t():{};return i(r,e,getIteratee(n,2),a)}}function createAssigner(e){return baseRest((function(t,r){var n=-1,i=r.length,o=i>1?r[i-1]:a,s=i>2?r[2]:a;for(o=e.length>3&&"function"==typeof o?(i--,o):a,s&&isIterateeCall(r[0],r[1],s)&&(o=i<3?a:o,i=1),t=Ze(t);++n<i;){var u=r[n];u&&e(t,u,n,o)}return t}))}function createBaseEach(e,t){return function(r,n){if(null==r)return r;if(!isArrayLike(r))return e(r,n);for(var i=r.length,a=t?i:-1,o=Ze(r);(t?a--:++a<i)&&!1!==n(o[a],a,o););return r}}function createBaseFor(e){return function(t,r,n){for(var i=-1,a=Ze(t),o=n(t),s=o.length;s--;){var u=o[e?s:++i];if(!1===r(a[u],u,a))break}return t}}function createCaseFirst(e){return function(t){var r=hasUnicode(t=toString(t))?stringToArray(t):a,n=r?r[0]:t.charAt(0),i=r?castSlice(r,1).join(""):t.slice(1);return n[e]()+i}}function createCompounder(e){return function(t){return arrayReduce(words(deburr(t).replace(yt,"")),e,"")}}function createCtor(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Tr(e.prototype),n=e.apply(r,t);return isObject(n)?n:r}}function createFind(e){return function(t,r,n){var i=Ze(t);if(!isArrayLike(t)){var o=getIteratee(r,3);t=keys(t),r=function predicate(e){return o(i[e],e,i)}}var s=e(t,r,n);return s>-1?i[o?t[s]:s]:a}}function createFlow(e){return flatRest((function(t){var r=t.length,n=r,i=LodashWrapper.prototype.thru;for(e&&t.reverse();n--;){var o=t[n];if("function"!=typeof o)throw new rt(u);if(i&&!s&&"wrapper"==getFuncName(o))var s=new LodashWrapper([],!0)}for(n=s?n:r;++n<r;){var l=getFuncName(o=t[n]),c="wrapper"==l?Lr(o):a;s=c&&isLaziable(c[0])&&c[1]==(S|b|w|E)&&!c[4].length&&1==c[9]?s[getFuncName(c[0])].apply(s,c[3]):1==o.length&&isLaziable(o)?s[l]():s.thru(o)}return function(){var e=arguments,n=e[0];if(s&&1==e.length&&Dn(n))return s.plant(n).value();for(var i=0,a=r?t[i].apply(this,e):n;++i<r;)a=t[i].call(this,a);return a}}))}function createHybrid(e,r,n,i,o,s,u,l,c,f){var d=r&S,h=r&v,p=r&y,g=r&(b|x),m=r&C,_=p?a:createCtor(e);return function wrapper(){for(var v=arguments.length,y=t(v),b=v;b--;)y[b]=arguments[b];if(g)var x=getHolder(wrapper),w=function countHolders(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}(y,x);if(i&&(y=composeArgs(y,i,o,g)),s&&(y=composeArgsRight(y,s,u,g)),v-=w,g&&v<f){var k=replaceHolders(y,x);return createRecurry(e,r,createHybrid,wrapper.placeholder,n,y,k,l,c,f-v)}var S=h?n:this,E=p?S[e]:e;return v=y.length,l?y=function reorder(e,t){var r=e.length,n=or(t.length,r),i=copyArray(e);for(;n--;){var o=t[n];e[n]=isIndex(o,r)?i[o]:a}return e}(y,l):m&&v>1&&y.reverse(),d&&c<v&&(y.length=c),this&&this!==jt&&this instanceof wrapper&&(E=_||createCtor(E)),E.apply(S,y)}}function createInverter(e,t){return function(r,n){return function baseInverter(e,t,r,n){return baseForOwn(e,(function(e,i,a){t(n,r(e),i,a)})),n}(r,e,t(n),{})}}function createMathOperation(e,t){return function(r,n){var i;if(r===a&&n===a)return t;if(r!==a&&(i=r),n!==a){if(i===a)return n;"string"==typeof r||"string"==typeof n?(r=baseToString(r),n=baseToString(n)):(r=baseToNumber(r),n=baseToNumber(n)),i=e(r,n)}return i}}function createOver(e){return flatRest((function(t){return t=arrayMap(t,baseUnary(getIteratee())),baseRest((function(r){var n=this;return e(t,(function(e){return apply(e,n,r)}))}))}))}function createPadding(e,t){var r=(t=t===a?" ":baseToString(t)).length;if(r<2)return r?baseRepeat(t,e):t;var n=baseRepeat(t,Qt(e/stringSize(t)));return hasUnicode(t)?castSlice(stringToArray(n),0,e).join(""):n.slice(0,e)}function createRange(e){return function(r,n,i){return i&&"number"!=typeof i&&isIterateeCall(r,n,i)&&(n=i=a),r=toFinite(r),n===a?(n=r,r=0):n=toFinite(n),function baseRange(e,r,n,i){for(var a=-1,o=ar(Qt((r-e)/(n||1)),0),s=t(o);o--;)s[i?o:++a]=e,e+=n;return s}(r,n,i=i===a?r<n?1:-1:toFinite(i),e)}}function createRelationalOperation(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=toNumber(t),r=toNumber(r)),e(t,r)}}function createRecurry(e,t,r,n,i,o,s,u,l,c){var f=t&b;t|=f?w:k,(t&=~(f?k:w))&_||(t&=~(v|y));var d=[e,t,i,f?o:a,f?s:a,f?a:o,f?a:s,u,l,c],h=r.apply(a,d);return isLaziable(e)&&qr(h,d),h.placeholder=n,setWrapToString(h,e,t)}function createRound(e){var t=Qe[e];return function(e,r){if(e=toNumber(e),(r=null==r?0:or(toInteger(r),292))&&rr(e)){var n=(toString(e)+"e").split("e");return+((n=(toString(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var Ir=pr&&1/setToArray(new pr([,-0]))[1]==j?function(e){return new pr(e)}:noop;function createToPairs(e){return function(t){var r=Ur(t);return r==K?mapToArray(t):r==re?setToPairs(t):function baseToPairs(e,t){return arrayMap(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function createWrap(e,r,n,i,o,s,l,c){var d=r&y;if(!d&&"function"!=typeof e)throw new rt(u);var h=i?i.length:0;if(h||(r&=~(w|k),i=o=a),l=l===a?l:ar(toInteger(l),0),c=c===a?c:toInteger(c),h-=o?o.length:0,r&k){var p=i,g=o;i=o=a}var m=d?a:Lr(e),C=[e,r,n,i,o,p,g,s,l,c];if(m&&function mergeData(e,t){var r=e[1],n=t[1],i=r|n,a=i<(v|y|S),o=n==S&&r==b||n==S&&r==E&&e[7].length<=t[8]||n==(S|E)&&t[7].length<=t[8]&&r==b;if(!a&&!o)return e;n&v&&(e[2]=t[2],i|=r&v?0:_);var s=t[3];if(s){var u=e[3];e[3]=u?composeArgs(u,s,t[4]):s,e[4]=u?replaceHolders(e[3],f):t[4]}(s=t[5])&&(u=e[5],e[5]=u?composeArgsRight(u,s,t[6]):s,e[6]=u?replaceHolders(e[5],f):t[6]);(s=t[7])&&(e[7]=s);n&S&&(e[8]=null==e[8]?t[8]:or(e[8],t[8]));null==e[9]&&(e[9]=t[9]);return e[0]=t[0],e[1]=i,e}(C,m),e=C[0],r=C[1],n=C[2],i=C[3],o=C[4],!(c=C[9]=C[9]===a?d?0:e.length:ar(C[9]-h,0))&&r&(b|x)&&(r&=~(b|x)),r&&r!=v)T=r==b||r==x?function createCurry(e,r,n){var i=createCtor(e);return function wrapper(){for(var o=arguments.length,s=t(o),u=o,l=getHolder(wrapper);u--;)s[u]=arguments[u];var c=o<3&&s[0]!==l&&s[o-1]!==l?[]:replaceHolders(s,l);return(o-=c.length)<n?createRecurry(e,r,createHybrid,wrapper.placeholder,a,s,c,a,a,n-o):apply(this&&this!==jt&&this instanceof wrapper?i:e,this,s)}}(e,r,c):r!=w&&r!=(v|w)||o.length?createHybrid.apply(a,C):function createPartial(e,r,n,i){var a=r&v,o=createCtor(e);return function wrapper(){for(var r=-1,s=arguments.length,u=-1,l=i.length,c=t(l+s),f=this&&this!==jt&&this instanceof wrapper?o:e;++u<l;)c[u]=i[u];for(;s--;)c[u++]=arguments[++r];return apply(f,a?n:this,c)}}(e,r,n,i);else var T=function createBind(e,t,r){var n=t&v,i=createCtor(e);return function wrapper(){return(this&&this!==jt&&this instanceof wrapper?i:e).apply(n?r:this,arguments)}}(e,r,n);return setWrapToString((m?Pr:qr)(T,C),e,r)}function customDefaultsAssignIn(e,t,r,n){return e===a||eq(e,at[r])&&!ut.call(n,r)?t:e}function customDefaultsMerge(e,t,r,n,i,o){return isObject(e)&&isObject(t)&&(o.set(t,e),baseMerge(e,t,a,customDefaultsMerge,o),o.delete(t)),e}function customOmitClone(e){return isPlainObject(e)?a:e}function equalArrays(e,t,r,n,i,o){var s=r&g,u=e.length,l=t.length;if(u!=l&&!(s&&l>u))return!1;var c=o.get(e);if(c&&o.get(t))return c==t;var f=-1,d=!0,h=r&m?new SetCache:a;for(o.set(e,t),o.set(t,e);++f<u;){var p=e[f],v=t[f];if(n)var y=s?n(v,p,f,t,e,o):n(p,v,f,e,t,o);if(y!==a){if(y)continue;d=!1;break}if(h){if(!arraySome(t,(function(e,t){if(!cacheHas(h,t)&&(p===e||i(p,e,r,n,o)))return h.push(t)}))){d=!1;break}}else if(p!==v&&!i(p,v,r,n,o)){d=!1;break}}return o.delete(e),o.delete(t),d}function flatRest(e){return Gr(overRest(e,a,flatten),e+"")}function getAllKeys(e){return baseGetAllKeys(e,keys,Nr)}function getAllKeysIn(e){return baseGetAllKeys(e,keysIn,Br)}var Lr=vr?function(e){return vr.get(e)}:noop;function getFuncName(e){for(var t=e.name+"",r=yr[t],n=ut.call(yr,t)?r.length:0;n--;){var i=r[n],a=i.func;if(null==a||a==e)return i.name}return t}function getHolder(e){return(ut.call(lodash,"placeholder")?lodash:e).placeholder}function getIteratee(){var e=lodash.iteratee||iteratee;return e=e===iteratee?baseIteratee:e,arguments.length?e(arguments[0],arguments[1]):e}function getMapData(e,t){var r=e.__data__;return function isKeyable(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?r["string"==typeof t?"string":"hash"]:r.map}function getMatchData(e){for(var t=keys(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,isStrictComparable(i)]}return t}function getNative(e,t){var r=function getValue(e,t){return null==e?a:e[t]}(e,t);return baseIsNative(r)?r:a}var Nr=er?function(e){return null==e?[]:(e=Ze(e),arrayFilter(er(e),(function(t){return Dt.call(e,t)})))}:stubArray,Br=er?function(e){for(var t=[];e;)arrayPush(t,Nr(e)),e=wt(e);return t}:stubArray,Ur=baseGetTag;function hasPath(e,t,r){for(var n=-1,i=(t=castPath(t,e)).length,a=!1;++n<i;){var o=toKey(t[n]);if(!(a=null!=e&&r(e,o)))break;e=e[o]}return a||++n!=i?a:!!(i=null==e?0:e.length)&&isLength(i)&&isIndex(o,i)&&(Dn(e)||Rn(e))}function initCloneObject(e){return"function"!=typeof e.constructor||isPrototype(e)?{}:Tr(wt(e))}function isFlattenable(e){return Dn(e)||Rn(e)||!!(Mt&&e&&e[Mt])}function isIndex(e,t){var r=typeof e;return!!(t=null==t?M:t)&&("number"==r||"symbol"!=r&&$e.test(e))&&e>-1&&e%1==0&&e<t}function isIterateeCall(e,t,r){if(!isObject(r))return!1;var n=typeof t;return!!("number"==n?isArrayLike(r)&&isIndex(t,r.length):"string"==n&&t in r)&&eq(r[t],e)}function isKey(e,t){if(Dn(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!isSymbol(e))||(Re.test(e)||!Ae.test(e)||null!=t&&e in Ze(t))}function isLaziable(e){var t=getFuncName(e),r=lodash[t];if("function"!=typeof r||!(t in LazyWrapper.prototype))return!1;if(e===r)return!0;var n=Lr(r);return!!n&&e===n[0]}(fr&&Ur(new fr(new ArrayBuffer(1)))!=le||dr&&Ur(new dr)!=K||hr&&"[object Promise]"!=Ur(hr.resolve())||pr&&Ur(new pr)!=re||gr&&Ur(new gr)!=oe)&&(Ur=function getTag(e){var t=baseGetTag(e),r=t==Z?e.constructor:a,n=r?toSource(r):"";if(n)switch(n){case _r:return le;case br:return K;case xr:return"[object Promise]";case wr:return re;case kr:return oe}return t});var zr=ot?isFunction:stubFalse;function isPrototype(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||at)}function isStrictComparable(e){return e===e&&!isObject(e)}function matchesStrictComparable(e,t){return function(r){return null!=r&&(r[e]===t&&(t!==a||e in Ze(r)))}}function overRest(e,r,n){return r=ar(r===a?e.length-1:r,0),function(){for(var i=arguments,a=-1,o=ar(i.length-r,0),s=t(o);++a<o;)s[a]=i[r+a];a=-1;for(var u=t(r+1);++a<r;)u[a]=i[a];return u[r]=n(s),apply(e,this,u)}}function parent(e,t){return t.length<2?e:baseGet(e,baseSlice(t,0,-1))}function safeGet(e,t){if(("constructor"!==t||"function"!==typeof e[t])&&"__proto__"!=t)return e[t]}var qr=shortOut(Pr),Wr=Jt||function(e,t){return jt.setTimeout(e,t)},Gr=shortOut(jr);function setWrapToString(e,t,r){var n=t+"";return Gr(e,function insertWrapDetails(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(Le,"{\n/* [wrapped with "+t+"] */\n")}(n,function updateWrapDetails(e,t){return arrayEach(U,(function(r){var n="_."+r[0];t&r[1]&&!arrayIncludes(e,n)&&e.push(n)})),e.sort()}(function getWrapDetails(e){var t=e.match(Ne);return t?t[1].split(Be):[]}(n),r)))}function shortOut(e){var t=0,r=0;return function(){var n=sr(),i=R-(n-r);if(r=n,i>0){if(++t>=A)return arguments[0]}else t=0;return e.apply(a,arguments)}}function shuffleSelf(e,t){var r=-1,n=e.length,i=n-1;for(t=t===a?n:t;++r<t;){var o=baseRandom(r,i),s=e[o];e[o]=e[r],e[r]=s}return e.length=t,e}var Hr=function memoizeCapped(e){var t=memoize(e,(function(e){return r.size===c&&r.clear(),e})),r=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(De,(function(e,r,n,i){t.push(n?i.replace(ze,"$1"):r||e)})),t}));function toKey(e){if("string"==typeof e||isSymbol(e))return e;var t=e+"";return"0"==t&&1/e==-j?"-0":t}function toSource(e){if(null!=e){try{return st.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function wrapperClone(e){if(e instanceof LazyWrapper)return e.clone();var t=new LodashWrapper(e.__wrapped__,e.__chain__);return t.__actions__=copyArray(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Vr=baseRest((function(e,t){return isArrayLikeObject(e)?baseDifference(e,baseFlatten(t,1,isArrayLikeObject,!0)):[]})),Yr=baseRest((function(e,t){var r=last(t);return isArrayLikeObject(r)&&(r=a),isArrayLikeObject(e)?baseDifference(e,baseFlatten(t,1,isArrayLikeObject,!0),getIteratee(r,2)):[]})),$r=baseRest((function(e,t){var r=last(t);return isArrayLikeObject(r)&&(r=a),isArrayLikeObject(e)?baseDifference(e,baseFlatten(t,1,isArrayLikeObject,!0),a,r):[]}));function findIndex(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:toInteger(r);return i<0&&(i=ar(n+i,0)),baseFindIndex(e,getIteratee(t,3),i)}function findLastIndex(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=n-1;return r!==a&&(i=toInteger(r),i=r<0?ar(n+i,0):or(i,n-1)),baseFindIndex(e,getIteratee(t,3),i,!0)}function flatten(e){return(null==e?0:e.length)?baseFlatten(e,1):[]}function head(e){return e&&e.length?e[0]:a}var Xr=baseRest((function(e){var t=arrayMap(e,castArrayLikeObject);return t.length&&t[0]===e[0]?baseIntersection(t):[]})),Kr=baseRest((function(e){var t=last(e),r=arrayMap(e,castArrayLikeObject);return t===last(r)?t=a:r.pop(),r.length&&r[0]===e[0]?baseIntersection(r,getIteratee(t,2)):[]})),Jr=baseRest((function(e){var t=last(e),r=arrayMap(e,castArrayLikeObject);return(t="function"==typeof t?t:a)&&r.pop(),r.length&&r[0]===e[0]?baseIntersection(r,a,t):[]}));function last(e){var t=null==e?0:e.length;return t?e[t-1]:a}var Qr=baseRest(pullAll);function pullAll(e,t){return e&&e.length&&t&&t.length?basePullAll(e,t):e}var Zr=flatRest((function(e,t){var r=null==e?0:e.length,n=baseAt(e,t);return basePullAt(e,arrayMap(t,(function(e){return isIndex(e,r)?+e:e})).sort(compareAscending)),n}));function reverse(e){return null==e?e:cr.call(e)}var en=baseRest((function(e){return baseUniq(baseFlatten(e,1,isArrayLikeObject,!0))})),tn=baseRest((function(e){var t=last(e);return isArrayLikeObject(t)&&(t=a),baseUniq(baseFlatten(e,1,isArrayLikeObject,!0),getIteratee(t,2))})),rn=baseRest((function(e){var t=last(e);return t="function"==typeof t?t:a,baseUniq(baseFlatten(e,1,isArrayLikeObject,!0),a,t)}));function unzip(e){if(!e||!e.length)return[];var t=0;return e=arrayFilter(e,(function(e){if(isArrayLikeObject(e))return t=ar(e.length,t),!0})),baseTimes(t,(function(t){return arrayMap(e,baseProperty(t))}))}function unzipWith(e,t){if(!e||!e.length)return[];var r=unzip(e);return null==t?r:arrayMap(r,(function(e){return apply(t,a,e)}))}var nn=baseRest((function(e,t){return isArrayLikeObject(e)?baseDifference(e,t):[]})),an=baseRest((function(e){return baseXor(arrayFilter(e,isArrayLikeObject))})),on=baseRest((function(e){var t=last(e);return isArrayLikeObject(t)&&(t=a),baseXor(arrayFilter(e,isArrayLikeObject),getIteratee(t,2))})),sn=baseRest((function(e){var t=last(e);return t="function"==typeof t?t:a,baseXor(arrayFilter(e,isArrayLikeObject),a,t)})),un=baseRest(unzip);var ln=baseRest((function(e){var t=e.length,r=t>1?e[t-1]:a;return r="function"==typeof r?(e.pop(),r):a,unzipWith(e,r)}));function chain(e){var t=lodash(e);return t.__chain__=!0,t}function thru(e,t){return t(e)}var cn=flatRest((function(e){var t=e.length,r=t?e[0]:0,n=this.__wrapped__,i=function interceptor(t){return baseAt(t,e)};return!(t>1||this.__actions__.length)&&n instanceof LazyWrapper&&isIndex(r)?((n=n.slice(r,+r+(t?1:0))).__actions__.push({func:thru,args:[i],thisArg:a}),new LodashWrapper(n,this.__chain__).thru((function(e){return t&&!e.length&&e.push(a),e}))):this.thru(i)}));var fn=createAggregator((function(e,t,r){ut.call(e,r)?++e[r]:baseAssignValue(e,r,1)}));var dn=createFind(findIndex),hn=createFind(findLastIndex);function forEach(e,t){return(Dn(e)?arrayEach:Or)(e,getIteratee(t,3))}function forEachRight(e,t){return(Dn(e)?arrayEachRight:Ar)(e,getIteratee(t,3))}var pn=createAggregator((function(e,t,r){ut.call(e,r)?e[r].push(t):baseAssignValue(e,r,[t])}));var gn=baseRest((function(e,r,n){var i=-1,a="function"==typeof r,o=isArrayLike(e)?t(e.length):[];return Or(e,(function(e){o[++i]=a?apply(r,e,n):baseInvoke(e,r,n)})),o})),mn=createAggregator((function(e,t,r){baseAssignValue(e,r,t)}));function map(e,t){return(Dn(e)?arrayMap:baseMap)(e,getIteratee(t,3))}var vn=createAggregator((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]}));var yn=baseRest((function(e,t){if(null==e)return[];var r=t.length;return r>1&&isIterateeCall(e,t[0],t[1])?t=[]:r>2&&isIterateeCall(t[0],t[1],t[2])&&(t=[t[0]]),baseOrderBy(e,baseFlatten(t,1),[])})),_n=Kt||function(){return jt.Date.now()};function ary(e,t,r){return t=r?a:t,t=e&&null==t?e.length:t,createWrap(e,S,a,a,a,a,t)}function before(e,t){var r;if("function"!=typeof t)throw new rt(u);return e=toInteger(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=a),r}}var bn=baseRest((function(e,t,r){var n=v;if(r.length){var i=replaceHolders(r,getHolder(bn));n|=w}return createWrap(e,n,t,r,i)})),xn=baseRest((function(e,t,r){var n=v|y;if(r.length){var i=replaceHolders(r,getHolder(xn));n|=w}return createWrap(t,n,e,r,i)}));function debounce(e,t,r){var n,i,o,s,l,c,f=0,d=!1,h=!1,p=!0;if("function"!=typeof e)throw new rt(u);function invokeFunc(t){var r=n,o=i;return n=i=a,f=t,s=e.apply(o,r)}function shouldInvoke(e){var r=e-c;return c===a||r>=t||r<0||h&&e-f>=o}function timerExpired(){var e=_n();if(shouldInvoke(e))return trailingEdge(e);l=Wr(timerExpired,function remainingWait(e){var r=t-(e-c);return h?or(r,o-(e-f)):r}(e))}function trailingEdge(e){return l=a,p&&n?invokeFunc(e):(n=i=a,s)}function debounced(){var e=_n(),r=shouldInvoke(e);if(n=arguments,i=this,c=e,r){if(l===a)return function leadingEdge(e){return f=e,l=Wr(timerExpired,t),d?invokeFunc(e):s}(c);if(h)return Fr(l),l=Wr(timerExpired,t),invokeFunc(c)}return l===a&&(l=Wr(timerExpired,t)),s}return t=toNumber(t)||0,isObject(r)&&(d=!!r.leading,o=(h="maxWait"in r)?ar(toNumber(r.maxWait)||0,t):o,p="trailing"in r?!!r.trailing:p),debounced.cancel=function cancel(){l!==a&&Fr(l),f=0,n=c=i=l=a},debounced.flush=function flush(){return l===a?s:trailingEdge(_n())},debounced}var wn=baseRest((function(e,t){return baseDelay(e,1,t)})),kn=baseRest((function(e,t,r){return baseDelay(e,toNumber(t)||0,r)}));function memoize(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new rt(u);var r=function memoized(){var r=arguments,n=t?t.apply(this,r):r[0],i=memoized.cache;if(i.has(n))return i.get(n);var a=e.apply(this,r);return memoized.cache=i.set(n,a)||i,a};return r.cache=new(memoize.Cache||MapCache),r}function negate(e){if("function"!=typeof e)throw new rt(u);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}memoize.Cache=MapCache;var Sn=Mr((function(e,t){var r=(t=1==t.length&&Dn(t[0])?arrayMap(t[0],baseUnary(getIteratee())):arrayMap(baseFlatten(t,1),baseUnary(getIteratee()))).length;return baseRest((function(n){for(var i=-1,a=or(n.length,r);++i<a;)n[i]=t[i].call(this,n[i]);return apply(e,this,n)}))})),En=baseRest((function(e,t){var r=replaceHolders(t,getHolder(En));return createWrap(e,w,a,t,r)})),Cn=baseRest((function(e,t){var r=replaceHolders(t,getHolder(Cn));return createWrap(e,k,a,t,r)})),Tn=flatRest((function(e,t){return createWrap(e,E,a,a,a,t)}));function eq(e,t){return e===t||e!==e&&t!==t}var On=createRelationalOperation(baseGt),An=createRelationalOperation((function(e,t){return e>=t})),Rn=baseIsArguments(function(){return arguments}())?baseIsArguments:function(e){return isObjectLike(e)&&ut.call(e,"callee")&&!Dt.call(e,"callee")},Dn=t.isArray,Pn=Bt?baseUnary(Bt):function baseIsArrayBuffer(e){return isObjectLike(e)&&baseGetTag(e)==ue};function isArrayLike(e){return null!=e&&isLength(e.length)&&!isFunction(e)}function isArrayLikeObject(e){return isObjectLike(e)&&isArrayLike(e)}var jn=tr||stubFalse,Mn=Ut?baseUnary(Ut):function baseIsDate(e){return isObjectLike(e)&&baseGetTag(e)==H};function isError(e){if(!isObjectLike(e))return!1;var t=baseGetTag(e);return t==Y||t==V||"string"==typeof e.message&&"string"==typeof e.name&&!isPlainObject(e)}function isFunction(e){if(!isObject(e))return!1;var t=baseGetTag(e);return t==$||t==X||t==W||t==ee}function isInteger(e){return"number"==typeof e&&e==toInteger(e)}function isLength(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=M}function isObject(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function isObjectLike(e){return null!=e&&"object"==typeof e}var Fn=zt?baseUnary(zt):function baseIsMap(e){return isObjectLike(e)&&Ur(e)==K};function isNumber(e){return"number"==typeof e||isObjectLike(e)&&baseGetTag(e)==J}function isPlainObject(e){if(!isObjectLike(e)||baseGetTag(e)!=Z)return!1;var t=wt(e);if(null===t)return!0;var r=ut.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&st.call(r)==dt}var In=qt?baseUnary(qt):function baseIsRegExp(e){return isObjectLike(e)&&baseGetTag(e)==te};var Ln=Wt?baseUnary(Wt):function baseIsSet(e){return isObjectLike(e)&&Ur(e)==re};function isString(e){return"string"==typeof e||!Dn(e)&&isObjectLike(e)&&baseGetTag(e)==ne}function isSymbol(e){return"symbol"==typeof e||isObjectLike(e)&&baseGetTag(e)==ie}var Nn=Gt?baseUnary(Gt):function baseIsTypedArray(e){return isObjectLike(e)&&isLength(e.length)&&!!Ct[baseGetTag(e)]};var Bn=createRelationalOperation(baseLt),Un=createRelationalOperation((function(e,t){return e<=t}));function toArray(e){if(!e)return[];if(isArrayLike(e))return isString(e)?stringToArray(e):copyArray(e);if(Ft&&e[Ft])return function iteratorToArray(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Ft]());var t=Ur(e);return(t==K?mapToArray:t==re?setToArray:values)(e)}function toFinite(e){return e?(e=toNumber(e))===j||e===-j?(e<0?-1:1)*F:e===e?e:0:0===e?e:0}function toInteger(e){var t=toFinite(e),r=t%1;return t===t?r?t-r:t:0}function toLength(e){return e?baseClamp(toInteger(e),0,L):0}function toNumber(e){if("number"==typeof e)return e;if(isSymbol(e))return I;if(isObject(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=isObject(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(Me,"");var r=He.test(e);return r||Ye.test(e)?Rt(e.slice(2),r?2:8):Ge.test(e)?I:+e}function toPlainObject(e){return copyObject(e,keysIn(e))}function toString(e){return null==e?"":baseToString(e)}var zn=createAssigner((function(e,t){if(isPrototype(t)||isArrayLike(t))copyObject(t,keys(t),e);else for(var r in t)ut.call(t,r)&&assignValue(e,r,t[r])})),qn=createAssigner((function(e,t){copyObject(t,keysIn(t),e)})),Wn=createAssigner((function(e,t,r,n){copyObject(t,keysIn(t),e,n)})),Gn=createAssigner((function(e,t,r,n){copyObject(t,keys(t),e,n)})),Hn=flatRest(baseAt);var Vn=baseRest((function(e,t){e=Ze(e);var r=-1,n=t.length,i=n>2?t[2]:a;for(i&&isIterateeCall(t[0],t[1],i)&&(n=1);++r<n;)for(var o=t[r],s=keysIn(o),u=-1,l=s.length;++u<l;){var c=s[u],f=e[c];(f===a||eq(f,at[c])&&!ut.call(e,c))&&(e[c]=o[c])}return e})),Yn=baseRest((function(e){return e.push(a,customDefaultsMerge),apply(Qn,a,e)}));function get(e,t,r){var n=null==e?a:baseGet(e,t);return n===a?r:n}function hasIn(e,t){return null!=e&&hasPath(e,t,baseHasIn)}var $n=createInverter((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=ft.call(t)),e[t]=r}),constant(identity)),Xn=createInverter((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=ft.call(t)),ut.call(e,t)?e[t].push(r):e[t]=[r]}),getIteratee),Kn=baseRest(baseInvoke);function keys(e){return isArrayLike(e)?arrayLikeKeys(e):baseKeys(e)}function keysIn(e){return isArrayLike(e)?arrayLikeKeys(e,!0):baseKeysIn(e)}var Jn=createAssigner((function(e,t,r){baseMerge(e,t,r)})),Qn=createAssigner((function(e,t,r,n){baseMerge(e,t,r,n)})),Zn=flatRest((function(e,t){var r={};if(null==e)return r;var n=!1;t=arrayMap(t,(function(t){return t=castPath(t,e),n||(n=t.length>1),t})),copyObject(e,getAllKeysIn(e),r),n&&(r=baseClone(r,d|h|p,customOmitClone));for(var i=t.length;i--;)baseUnset(r,t[i]);return r}));var ei=flatRest((function(e,t){return null==e?{}:function basePick(e,t){return basePickBy(e,t,(function(t,r){return hasIn(e,r)}))}(e,t)}));function pickBy(e,t){if(null==e)return{};var r=arrayMap(getAllKeysIn(e),(function(e){return[e]}));return t=getIteratee(t),basePickBy(e,r,(function(e,r){return t(e,r[0])}))}var ti=createToPairs(keys),ri=createToPairs(keysIn);function values(e){return null==e?[]:baseValues(e,keys(e))}var ni=createCompounder((function(e,t,r){return t=t.toLowerCase(),e+(r?capitalize(t):t)}));function capitalize(e){return ci(toString(e).toLowerCase())}function deburr(e){return(e=toString(e))&&e.replace(Xe,Vt).replace(_t,"")}var ii=createCompounder((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),ai=createCompounder((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),oi=createCaseFirst("toLowerCase");var si=createCompounder((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}));var ui=createCompounder((function(e,t,r){return e+(r?" ":"")+ci(t)}));var li=createCompounder((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),ci=createCaseFirst("toUpperCase");function words(e,t,r){return e=toString(e),(t=r?a:t)===a?function hasUnicodeWord(e){return kt.test(e)}(e)?function unicodeWords(e){return e.match(xt)||[]}(e):function asciiWords(e){return e.match(Ue)||[]}(e):e.match(t)||[]}var fi=baseRest((function(e,t){try{return apply(e,a,t)}catch(r){return isError(r)?r:new n(r)}})),di=flatRest((function(e,t){return arrayEach(t,(function(t){t=toKey(t),baseAssignValue(e,t,bn(e[t],e))})),e}));function constant(e){return function(){return e}}var hi=createFlow(),pi=createFlow(!0);function identity(e){return e}function iteratee(e){return baseIteratee("function"==typeof e?e:baseClone(e,d))}var gi=baseRest((function(e,t){return function(r){return baseInvoke(r,e,t)}})),mi=baseRest((function(e,t){return function(r){return baseInvoke(e,r,t)}}));function mixin(e,t,r){var n=keys(t),i=baseFunctions(t,n);null!=r||isObject(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=baseFunctions(t,keys(t)));var a=!(isObject(r)&&"chain"in r)||!!r.chain,o=isFunction(e);return arrayEach(i,(function(r){var n=t[r];e[r]=n,o&&(e.prototype[r]=function(){var t=this.__chain__;if(a||t){var r=e(this.__wrapped__),i=r.__actions__=copyArray(this.__actions__);return i.push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,arrayPush([this.value()],arguments))})})),e}function noop(){}var vi=createOver(arrayMap),yi=createOver(arrayEvery),_i=createOver(arraySome);function property(e){return isKey(e)?baseProperty(toKey(e)):function basePropertyDeep(e){return function(t){return baseGet(t,e)}}(e)}var bi=createRange(),xi=createRange(!0);function stubArray(){return[]}function stubFalse(){return!1}var wi=createMathOperation((function(e,t){return e+t}),0),ki=createRound("ceil"),Si=createMathOperation((function(e,t){return e/t}),1),Ei=createRound("floor");var Ci=createMathOperation((function(e,t){return e*t}),1),Ti=createRound("round"),Oi=createMathOperation((function(e,t){return e-t}),0);return lodash.after=function after(e,t){if("function"!=typeof t)throw new rt(u);return e=toInteger(e),function(){if(--e<1)return t.apply(this,arguments)}},lodash.ary=ary,lodash.assign=zn,lodash.assignIn=qn,lodash.assignInWith=Wn,lodash.assignWith=Gn,lodash.at=Hn,lodash.before=before,lodash.bind=bn,lodash.bindAll=di,lodash.bindKey=xn,lodash.castArray=function castArray(){if(!arguments.length)return[];var e=arguments[0];return Dn(e)?e:[e]},lodash.chain=chain,lodash.chunk=function chunk(e,r,n){r=(n?isIterateeCall(e,r,n):r===a)?1:ar(toInteger(r),0);var i=null==e?0:e.length;if(!i||r<1)return[];for(var o=0,s=0,u=t(Qt(i/r));o<i;)u[s++]=baseSlice(e,o,o+=r);return u},lodash.compact=function compact(e){for(var t=-1,r=null==e?0:e.length,n=0,i=[];++t<r;){var a=e[t];a&&(i[n++]=a)}return i},lodash.concat=function concat(){var e=arguments.length;if(!e)return[];for(var r=t(e-1),n=arguments[0],i=e;i--;)r[i-1]=arguments[i];return arrayPush(Dn(n)?copyArray(n):[n],baseFlatten(r,1))},lodash.cond=function cond(e){var t=null==e?0:e.length,r=getIteratee();return e=t?arrayMap(e,(function(e){if("function"!=typeof e[1])throw new rt(u);return[r(e[0]),e[1]]})):[],baseRest((function(r){for(var n=-1;++n<t;){var i=e[n];if(apply(i[0],this,r))return apply(i[1],this,r)}}))},lodash.conforms=function conforms(e){return function baseConforms(e){var t=keys(e);return function(r){return baseConformsTo(r,e,t)}}(baseClone(e,d))},lodash.constant=constant,lodash.countBy=fn,lodash.create=function create(e,t){var r=Tr(e);return null==t?r:baseAssign(r,t)},lodash.curry=function curry(e,t,r){var n=createWrap(e,b,a,a,a,a,a,t=r?a:t);return n.placeholder=curry.placeholder,n},lodash.curryRight=function curryRight(e,t,r){var n=createWrap(e,x,a,a,a,a,a,t=r?a:t);return n.placeholder=curryRight.placeholder,n},lodash.debounce=debounce,lodash.defaults=Vn,lodash.defaultsDeep=Yn,lodash.defer=wn,lodash.delay=kn,lodash.difference=Vr,lodash.differenceBy=Yr,lodash.differenceWith=$r,lodash.drop=function drop(e,t,r){var n=null==e?0:e.length;return n?baseSlice(e,(t=r||t===a?1:toInteger(t))<0?0:t,n):[]},lodash.dropRight=function dropRight(e,t,r){var n=null==e?0:e.length;return n?baseSlice(e,0,(t=n-(t=r||t===a?1:toInteger(t)))<0?0:t):[]},lodash.dropRightWhile=function dropRightWhile(e,t){return e&&e.length?baseWhile(e,getIteratee(t,3),!0,!0):[]},lodash.dropWhile=function dropWhile(e,t){return e&&e.length?baseWhile(e,getIteratee(t,3),!0):[]},lodash.fill=function fill(e,t,r,n){var i=null==e?0:e.length;return i?(r&&"number"!=typeof r&&isIterateeCall(e,t,r)&&(r=0,n=i),function baseFill(e,t,r,n){var i=e.length;for((r=toInteger(r))<0&&(r=-r>i?0:i+r),(n=n===a||n>i?i:toInteger(n))<0&&(n+=i),n=r>n?0:toLength(n);r<n;)e[r++]=t;return e}(e,t,r,n)):[]},lodash.filter=function filter(e,t){return(Dn(e)?arrayFilter:baseFilter)(e,getIteratee(t,3))},lodash.flatMap=function flatMap(e,t){return baseFlatten(map(e,t),1)},lodash.flatMapDeep=function flatMapDeep(e,t){return baseFlatten(map(e,t),j)},lodash.flatMapDepth=function flatMapDepth(e,t,r){return r=r===a?1:toInteger(r),baseFlatten(map(e,t),r)},lodash.flatten=flatten,lodash.flattenDeep=function flattenDeep(e){return(null==e?0:e.length)?baseFlatten(e,j):[]},lodash.flattenDepth=function flattenDepth(e,t){return(null==e?0:e.length)?baseFlatten(e,t=t===a?1:toInteger(t)):[]},lodash.flip=function flip(e){return createWrap(e,C)},lodash.flow=hi,lodash.flowRight=pi,lodash.fromPairs=function fromPairs(e){for(var t=-1,r=null==e?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n},lodash.functions=function functions(e){return null==e?[]:baseFunctions(e,keys(e))},lodash.functionsIn=function functionsIn(e){return null==e?[]:baseFunctions(e,keysIn(e))},lodash.groupBy=pn,lodash.initial=function initial(e){return(null==e?0:e.length)?baseSlice(e,0,-1):[]},lodash.intersection=Xr,lodash.intersectionBy=Kr,lodash.intersectionWith=Jr,lodash.invert=$n,lodash.invertBy=Xn,lodash.invokeMap=gn,lodash.iteratee=iteratee,lodash.keyBy=mn,lodash.keys=keys,lodash.keysIn=keysIn,lodash.map=map,lodash.mapKeys=function mapKeys(e,t){var r={};return t=getIteratee(t,3),baseForOwn(e,(function(e,n,i){baseAssignValue(r,t(e,n,i),e)})),r},lodash.mapValues=function mapValues(e,t){var r={};return t=getIteratee(t,3),baseForOwn(e,(function(e,n,i){baseAssignValue(r,n,t(e,n,i))})),r},lodash.matches=function matches(e){return baseMatches(baseClone(e,d))},lodash.matchesProperty=function matchesProperty(e,t){return baseMatchesProperty(e,baseClone(t,d))},lodash.memoize=memoize,lodash.merge=Jn,lodash.mergeWith=Qn,lodash.method=gi,lodash.methodOf=mi,lodash.mixin=mixin,lodash.negate=negate,lodash.nthArg=function nthArg(e){return e=toInteger(e),baseRest((function(t){return baseNth(t,e)}))},lodash.omit=Zn,lodash.omitBy=function omitBy(e,t){return pickBy(e,negate(getIteratee(t)))},lodash.once=function once(e){return before(2,e)},lodash.orderBy=function orderBy(e,t,r,n){return null==e?[]:(Dn(t)||(t=null==t?[]:[t]),Dn(r=n?a:r)||(r=null==r?[]:[r]),baseOrderBy(e,t,r))},lodash.over=vi,lodash.overArgs=Sn,lodash.overEvery=yi,lodash.overSome=_i,lodash.partial=En,lodash.partialRight=Cn,lodash.partition=vn,lodash.pick=ei,lodash.pickBy=pickBy,lodash.property=property,lodash.propertyOf=function propertyOf(e){return function(t){return null==e?a:baseGet(e,t)}},lodash.pull=Qr,lodash.pullAll=pullAll,lodash.pullAllBy=function pullAllBy(e,t,r){return e&&e.length&&t&&t.length?basePullAll(e,t,getIteratee(r,2)):e},lodash.pullAllWith=function pullAllWith(e,t,r){return e&&e.length&&t&&t.length?basePullAll(e,t,a,r):e},lodash.pullAt=Zr,lodash.range=bi,lodash.rangeRight=xi,lodash.rearg=Tn,lodash.reject=function reject(e,t){return(Dn(e)?arrayFilter:baseFilter)(e,negate(getIteratee(t,3)))},lodash.remove=function remove(e,t){var r=[];if(!e||!e.length)return r;var n=-1,i=[],a=e.length;for(t=getIteratee(t,3);++n<a;){var o=e[n];t(o,n,e)&&(r.push(o),i.push(n))}return basePullAt(e,i),r},lodash.rest=function rest(e,t){if("function"!=typeof e)throw new rt(u);return baseRest(e,t=t===a?t:toInteger(t))},lodash.reverse=reverse,lodash.sampleSize=function sampleSize(e,t,r){return t=(r?isIterateeCall(e,t,r):t===a)?1:toInteger(t),(Dn(e)?arraySampleSize:baseSampleSize)(e,t)},lodash.set=function set(e,t,r){return null==e?e:baseSet(e,t,r)},lodash.setWith=function setWith(e,t,r,n){return n="function"==typeof n?n:a,null==e?e:baseSet(e,t,r,n)},lodash.shuffle=function shuffle(e){return(Dn(e)?arrayShuffle:baseShuffle)(e)},lodash.slice=function slice(e,t,r){var n=null==e?0:e.length;return n?(r&&"number"!=typeof r&&isIterateeCall(e,t,r)?(t=0,r=n):(t=null==t?0:toInteger(t),r=r===a?n:toInteger(r)),baseSlice(e,t,r)):[]},lodash.sortBy=yn,lodash.sortedUniq=function sortedUniq(e){return e&&e.length?baseSortedUniq(e):[]},lodash.sortedUniqBy=function sortedUniqBy(e,t){return e&&e.length?baseSortedUniq(e,getIteratee(t,2)):[]},lodash.split=function split(e,t,r){return r&&"number"!=typeof r&&isIterateeCall(e,t,r)&&(t=r=a),(r=r===a?L:r>>>0)?(e=toString(e))&&("string"==typeof t||null!=t&&!In(t))&&!(t=baseToString(t))&&hasUnicode(e)?castSlice(stringToArray(e),0,r):e.split(t,r):[]},lodash.spread=function spread(e,t){if("function"!=typeof e)throw new rt(u);return t=null==t?0:ar(toInteger(t),0),baseRest((function(r){var n=r[t],i=castSlice(r,0,t);return n&&arrayPush(i,n),apply(e,this,i)}))},lodash.tail=function tail(e){var t=null==e?0:e.length;return t?baseSlice(e,1,t):[]},lodash.take=function take(e,t,r){return e&&e.length?baseSlice(e,0,(t=r||t===a?1:toInteger(t))<0?0:t):[]},lodash.takeRight=function takeRight(e,t,r){var n=null==e?0:e.length;return n?baseSlice(e,(t=n-(t=r||t===a?1:toInteger(t)))<0?0:t,n):[]},lodash.takeRightWhile=function takeRightWhile(e,t){return e&&e.length?baseWhile(e,getIteratee(t,3),!1,!0):[]},lodash.takeWhile=function takeWhile(e,t){return e&&e.length?baseWhile(e,getIteratee(t,3)):[]},lodash.tap=function tap(e,t){return t(e),e},lodash.throttle=function throttle(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new rt(u);return isObject(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),debounce(e,t,{leading:n,maxWait:t,trailing:i})},lodash.thru=thru,lodash.toArray=toArray,lodash.toPairs=ti,lodash.toPairsIn=ri,lodash.toPath=function toPath(e){return Dn(e)?arrayMap(e,toKey):isSymbol(e)?[e]:copyArray(Hr(toString(e)))},lodash.toPlainObject=toPlainObject,lodash.transform=function transform(e,t,r){var n=Dn(e),i=n||jn(e)||Nn(e);if(t=getIteratee(t,4),null==r){var a=e&&e.constructor;r=i?n?new a:[]:isObject(e)&&isFunction(a)?Tr(wt(e)):{}}return(i?arrayEach:baseForOwn)(e,(function(e,n,i){return t(r,e,n,i)})),r},lodash.unary=function unary(e){return ary(e,1)},lodash.union=en,lodash.unionBy=tn,lodash.unionWith=rn,lodash.uniq=function uniq(e){return e&&e.length?baseUniq(e):[]},lodash.uniqBy=function uniqBy(e,t){return e&&e.length?baseUniq(e,getIteratee(t,2)):[]},lodash.uniqWith=function uniqWith(e,t){return t="function"==typeof t?t:a,e&&e.length?baseUniq(e,a,t):[]},lodash.unset=function unset(e,t){return null==e||baseUnset(e,t)},lodash.unzip=unzip,lodash.unzipWith=unzipWith,lodash.update=function update(e,t,r){return null==e?e:baseUpdate(e,t,castFunction(r))},lodash.updateWith=function updateWith(e,t,r,n){return n="function"==typeof n?n:a,null==e?e:baseUpdate(e,t,castFunction(r),n)},lodash.values=values,lodash.valuesIn=function valuesIn(e){return null==e?[]:baseValues(e,keysIn(e))},lodash.without=nn,lodash.words=words,lodash.wrap=function wrap(e,t){return En(castFunction(t),e)},lodash.xor=an,lodash.xorBy=on,lodash.xorWith=sn,lodash.zip=un,lodash.zipObject=function zipObject(e,t){return baseZipObject(e||[],t||[],assignValue)},lodash.zipObjectDeep=function zipObjectDeep(e,t){return baseZipObject(e||[],t||[],baseSet)},lodash.zipWith=ln,lodash.entries=ti,lodash.entriesIn=ri,lodash.extend=qn,lodash.extendWith=Wn,mixin(lodash,lodash),lodash.add=wi,lodash.attempt=fi,lodash.camelCase=ni,lodash.capitalize=capitalize,lodash.ceil=ki,lodash.clamp=function clamp(e,t,r){return r===a&&(r=t,t=a),r!==a&&(r=(r=toNumber(r))===r?r:0),t!==a&&(t=(t=toNumber(t))===t?t:0),baseClamp(toNumber(e),t,r)},lodash.clone=function clone(e){return baseClone(e,p)},lodash.cloneDeep=function cloneDeep(e){return baseClone(e,d|p)},lodash.cloneDeepWith=function cloneDeepWith(e,t){return baseClone(e,d|p,t="function"==typeof t?t:a)},lodash.cloneWith=function cloneWith(e,t){return baseClone(e,p,t="function"==typeof t?t:a)},lodash.conformsTo=function conformsTo(e,t){return null==t||baseConformsTo(e,t,keys(t))},lodash.deburr=deburr,lodash.defaultTo=function defaultTo(e,t){return null==e||e!==e?t:e},lodash.divide=Si,lodash.endsWith=function endsWith(e,t,r){e=toString(e),t=baseToString(t);var n=e.length,i=r=r===a?n:baseClamp(toInteger(r),0,n);return(r-=t.length)>=0&&e.slice(r,i)==t},lodash.eq=eq,lodash.escape=function escape(e){return(e=toString(e))&&Ee.test(e)?e.replace(ke,Yt):e},lodash.escapeRegExp=function escapeRegExp(e){return(e=toString(e))&&je.test(e)?e.replace(Pe,"\\$&"):e},lodash.every=function every(e,t,r){var n=Dn(e)?arrayEvery:baseEvery;return r&&isIterateeCall(e,t,r)&&(t=a),n(e,getIteratee(t,3))},lodash.find=dn,lodash.findIndex=findIndex,lodash.findKey=function findKey(e,t){return baseFindKey(e,getIteratee(t,3),baseForOwn)},lodash.findLast=hn,lodash.findLastIndex=findLastIndex,lodash.findLastKey=function findLastKey(e,t){return baseFindKey(e,getIteratee(t,3),baseForOwnRight)},lodash.floor=Ei,lodash.forEach=forEach,lodash.forEachRight=forEachRight,lodash.forIn=function forIn(e,t){return null==e?e:Rr(e,getIteratee(t,3),keysIn)},lodash.forInRight=function forInRight(e,t){return null==e?e:Dr(e,getIteratee(t,3),keysIn)},lodash.forOwn=function forOwn(e,t){return e&&baseForOwn(e,getIteratee(t,3))},lodash.forOwnRight=function forOwnRight(e,t){return e&&baseForOwnRight(e,getIteratee(t,3))},lodash.get=get,lodash.gt=On,lodash.gte=An,lodash.has=function has(e,t){return null!=e&&hasPath(e,t,baseHas)},lodash.hasIn=hasIn,lodash.head=head,lodash.identity=identity,lodash.includes=function includes(e,t,r,n){e=isArrayLike(e)?e:values(e),r=r&&!n?toInteger(r):0;var i=e.length;return r<0&&(r=ar(i+r,0)),isString(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&baseIndexOf(e,t,r)>-1},lodash.indexOf=function indexOf(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:toInteger(r);return i<0&&(i=ar(n+i,0)),baseIndexOf(e,t,i)},lodash.inRange=function inRange(e,t,r){return t=toFinite(t),r===a?(r=t,t=0):r=toFinite(r),function baseInRange(e,t,r){return e>=or(t,r)&&e<ar(t,r)}(e=toNumber(e),t,r)},lodash.invoke=Kn,lodash.isArguments=Rn,lodash.isArray=Dn,lodash.isArrayBuffer=Pn,lodash.isArrayLike=isArrayLike,lodash.isArrayLikeObject=isArrayLikeObject,lodash.isBoolean=function isBoolean(e){return!0===e||!1===e||isObjectLike(e)&&baseGetTag(e)==G},lodash.isBuffer=jn,lodash.isDate=Mn,lodash.isElement=function isElement(e){return isObjectLike(e)&&1===e.nodeType&&!isPlainObject(e)},lodash.isEmpty=function isEmpty(e){if(null==e)return!0;if(isArrayLike(e)&&(Dn(e)||"string"==typeof e||"function"==typeof e.splice||jn(e)||Nn(e)||Rn(e)))return!e.length;var t=Ur(e);if(t==K||t==re)return!e.size;if(isPrototype(e))return!baseKeys(e).length;for(var r in e)if(ut.call(e,r))return!1;return!0},lodash.isEqual=function isEqual(e,t){return baseIsEqual(e,t)},lodash.isEqualWith=function isEqualWith(e,t,r){var n=(r="function"==typeof r?r:a)?r(e,t):a;return n===a?baseIsEqual(e,t,a,r):!!n},lodash.isError=isError,lodash.isFinite=function isFinite(e){return"number"==typeof e&&rr(e)},lodash.isFunction=isFunction,lodash.isInteger=isInteger,lodash.isLength=isLength,lodash.isMap=Fn,lodash.isMatch=function isMatch(e,t){return e===t||baseIsMatch(e,t,getMatchData(t))},lodash.isMatchWith=function isMatchWith(e,t,r){return r="function"==typeof r?r:a,baseIsMatch(e,t,getMatchData(t),r)},lodash.isNaN=function isNaN(e){return isNumber(e)&&e!=+e},lodash.isNative=function isNative(e){if(zr(e))throw new n(s);return baseIsNative(e)},lodash.isNil=function isNil(e){return null==e},lodash.isNull=function isNull(e){return null===e},lodash.isNumber=isNumber,lodash.isObject=isObject,lodash.isObjectLike=isObjectLike,lodash.isPlainObject=isPlainObject,lodash.isRegExp=In,lodash.isSafeInteger=function isSafeInteger(e){return isInteger(e)&&e>=-M&&e<=M},lodash.isSet=Ln,lodash.isString=isString,lodash.isSymbol=isSymbol,lodash.isTypedArray=Nn,lodash.isUndefined=function isUndefined(e){return e===a},lodash.isWeakMap=function isWeakMap(e){return isObjectLike(e)&&Ur(e)==oe},lodash.isWeakSet=function isWeakSet(e){return isObjectLike(e)&&baseGetTag(e)==se},lodash.join=function join(e,t){return null==e?"":nr.call(e,t)},lodash.kebabCase=ii,lodash.last=last,lodash.lastIndexOf=function lastIndexOf(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=n;return r!==a&&(i=(i=toInteger(r))<0?ar(n+i,0):or(i,n-1)),t===t?function strictLastIndexOf(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,i):baseFindIndex(e,baseIsNaN,i,!0)},lodash.lowerCase=ai,lodash.lowerFirst=oi,lodash.lt=Bn,lodash.lte=Un,lodash.max=function max(e){return e&&e.length?baseExtremum(e,identity,baseGt):a},lodash.maxBy=function maxBy(e,t){return e&&e.length?baseExtremum(e,getIteratee(t,2),baseGt):a},lodash.mean=function mean(e){return baseMean(e,identity)},lodash.meanBy=function meanBy(e,t){return baseMean(e,getIteratee(t,2))},lodash.min=function min(e){return e&&e.length?baseExtremum(e,identity,baseLt):a},lodash.minBy=function minBy(e,t){return e&&e.length?baseExtremum(e,getIteratee(t,2),baseLt):a},lodash.stubArray=stubArray,lodash.stubFalse=stubFalse,lodash.stubObject=function stubObject(){return{}},lodash.stubString=function stubString(){return""},lodash.stubTrue=function stubTrue(){return!0},lodash.multiply=Ci,lodash.nth=function nth(e,t){return e&&e.length?baseNth(e,toInteger(t)):a},lodash.noConflict=function noConflict(){return jt._===this&&(jt._=ht),this},lodash.noop=noop,lodash.now=_n,lodash.pad=function pad(e,t,r){e=toString(e);var n=(t=toInteger(t))?stringSize(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return createPadding(Zt(i),r)+e+createPadding(Qt(i),r)},lodash.padEnd=function padEnd(e,t,r){e=toString(e);var n=(t=toInteger(t))?stringSize(e):0;return t&&n<t?e+createPadding(t-n,r):e},lodash.padStart=function padStart(e,t,r){e=toString(e);var n=(t=toInteger(t))?stringSize(e):0;return t&&n<t?createPadding(t-n,r)+e:e},lodash.parseInt=function parseInt(e,t,r){return r||null==t?t=0:t&&(t=+t),ur(toString(e).replace(Fe,""),t||0)},lodash.random=function random(e,t,r){if(r&&"boolean"!=typeof r&&isIterateeCall(e,t,r)&&(t=r=a),r===a&&("boolean"==typeof t?(r=t,t=a):"boolean"==typeof e&&(r=e,e=a)),e===a&&t===a?(e=0,t=1):(e=toFinite(e),t===a?(t=e,e=0):t=toFinite(t)),e>t){var n=e;e=t,t=n}if(r||e%1||t%1){var i=lr();return or(e+i*(t-e+At("1e-"+((i+"").length-1))),t)}return baseRandom(e,t)},lodash.reduce=function reduce(e,t,r){var n=Dn(e)?arrayReduce:baseReduce,i=arguments.length<3;return n(e,getIteratee(t,4),r,i,Or)},lodash.reduceRight=function reduceRight(e,t,r){var n=Dn(e)?arrayReduceRight:baseReduce,i=arguments.length<3;return n(e,getIteratee(t,4),r,i,Ar)},lodash.repeat=function repeat(e,t,r){return t=(r?isIterateeCall(e,t,r):t===a)?1:toInteger(t),baseRepeat(toString(e),t)},lodash.replace=function replace(){var e=arguments,t=toString(e[0]);return e.length<3?t:t.replace(e[1],e[2])},lodash.result=function result(e,t,r){var n=-1,i=(t=castPath(t,e)).length;for(i||(i=1,e=a);++n<i;){var o=null==e?a:e[toKey(t[n])];o===a&&(n=i,o=r),e=isFunction(o)?o.call(e):o}return e},lodash.round=Ti,lodash.runInContext=runInContext,lodash.sample=function sample(e){return(Dn(e)?arraySample:baseSample)(e)},lodash.size=function size(e){if(null==e)return 0;if(isArrayLike(e))return isString(e)?stringSize(e):e.length;var t=Ur(e);return t==K||t==re?e.size:baseKeys(e).length},lodash.snakeCase=si,lodash.some=function some(e,t,r){var n=Dn(e)?arraySome:baseSome;return r&&isIterateeCall(e,t,r)&&(t=a),n(e,getIteratee(t,3))},lodash.sortedIndex=function sortedIndex(e,t){return baseSortedIndex(e,t)},lodash.sortedIndexBy=function sortedIndexBy(e,t,r){return baseSortedIndexBy(e,t,getIteratee(r,2))},lodash.sortedIndexOf=function sortedIndexOf(e,t){var r=null==e?0:e.length;if(r){var n=baseSortedIndex(e,t);if(n<r&&eq(e[n],t))return n}return-1},lodash.sortedLastIndex=function sortedLastIndex(e,t){return baseSortedIndex(e,t,!0)},lodash.sortedLastIndexBy=function sortedLastIndexBy(e,t,r){return baseSortedIndexBy(e,t,getIteratee(r,2),!0)},lodash.sortedLastIndexOf=function sortedLastIndexOf(e,t){if(null==e?0:e.length){var r=baseSortedIndex(e,t,!0)-1;if(eq(e[r],t))return r}return-1},lodash.startCase=ui,lodash.startsWith=function startsWith(e,t,r){return e=toString(e),r=null==r?0:baseClamp(toInteger(r),0,e.length),t=baseToString(t),e.slice(r,r+t.length)==t},lodash.subtract=Oi,lodash.sum=function sum(e){return e&&e.length?baseSum(e,identity):0},lodash.sumBy=function sumBy(e,t){return e&&e.length?baseSum(e,getIteratee(t,2)):0},lodash.template=function template(e,t,r){var n=lodash.templateSettings;r&&isIterateeCall(e,t,r)&&(t=a),e=toString(e),t=Wn({},t,n,customDefaultsAssignIn);var o,s,u=Wn({},t.imports,n.imports,customDefaultsAssignIn),l=keys(u),c=baseValues(u,l),f=0,d=t.interpolate||Ke,h="__p += '",p=et((t.escape||Ke).source+"|"+d.source+"|"+(d===Oe?qe:Ke).source+"|"+(t.evaluate||Ke).source+"|$","g"),g="//# sourceURL="+(ut.call(t,"sourceURL")?(t.sourceURL+"").replace(/[\r\n]/g," "):"lodash.templateSources["+ ++Et+"]")+"\n";e.replace(p,(function(t,r,n,i,a,u){return n||(n=i),h+=e.slice(f,u).replace(Je,escapeStringChar),r&&(o=!0,h+="' +\n__e("+r+") +\n'"),a&&(s=!0,h+="';\n"+a+";\n__p += '"),n&&(h+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),f=u+t.length,t})),h+="';\n";var m=ut.call(t,"variable")&&t.variable;m||(h="with (obj) {\n"+h+"\n}\n"),h=(s?h.replace(_e,""):h).replace(be,"$1").replace(xe,"$1;"),h="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var v=fi((function(){return i(l,g+"return "+h).apply(a,c)}));if(v.source=h,isError(v))throw v;return v},lodash.times=function times(e,t){if((e=toInteger(e))<1||e>M)return[];var r=L,n=or(e,L);t=getIteratee(t),e-=L;for(var i=baseTimes(n,t);++r<e;)t(r);return i},lodash.toFinite=toFinite,lodash.toInteger=toInteger,lodash.toLength=toLength,lodash.toLower=function toLower(e){return toString(e).toLowerCase()},lodash.toNumber=toNumber,lodash.toSafeInteger=function toSafeInteger(e){return e?baseClamp(toInteger(e),-M,M):0===e?e:0},lodash.toString=toString,lodash.toUpper=function toUpper(e){return toString(e).toUpperCase()},lodash.trim=function trim(e,t,r){if((e=toString(e))&&(r||t===a))return e.replace(Me,"");if(!e||!(t=baseToString(t)))return e;var n=stringToArray(e),i=stringToArray(t);return castSlice(n,charsStartIndex(n,i),charsEndIndex(n,i)+1).join("")},lodash.trimEnd=function trimEnd(e,t,r){if((e=toString(e))&&(r||t===a))return e.replace(Ie,"");if(!e||!(t=baseToString(t)))return e;var n=stringToArray(e);return castSlice(n,0,charsEndIndex(n,stringToArray(t))+1).join("")},lodash.trimStart=function trimStart(e,t,r){if((e=toString(e))&&(r||t===a))return e.replace(Fe,"");if(!e||!(t=baseToString(t)))return e;var n=stringToArray(e);return castSlice(n,charsStartIndex(n,stringToArray(t))).join("")},lodash.truncate=function truncate(e,t){var r=T,n=O;if(isObject(t)){var i="separator"in t?t.separator:i;r="length"in t?toInteger(t.length):r,n="omission"in t?baseToString(t.omission):n}var o=(e=toString(e)).length;if(hasUnicode(e)){var s=stringToArray(e);o=s.length}if(r>=o)return e;var u=r-stringSize(n);if(u<1)return n;var l=s?castSlice(s,0,u).join(""):e.slice(0,u);if(i===a)return l+n;if(s&&(u+=l.length-u),In(i)){if(e.slice(u).search(i)){var c,f=l;for(i.global||(i=et(i.source,toString(We.exec(i))+"g")),i.lastIndex=0;c=i.exec(f);)var d=c.index;l=l.slice(0,d===a?u:d)}}else if(e.indexOf(baseToString(i),u)!=u){var h=l.lastIndexOf(i);h>-1&&(l=l.slice(0,h))}return l+n},lodash.unescape=function unescape(e){return(e=toString(e))&&Se.test(e)?e.replace(we,$t):e},lodash.uniqueId=function uniqueId(e){var t=++lt;return toString(e)+t},lodash.upperCase=li,lodash.upperFirst=ci,lodash.each=forEach,lodash.eachRight=forEachRight,lodash.first=head,mixin(lodash,function(){var e={};return baseForOwn(lodash,(function(t,r){ut.call(lodash.prototype,r)||(e[r]=t)})),e}(),{chain:!1}),lodash.VERSION="4.17.15",arrayEach(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){lodash[e].placeholder=lodash})),arrayEach(["drop","take"],(function(e,t){LazyWrapper.prototype[e]=function(r){r=r===a?1:ar(toInteger(r),0);var n=this.__filtered__&&!t?new LazyWrapper(this):this.clone();return n.__filtered__?n.__takeCount__=or(r,n.__takeCount__):n.__views__.push({size:or(r,L),type:e+(n.__dir__<0?"Right":"")}),n},LazyWrapper.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),arrayEach(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=r==D||3==r;LazyWrapper.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:getIteratee(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),arrayEach(["head","last"],(function(e,t){var r="take"+(t?"Right":"");LazyWrapper.prototype[e]=function(){return this[r](1).value()[0]}})),arrayEach(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");LazyWrapper.prototype[e]=function(){return this.__filtered__?new LazyWrapper(this):this[r](1)}})),LazyWrapper.prototype.compact=function(){return this.filter(identity)},LazyWrapper.prototype.find=function(e){return this.filter(e).head()},LazyWrapper.prototype.findLast=function(e){return this.reverse().find(e)},LazyWrapper.prototype.invokeMap=baseRest((function(e,t){return"function"==typeof e?new LazyWrapper(this):this.map((function(r){return baseInvoke(r,e,t)}))})),LazyWrapper.prototype.reject=function(e){return this.filter(negate(getIteratee(e)))},LazyWrapper.prototype.slice=function(e,t){e=toInteger(e);var r=this;return r.__filtered__&&(e>0||t<0)?new LazyWrapper(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==a&&(r=(t=toInteger(t))<0?r.dropRight(-t):r.take(t-e)),r)},LazyWrapper.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},LazyWrapper.prototype.toArray=function(){return this.take(L)},baseForOwn(LazyWrapper.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),i=lodash[n?"take"+("last"==t?"Right":""):t],o=n||/^find/.test(t);i&&(lodash.prototype[t]=function(){var t=this.__wrapped__,s=n?[1]:arguments,u=t instanceof LazyWrapper,l=s[0],c=u||Dn(t),f=function interceptor(e){var t=i.apply(lodash,arrayPush([e],s));return n&&d?t[0]:t};c&&r&&"function"==typeof l&&1!=l.length&&(u=c=!1);var d=this.__chain__,h=!!this.__actions__.length,p=o&&!d,g=u&&!h;if(!o&&c){t=g?t:new LazyWrapper(this);var m=e.apply(t,s);return m.__actions__.push({func:thru,args:[f],thisArg:a}),new LodashWrapper(m,d)}return p&&g?e.apply(this,s):(m=this.thru(f),p?n?m.value()[0]:m.value():m)})})),arrayEach(["pop","push","shift","sort","splice","unshift"],(function(e){var t=nt[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);lodash.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(Dn(i)?i:[],e)}return this[r]((function(r){return t.apply(Dn(r)?r:[],e)}))}})),baseForOwn(LazyWrapper.prototype,(function(e,t){var r=lodash[t];if(r){var n=r.name+"";ut.call(yr,n)||(yr[n]=[]),yr[n].push({name:t,func:r})}})),yr[createHybrid(a,y).name]=[{name:"wrapper",func:a}],LazyWrapper.prototype.clone=function lazyClone(){var e=new LazyWrapper(this.__wrapped__);return e.__actions__=copyArray(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=copyArray(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=copyArray(this.__views__),e},LazyWrapper.prototype.reverse=function lazyReverse(){if(this.__filtered__){var e=new LazyWrapper(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},LazyWrapper.prototype.value=function lazyValue(){var e=this.__wrapped__.value(),t=this.__dir__,r=Dn(e),n=t<0,i=r?e.length:0,a=function getView(e,t,r){var n=-1,i=r.length;for(;++n<i;){var a=r[n],o=a.size;switch(a.type){case"drop":e+=o;break;case"dropRight":t-=o;break;case"take":t=or(t,e+o);break;case"takeRight":e=ar(e,t-o)}}return{start:e,end:t}}(0,i,this.__views__),o=a.start,s=a.end,u=s-o,l=n?s:o-1,c=this.__iteratees__,f=c.length,d=0,h=or(u,this.__takeCount__);if(!r||!n&&i==u&&h==u)return baseWrapperValue(e,this.__actions__);var p=[];e:for(;u--&&d<h;){for(var g=-1,m=e[l+=t];++g<f;){var v=c[g],y=v.iteratee,_=v.type,b=y(m);if(_==P)m=b;else if(!b){if(_==D)continue e;break e}}p[d++]=m}return p},lodash.prototype.at=cn,lodash.prototype.chain=function wrapperChain(){return chain(this)},lodash.prototype.commit=function wrapperCommit(){return new LodashWrapper(this.value(),this.__chain__)},lodash.prototype.next=function wrapperNext(){this.__values__===a&&(this.__values__=toArray(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?a:this.__values__[this.__index__++]}},lodash.prototype.plant=function wrapperPlant(e){for(var t,r=this;r instanceof baseLodash;){var n=wrapperClone(r);n.__index__=0,n.__values__=a,t?i.__wrapped__=n:t=n;var i=n;r=r.__wrapped__}return i.__wrapped__=e,t},lodash.prototype.reverse=function wrapperReverse(){var e=this.__wrapped__;if(e instanceof LazyWrapper){var t=e;return this.__actions__.length&&(t=new LazyWrapper(this)),(t=t.reverse()).__actions__.push({func:thru,args:[reverse],thisArg:a}),new LodashWrapper(t,this.__chain__)}return this.thru(reverse)},lodash.prototype.toJSON=lodash.prototype.valueOf=lodash.prototype.value=function wrapperValue(){return baseWrapperValue(this.__wrapped__,this.__actions__)},lodash.prototype.first=lodash.prototype.head,Ft&&(lodash.prototype[Ft]=function wrapperToIterator(){return this}),lodash}();jt._=Xt,(i=function(){return Xt}.call(t,r,t,n))===a||(n.exports=i)}).call(this)}).call(this,r(18),r(77)(e))},,,function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},function(e,t){(function(t){e.exports=t}).call(this,{})},function(e,t,r){"use strict";var n=function(){function defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&defineProperties(e.prototype,t),r&&defineProperties(e,r),e}}();var i=function(e){function Gist(e,t,r){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,Gist);var n=function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(Gist.__proto__||Object.getPrototypeOf(Gist)).call(this,t,r));return n.__id=e,n}return function _inherits(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(Gist,e),n(Gist,[{key:"read",value:function read(e){return this._request("GET","/gists/"+this.__id,null,e)}},{key:"create",value:function create(e,t){var r=this;return this._request("POST","/gists",e,t).then((function(e){return r.__id=e.data.id,e}))}},{key:"delete",value:function _delete(e){return this._request("DELETE","/gists/"+this.__id,null,e)}},{key:"fork",value:function fork(e){return this._request("POST","/gists/"+this.__id+"/forks",null,e)}},{key:"update",value:function update(e,t){return this._request("PATCH","/gists/"+this.__id,e,t)}},{key:"star",value:function star(e){return this._request("PUT","/gists/"+this.__id+"/star",null,e)}},{key:"unstar",value:function unstar(e){return this._request("DELETE","/gists/"+this.__id+"/star",null,e)}},{key:"isStarred",value:function isStarred(e){return this._request204or404("/gists/"+this.__id+"/star",null,e)}},{key:"listCommits",value:function listCommits(e){return this._requestAllPages("/gists/"+this.__id+"/commits",null,e)}},{key:"getRevision",value:function getRevision(e,t){return this._request("GET","/gists/"+this.__id+"/"+e,null,t)}},{key:"listComments",value:function listComments(e){return this._requestAllPages("/gists/"+this.__id+"/comments",null,e)}},{key:"getComment",value:function getComment(e,t){return this._request("GET","/gists/"+this.__id+"/comments/"+e,null,t)}},{key:"createComment",value:function createComment(e,t){return this._request("POST","/gists/"+this.__id+"/comments",{body:e},t)}},{key:"editComment",value:function editComment(e,t,r){return this._request("PATCH","/gists/"+this.__id+"/comments/"+e,{body:t},r)}},{key:"deleteComment",value:function deleteComment(e,t){return this._request("DELETE","/gists/"+this.__id+"/comments/"+e,null,t)}}]),Gist}(function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(31)).default);e.exports=i},function(e,t,r){e.exports=r(494)},function(e,t,r){"use strict";var n=r(25),i=r(195),a=r(496),o=r(201);function createInstance(e){var t=new a(e),r=i(a.prototype.request,t);return n.extend(r,a.prototype,t),n.extend(r,t),r}var s=createInstance(r(198));s.Axios=a,s.create=function create(e){return createInstance(o(s.defaults,e))},s.Cancel=r(202),s.CancelToken=r(508),s.isCancel=r(197),s.all=function all(e){return Promise.all(e)},s.spread=r(509),e.exports=s,e.exports.default=s},function(e,t){e.exports=function isBuffer(e){return null!=e&&null!=e.constructor&&"function"===typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}},function(e,t,r){"use strict";var n=r(25),i=r(196),a=r(497),o=r(498),s=r(201);function Axios(e){this.defaults=e,this.interceptors={request:new a,response:new a}}Axios.prototype.request=function request(e){"string"===typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=s(this.defaults,e)).method=e.method?e.method.toLowerCase():"get";var t=[o,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach((function unshiftRequestInterceptors(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function pushResponseInterceptors(e){t.push(e.fulfilled,e.rejected)}));t.length;)r=r.then(t.shift(),t.shift());return r},Axios.prototype.getUri=function getUri(e){return e=s(this.defaults,e),i(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function forEachMethodNoData(e){Axios.prototype[e]=function(t,r){return this.request(n.merge(r||{},{method:e,url:t}))}})),n.forEach(["post","put","patch"],(function forEachMethodWithData(e){Axios.prototype[e]=function(t,r,i){return this.request(n.merge(i||{},{method:e,url:t,data:r}))}})),e.exports=Axios},function(e,t,r){"use strict";var n=r(25);function InterceptorManager(){this.handlers=[]}InterceptorManager.prototype.use=function use(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},InterceptorManager.prototype.eject=function eject(e){this.handlers[e]&&(this.handlers[e]=null)},InterceptorManager.prototype.forEach=function forEach(e){n.forEach(this.handlers,(function forEachHandler(t){null!==t&&e(t)}))},e.exports=InterceptorManager},function(e,t,r){"use strict";var n=r(25),i=r(499),a=r(197),o=r(198),s=r(506),u=r(507);function throwIfCancellationRequested(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function dispatchRequest(e){return throwIfCancellationRequested(e),e.baseURL&&!s(e.url)&&(e.url=u(e.baseURL,e.url)),e.headers=e.headers||{},e.data=i(e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),n.forEach(["delete","get","head","post","put","patch","common"],(function cleanHeaderConfig(t){delete e.headers[t]})),(e.adapter||o.adapter)(e).then((function onAdapterResolution(t){return throwIfCancellationRequested(e),t.data=i(t.data,t.headers,e.transformResponse),t}),(function onAdapterRejection(t){return a(t)||(throwIfCancellationRequested(e),t&&t.response&&(t.response.data=i(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},function(e,t,r){"use strict";var n=r(25);e.exports=function transformData(e,t,r){return n.forEach(r,(function transform(r){e=r(e,t)})),e}},function(e,t,r){"use strict";var n=r(25);e.exports=function normalizeHeaderName(e,t){n.forEach(e,(function processHeader(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},function(e,t,r){"use strict";var n=r(200);e.exports=function settle(e,t,r){var i=r.config.validateStatus;!i||i(r.status)?e(r):t(n("Request failed with status code "+r.status,r.config,null,r.request,r))}},function(e,t,r){"use strict";e.exports=function enhanceError(e,t,r,n,i){return e.config=t,r&&(e.code=r),e.request=n,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},function(e,t,r){"use strict";var n=r(25),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function parseHeaders(e){var t,r,a,o={};return e?(n.forEach(e.split("\n"),(function parser(e){if(a=e.indexOf(":"),t=n.trim(e.substr(0,a)).toLowerCase(),r=n.trim(e.substr(a+1)),t){if(o[t]&&i.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([r]):o[t]?o[t]+", "+r:r}})),o):o}},function(e,t,r){"use strict";var n=r(25);e.exports=n.isStandardBrowserEnv()?function standardBrowserEnv(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function resolveURL(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=resolveURL(window.location.href),function isURLSameOrigin(t){var r=n.isString(t)?resolveURL(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function isURLSameOrigin(){return!0}},function(e,t,r){"use strict";var n=r(25);e.exports=n.isStandardBrowserEnv()?function standardBrowserEnv(){return{write:function write(e,t,r,i,a,o){var s=[];s.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),n.isString(i)&&s.push("path="+i),n.isString(a)&&s.push("domain="+a),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read:function read(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function remove(e){this.write(e,"",Date.now()-864e5)}}}():{write:function write(){},read:function read(){return null},remove:function remove(){}}},function(e,t,r){"use strict";e.exports=function isAbsoluteURL(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,r){"use strict";e.exports=function combineURLs(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,r){"use strict";var n=r(202);function CancelToken(e){if("function"!==typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function promiseExecutor(e){t=e}));var r=this;e((function cancel(e){r.reason||(r.reason=new n(e),t(r.reason))}))}CancelToken.prototype.throwIfRequested=function throwIfRequested(){if(this.reason)throw this.reason},CancelToken.source=function source(){var e;return{token:new CancelToken((function executor(t){e=t})),cancel:e}},e.exports=CancelToken},function(e,t,r){"use strict";e.exports=function spread(e){return function wrap(t){return e.apply(null,t)}}},function(e,t,r){var n;function createDebug(e){function debug(){if(debug.enabled){var e=debug,r=+new Date,i=r-(n||r);e.diff=i,e.prev=n,e.curr=r,n=r;for(var a=new Array(arguments.length),o=0;o<a.length;o++)a[o]=arguments[o];a[0]=t.coerce(a[0]),"string"!==typeof a[0]&&a.unshift("%O");var s=0;a[0]=a[0].replace(/%([a-zA-Z%])/g,(function(r,n){if("%%"===r)return r;s++;var i=t.formatters[n];if("function"===typeof i){var o=a[s];r=i.call(e,o),a.splice(s,1),s--}return r})),t.formatArgs.call(e,a),(debug.log||t.log||console.log.bind(console)).apply(e,a)}}return debug.namespace=e,debug.enabled=t.enabled(e),debug.useColors=t.useColors(),debug.color=function selectColor(e){var r,n=0;for(r in e)n=(n<<5)-n+e.charCodeAt(r),n|=0;return t.colors[Math.abs(n)%t.colors.length]}(e),"function"===typeof t.init&&t.init(debug),debug}(t=e.exports=createDebug.debug=createDebug.default=createDebug).coerce=function coerce(e){return e instanceof Error?e.stack||e.message:e},t.disable=function disable(){t.enable("")},t.enable=function enable(e){t.save(e),t.names=[],t.skips=[];for(var r=("string"===typeof e?e:"").split(/[\s,]+/),n=r.length,i=0;i<n;i++)r[i]&&("-"===(e=r[i].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function enabled(e){var r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r(203),t.names=[],t.skips=[],t.formatters={}},function(e,t,r){"use strict";var n=function(){function defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&defineProperties(e.prototype,t),r&&defineProperties(e,r),e}}(),i=_interopRequireDefault(r(31));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var a=(0,_interopRequireDefault(r(58)).default)("github:user"),o=function(e){function User(e,t,r){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,User);var n=function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(User.__proto__||Object.getPrototypeOf(User)).call(this,t,r));return n.__user=e,n}return function _inherits(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(User,e),n(User,[{key:"__getScopedUrl",value:function __getScopedUrl(e){if(this.__user)return e?"/users/"+this.__user+"/"+e:"/users/"+this.__user;switch(e){case"":return"/user";case"notifications":case"gists":return"/"+e;default:return"/user/"+e}}},{key:"listRepos",value:function listRepos(e,t){return"function"===typeof e&&(t=e,e={}),e=this._getOptionsWithDefaults(e),a("Fetching repositories with options: "+JSON.stringify(e)),this._requestAllPages(this.__getScopedUrl("repos"),e,t)}},{key:"listOrgs",value:function listOrgs(e){return this._request("GET",this.__getScopedUrl("orgs"),null,e)}},{key:"listFollowers",value:function listFollowers(e){return this._request("GET",this.__getScopedUrl("followers"),null,e)}},{key:"listFollowing",value:function listFollowing(e){return this._request("GET",this.__getScopedUrl("following"),null,e)}},{key:"listGists",value:function listGists(e){return this._request("GET",this.__getScopedUrl("gists"),null,e)}},{key:"listNotifications",value:function listNotifications(e,t){return"function"===typeof(e=e||{})&&(t=e,e={}),e.since=this._dateToISO(e.since),e.before=this._dateToISO(e.before),this._request("GET",this.__getScopedUrl("notifications"),e,t)}},{key:"getProfile",value:function getProfile(e){return this._request("GET",this.__getScopedUrl(""),null,e)}},{key:"listStarredRepos",value:function listStarredRepos(e){var t=this._getOptionsWithDefaults();return this._requestAllPages(this.__getScopedUrl("starred"),t,e)}},{key:"listStarredGists",value:function listStarredGists(e,t){return"function"===typeof(e=e||{})&&(t=e,e={}),e.since=this._dateToISO(e.since),this._request("GET","/gists/starred",e,t)}},{key:"getEmails",value:function getEmails(e){return this._request("GET","/user/emails",null,e)}},{key:"follow",value:function follow(e,t){return this._request("PUT","/user/following/"+e,null,t)}},{key:"unfollow",value:function unfollow(e,t){return this._request("DELETE","/user/following/"+e,null,t)}},{key:"createRepo",value:function createRepo(e,t){return this._request("POST","/user/repos",e,t)}}]),User}(i.default);e.exports=o},function(e,t,r){"use strict";var n=function(){function defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&defineProperties(e.prototype,t),r&&defineProperties(e,r),e}}();var i=function(e){function Issue(e,t,r){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,Issue);var n=function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(Issue.__proto__||Object.getPrototypeOf(Issue)).call(this,t,r));return n.__repository=e,n}return function _inherits(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(Issue,e),n(Issue,[{key:"createIssue",value:function createIssue(e,t){return this._request("POST","/repos/"+this.__repository+"/issues",e,t)}},{key:"listIssues",value:function listIssues(e,t){return this._requestAllPages("/repos/"+this.__repository+"/issues",e,t)}},{key:"listIssueEvents",value:function listIssueEvents(e,t){return this._request("GET","/repos/"+this.__repository+"/issues/"+e+"/events",null,t)}},{key:"listIssueComments",value:function listIssueComments(e,t){return this._request("GET","/repos/"+this.__repository+"/issues/"+e+"/comments",null,t)}},{key:"getIssueComment",value:function getIssueComment(e,t){return this._request("GET","/repos/"+this.__repository+"/issues/comments/"+e,null,t)}},{key:"createIssueComment",value:function createIssueComment(e,t,r){return this._request("POST","/repos/"+this.__repository+"/issues/"+e+"/comments",{body:t},r)}},{key:"editIssueComment",value:function editIssueComment(e,t,r){return this._request("PATCH","/repos/"+this.__repository+"/issues/comments/"+e,{body:t},r)}},{key:"deleteIssueComment",value:function deleteIssueComment(e,t){return this._request("DELETE","/repos/"+this.__repository+"/issues/comments/"+e,null,t)}},{key:"editIssue",value:function editIssue(e,t,r){return this._request("PATCH","/repos/"+this.__repository+"/issues/"+e,t,r)}},{key:"getIssue",value:function getIssue(e,t){return this._request("GET","/repos/"+this.__repository+"/issues/"+e,null,t)}},{key:"listMilestones",value:function listMilestones(e,t){return this._request("GET","/repos/"+this.__repository+"/milestones",e,t)}},{key:"getMilestone",value:function getMilestone(e,t){return this._request("GET","/repos/"+this.__repository+"/milestones/"+e,null,t)}},{key:"createMilestone",value:function createMilestone(e,t){return this._request("POST","/repos/"+this.__repository+"/milestones",e,t)}},{key:"editMilestone",value:function editMilestone(e,t,r){return this._request("PATCH","/repos/"+this.__repository+"/milestones/"+e,t,r)}},{key:"deleteMilestone",value:function deleteMilestone(e,t){return this._request("DELETE","/repos/"+this.__repository+"/milestones/"+e,null,t)}},{key:"createLabel",value:function createLabel(e,t){return this._request("POST","/repos/"+this.__repository+"/labels",e,t)}},{key:"listLabels",value:function listLabels(e,t){return this._request("GET","/repos/"+this.__repository+"/labels",e,t)}},{key:"getLabel",value:function getLabel(e,t){return this._request("GET","/repos/"+this.__repository+"/labels/"+e,null,t)}},{key:"editLabel",value:function editLabel(e,t,r){return this._request("PATCH","/repos/"+this.__repository+"/labels/"+e,t,r)}},{key:"deleteLabel",value:function deleteLabel(e,t){return this._request("DELETE","/repos/"+this.__repository+"/labels/"+e,null,t)}}]),Issue}(function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(31)).default);e.exports=i},function(e,t,r){"use strict";var n=function(){function defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&defineProperties(e.prototype,t),r&&defineProperties(e,r),e}}(),i=_interopRequireDefault(r(31));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var a=(0,_interopRequireDefault(r(58)).default)("github:search"),o=function(e){function Search(e,t,r){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,Search);var n=function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(Search.__proto__||Object.getPrototypeOf(Search)).call(this,t,r));return n.__defaults=n._getOptionsWithDefaults(e),n}return function _inherits(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(Search,e),n(Search,[{key:"_search",value:function _search(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,i={};return Object.keys(this.__defaults).forEach((function(e){i[e]=t.__defaults[e]})),Object.keys(r).forEach((function(e){i[e]=r[e]})),a("searching "+e+" with options:",i),this._requestAllPages("/search/"+e,i,n)}},{key:"forRepositories",value:function forRepositories(e,t){return this._search("repositories",e,t)}},{key:"forCode",value:function forCode(e,t){return this._search("code",e,t)}},{key:"forIssues",value:function forIssues(e,t){return this._search("issues",e,t)}},{key:"forUsers",value:function forUsers(e,t){return this._search("users",e,t)}}]),Search}(i.default);e.exports=o},function(e,t,r){"use strict";var n=function(){function defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&defineProperties(e.prototype,t),r&&defineProperties(e,r),e}}();var i=function(e){function RateLimit(e,t){return function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,RateLimit),function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(RateLimit.__proto__||Object.getPrototypeOf(RateLimit)).call(this,e,t))}return function _inherits(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(RateLimit,e),n(RateLimit,[{key:"getRateLimit",value:function getRateLimit(e){return this._request("GET","/rate_limit",null,e)}}]),RateLimit}(function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(31)).default);e.exports=i},function(e,t,r){"use strict";(function(t){var n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&defineProperties(e.prototype,t),r&&defineProperties(e,r),e}}(),a=_interopRequireDefault(r(31)),o=_interopRequireDefault(r(516)),s=r(204);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var u=(0,_interopRequireDefault(r(58)).default)("github:repository"),l=function(e){function Repository(e,t,r){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,Repository);var n=function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(Repository.__proto__||Object.getPrototypeOf(Repository)).call(this,t,r));return n.__fullname=e,n.__currentTree={branch:null,sha:null},n}return function _inherits(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(Repository,e),i(Repository,[{key:"getRef",value:function getRef(e,t){return this._request("GET","/repos/"+this.__fullname+"/git/refs/"+e,null,t)}},{key:"createRef",value:function createRef(e,t){return this._request("POST","/repos/"+this.__fullname+"/git/refs",e,t)}},{key:"deleteRef",value:function deleteRef(e,t){return this._request("DELETE","/repos/"+this.__fullname+"/git/refs/"+e,null,t)}},{key:"deleteRepo",value:function deleteRepo(e){return this._request("DELETE","/repos/"+this.__fullname,null,e)}},{key:"listTags",value:function listTags(e){return this._request("GET","/repos/"+this.__fullname+"/tags",null,e)}},{key:"listPullRequests",value:function listPullRequests(e,t){return e=e||{},this._request("GET","/repos/"+this.__fullname+"/pulls",e,t)}},{key:"getPullRequest",value:function getPullRequest(e,t){return this._request("GET","/repos/"+this.__fullname+"/pulls/"+e,null,t)}},{key:"listPullRequestFiles",value:function listPullRequestFiles(e,t){return this._request("GET","/repos/"+this.__fullname+"/pulls/"+e+"/files",null,t)}},{key:"compareBranches",value:function compareBranches(e,t,r){return this._request("GET","/repos/"+this.__fullname+"/compare/"+e+"..."+t,null,r)}},{key:"listBranches",value:function listBranches(e){return this._request("GET","/repos/"+this.__fullname+"/branches",null,e)}},{key:"getBlob",value:function getBlob(e,t){return this._request("GET","/repos/"+this.__fullname+"/git/blobs/"+e,null,t,"raw")}},{key:"getBranch",value:function getBranch(e,t){return this._request("GET","/repos/"+this.__fullname+"/branches/"+e,null,t)}},{key:"getCommit",value:function getCommit(e,t){return this._request("GET","/repos/"+this.__fullname+"/git/commits/"+e,null,t)}},{key:"listCommits",value:function listCommits(e,t){return"function"===typeof(e=e||{})&&(t=e,e={}),e.since=this._dateToISO(e.since),e.until=this._dateToISO(e.until),this._request("GET","/repos/"+this.__fullname+"/commits",e,t)}},{key:"getSingleCommit",value:function getSingleCommit(e,t){return e=e||"",this._request("GET","/repos/"+this.__fullname+"/commits/"+e,null,t)}},{key:"getSha",value:function getSha(e,t,r){return e=e?"?ref="+e:"",this._request("GET","/repos/"+this.__fullname+"/contents/"+t+e,null,r)}},{key:"listStatuses",value:function listStatuses(e,t){return this._request("GET","/repos/"+this.__fullname+"/commits/"+e+"/statuses",null,t)}},{key:"getCombinedStatus",value:function getCombinedStatus(e,t){return this._request("GET","/repos/"+this.__fullname+"/commits/"+e+"/status",null,t)}},{key:"getTree",value:function getTree(e,t){return this._request("GET","/repos/"+this.__fullname+"/git/trees/"+e,null,t)}},{key:"createBlob",value:function createBlob(e,t){var r=this._getContentObject(e);return u("sending content",r),this._request("POST","/repos/"+this.__fullname+"/git/blobs",r,t)}},{key:"_getContentObject",value:function _getContentObject(e){if("string"===typeof e)return u("contet is a string"),{content:o.default.encode(e),encoding:"utf-8"};if("undefined"!==typeof t&&e instanceof t)return u("We appear to be in Node"),{content:e.toString("base64"),encoding:"base64"};if("undefined"!==typeof Blob&&e instanceof Blob)return u("We appear to be in the browser"),{content:s.Base64.encode(e),encoding:"base64"};throw u("Not sure what this content is: "+("undefined"===typeof e?"undefined":n(e))+", "+JSON.stringify(e)),new Error("Unknown content passed to postBlob. Must be string or Buffer (node) or Blob (web)")}},{key:"updateTree",value:function updateTree(e,t,r,n){var i={base_tree:e,tree:[{path:t,sha:r,mode:"100644",type:"blob"}]};return this._request("POST","/repos/"+this.__fullname+"/git/trees",i,n)}},{key:"createTree",value:function createTree(e,t,r){return this._request("POST","/repos/"+this.__fullname+"/git/trees",{tree:e,base_tree:t},r)}},{key:"commit",value:function commit(e,t,r,n,i){var a=this;"function"===typeof n&&(i=n,n={});var o={message:r,tree:t,parents:[e]};return o=Object.assign({},n,o),this._request("POST","/repos/"+this.__fullname+"/git/commits",o,i).then((function(e){return a.__currentTree.sha=e.data.sha,e}))}},{key:"updateHead",value:function updateHead(e,t,r,n){return this._request("PATCH","/repos/"+this.__fullname+"/git/refs/"+e,{sha:t,force:r},n)}},{key:"updateStatus",value:function updateStatus(e,t,r){return this._request("POST","/repos/"+this.__fullname+"/statuses/"+e,t,r)}},{key:"updateRepository",value:function updateRepository(e,t){return this._request("PATCH","/repos/"+this.__fullname,e,t)}},{key:"getDetails",value:function getDetails(e){return this._request("GET","/repos/"+this.__fullname,null,e)}},{key:"getContributors",value:function getContributors(e){return this._request("GET","/repos/"+this.__fullname+"/contributors",null,e)}},{key:"getContributorStats",value:function getContributorStats(e){return this._request("GET","/repos/"+this.__fullname+"/stats/contributors",null,e)}},{key:"getCollaborators",value:function getCollaborators(e){return this._request("GET","/repos/"+this.__fullname+"/collaborators",null,e)}},{key:"isCollaborator",value:function isCollaborator(e,t){return this._request("GET","/repos/"+this.__fullname+"/collaborators/"+e,null,t)}},{key:"getContents",value:function getContents(e,t,r,n){return t=t?""+encodeURI(t):"",this._request("GET","/repos/"+this.__fullname+"/contents/"+t,{ref:e},n,r)}},{key:"getReadme",value:function getReadme(e,t,r){return this._request("GET","/repos/"+this.__fullname+"/readme",{ref:e},r,t)}},{key:"fork",value:function fork(e){return this._request("POST","/repos/"+this.__fullname+"/forks",null,e)}},{key:"forkToOrg",value:function forkToOrg(e,t){return this._request("POST","/repos/"+this.__fullname+"/forks?organization="+e,null,t)}},{key:"listForks",value:function listForks(e){return this._request("GET","/repos/"+this.__fullname+"/forks",null,e)}},{key:"createBranch",value:function createBranch(e,t,r){var n=this;return"function"===typeof t&&(r=t,t=e,e="master"),this.getRef("heads/"+e).then((function(e){var i=e.data.object.sha;return n.createRef({sha:i,ref:"refs/heads/"+t},r)}))}},{key:"createPullRequest",value:function createPullRequest(e,t){return this._request("POST","/repos/"+this.__fullname+"/pulls",e,t)}},{key:"updatePullRequest",value:function updatePullRequest(e,t,r){return this._request("PATCH","/repos/"+this.__fullname+"/pulls/"+e,t,r)}},{key:"listHooks",value:function listHooks(e){return this._request("GET","/repos/"+this.__fullname+"/hooks",null,e)}},{key:"getHook",value:function getHook(e,t){return this._request("GET","/repos/"+this.__fullname+"/hooks/"+e,null,t)}},{key:"createHook",value:function createHook(e,t){return this._request("POST","/repos/"+this.__fullname+"/hooks",e,t)}},{key:"updateHook",value:function updateHook(e,t,r){return this._request("PATCH","/repos/"+this.__fullname+"/hooks/"+e,t,r)}},{key:"deleteHook",value:function deleteHook(e,t){return this._request("DELETE","/repos/"+this.__fullname+"/hooks/"+e,null,t)}},{key:"listKeys",value:function listKeys(e){return this._request("GET","/repos/"+this.__fullname+"/keys",null,e)}},{key:"getKey",value:function getKey(e,t){return this._request("GET","/repos/"+this.__fullname+"/keys/"+e,null,t)}},{key:"createKey",value:function createKey(e,t){return this._request("POST","/repos/"+this.__fullname+"/keys",e,t)}},{key:"deleteKey",value:function deleteKey(e,t){return this._request("DELETE","/repos/"+this.__fullname+"/keys/"+e,null,t)}},{key:"deleteFile",value:function deleteFile(e,t,r){var n=this;return this.getSha(e,t).then((function(i){var a={message:"Delete the file at '"+t+"'",sha:i.data.sha,branch:e};return n._request("DELETE","/repos/"+n.__fullname+"/contents/"+t,a,r)}))}},{key:"move",value:function move(e,t,r,n){var i=this,a=void 0;return this.getRef("heads/"+e).then((function(e){var t=e.data.object;return i.getTree(t.sha+"?recursive=true")})).then((function(e){var n=e.data,o=n.tree,s=n.sha;a=s;var u=o.map((function(e){return e.path===t&&(e.path=r),"tree"===e.type&&delete e.sha,e}));return i.createTree(u)})).then((function(e){var n=e.data;return i.commit(a,n.sha,"Renamed '"+t+"' to '"+r+"'")})).then((function(t){var r=t.data;return i.updateHead("heads/"+e,r.sha,!0,n)}))}},{key:"writeFile",value:function writeFile(e,t,r,n,i,a){var o=this;"function"===typeof i&&(a=i,i={});var u=t?encodeURI(t):"",l=!1!==i.encode,c={branch:e,message:n,author:i.author,committer:i.committer,content:l?s.Base64.encode(r):r};return this.getSha(e,u).then((function(e){return c.sha=e.data.sha,o._request("PUT","/repos/"+o.__fullname+"/contents/"+u,c,a)}),(function(){return o._request("PUT","/repos/"+o.__fullname+"/contents/"+u,c,a)}))}},{key:"isStarred",value:function isStarred(e){return this._request204or404("/user/starred/"+this.__fullname,null,e)}},{key:"star",value:function star(e){return this._request("PUT","/user/starred/"+this.__fullname,null,e)}},{key:"unstar",value:function unstar(e){return this._request("DELETE","/user/starred/"+this.__fullname,null,e)}},{key:"createRelease",value:function createRelease(e,t){return this._request("POST","/repos/"+this.__fullname+"/releases",e,t)}},{key:"updateRelease",value:function updateRelease(e,t,r){return this._request("PATCH","/repos/"+this.__fullname+"/releases/"+e,t,r)}},{key:"listReleases",value:function listReleases(e){return this._request("GET","/repos/"+this.__fullname+"/releases",null,e)}},{key:"getRelease",value:function getRelease(e,t){return this._request("GET","/repos/"+this.__fullname+"/releases/"+e,null,t)}},{key:"deleteRelease",value:function deleteRelease(e,t){return this._request("DELETE","/repos/"+this.__fullname+"/releases/"+e,null,t)}},{key:"mergePullRequest",value:function mergePullRequest(e,t,r){return this._request("PUT","/repos/"+this.__fullname+"/pulls/"+e+"/merge",t,r)}},{key:"listProjects",value:function listProjects(e){return this._requestAllPages("/repos/"+this.__fullname+"/projects",{AcceptHeader:"inertia-preview"},e)}},{key:"createProject",value:function createProject(e,t){return(e=e||{}).AcceptHeader="inertia-preview",this._request("POST","/repos/"+this.__fullname+"/projects",e,t)}}]),Repository}(a.default);e.exports=l}).call(this,r(21).Buffer)},function(e,t,r){(function(e,n){var i;!function(a){var o=t,s=(e&&e.exports,"object"==typeof n&&n);s.global!==s&&s.window;var u,l,c,f=String.fromCharCode;function ucs2decode(e){for(var t,r,n=[],i=0,a=e.length;i<a;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<a?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function checkScalarValue(e){if(e>=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}function createByte(e,t){return f(e>>t&63|128)}function encodeCodePoint(e){if(0==(4294967168&e))return f(e);var t="";return 0==(4294965248&e)?t=f(e>>6&31|192):0==(4294901760&e)?(checkScalarValue(e),t=f(e>>12&15|224),t+=createByte(e,6)):0==(4292870144&e)&&(t=f(e>>18&7|240),t+=createByte(e,12),t+=createByte(e,6)),t+=f(63&e|128)}function readContinuationByte(){if(c>=l)throw Error("Invalid byte index");var e=255&u[c];if(c++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function decodeSymbol(){var e,t;if(c>l)throw Error("Invalid byte index");if(c==l)return!1;if(e=255&u[c],c++,0==(128&e))return e;if(192==(224&e)){if((t=(31&e)<<6|readContinuationByte())>=128)return t;throw Error("Invalid continuation byte")}if(224==(240&e)){if((t=(15&e)<<12|readContinuationByte()<<6|readContinuationByte())>=2048)return checkScalarValue(t),t;throw Error("Invalid continuation byte")}if(240==(248&e)&&(t=(7&e)<<18|readContinuationByte()<<12|readContinuationByte()<<6|readContinuationByte())>=65536&&t<=1114111)return t;throw Error("Invalid UTF-8 detected")}var d={version:"2.1.2",encode:function utf8encode(e){for(var t=ucs2decode(e),r=t.length,n=-1,i="";++n<r;)i+=encodeCodePoint(t[n]);return i},decode:function utf8decode(e){u=ucs2decode(e),l=u.length,c=0;for(var t,r=[];!1!==(t=decodeSymbol());)r.push(t);return function ucs2encode(e){for(var t,r=e.length,n=-1,i="";++n<r;)(t=e[n])>65535&&(i+=f((t-=65536)>>>10&1023|55296),t=56320|1023&t),i+=f(t);return i}(r)}};void 0===(i=function(){return d}.call(t,r,t,e))||(e.exports=i)}()}).call(this,r(77)(e),r(18))},function(e,t,r){"use strict";var n=function(){function defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&defineProperties(e.prototype,t),r&&defineProperties(e,r),e}}();var i=function(e){function Organization(e,t,r){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,Organization);var n=function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(Organization.__proto__||Object.getPrototypeOf(Organization)).call(this,t,r));return n.__name=e,n}return function _inherits(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(Organization,e),n(Organization,[{key:"createRepo",value:function createRepo(e,t){return this._request("POST","/orgs/"+this.__name+"/repos",e,t)}},{key:"getRepos",value:function getRepos(e){var t=this._getOptionsWithDefaults({direction:"desc"});return this._requestAllPages("/orgs/"+this.__name+"/repos",t,e)}},{key:"isMember",value:function isMember(e,t){return this._request204or404("/orgs/"+this.__name+"/members/"+e,null,t)}},{key:"listMembers",value:function listMembers(e,t){return this._request("GET","/orgs/"+this.__name+"/members",e,t)}},{key:"getTeams",value:function getTeams(e){return this._requestAllPages("/orgs/"+this.__name+"/teams",void 0,e)}},{key:"createTeam",value:function createTeam(e,t){return this._request("POST","/orgs/"+this.__name+"/teams",e,t)}},{key:"listProjects",value:function listProjects(e){return this._requestAllPages("/orgs/"+this.__name+"/projects",{AcceptHeader:"inertia-preview"},e)}},{key:"createProject",value:function createProject(e,t){return(e=e||{}).AcceptHeader="inertia-preview",this._request("POST","/orgs/"+this.__name+"/projects",e,t)}}]),Organization}(function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(31)).default);e.exports=i},function(e,t,r){"use strict";var n=function(){function defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&defineProperties(e.prototype,t),r&&defineProperties(e,r),e}}(),i=_interopRequireDefault(r(31));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var a=(0,_interopRequireDefault(r(58)).default)("github:team"),o=function(e){function Team(e,t,r){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,Team);var n=function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(Team.__proto__||Object.getPrototypeOf(Team)).call(this,t,r));return n.__teamId=e,n}return function _inherits(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(Team,e),n(Team,[{key:"getTeam",value:function getTeam(e){return a("Fetching Team "+this.__teamId),this._request("Get","/teams/"+this.__teamId,void 0,e)}},{key:"listRepos",value:function listRepos(e){return a("Fetching repositories for Team "+this.__teamId),this._requestAllPages("/teams/"+this.__teamId+"/repos",void 0,e)}},{key:"editTeam",value:function editTeam(e,t){return a("Editing Team "+this.__teamId),this._request("PATCH","/teams/"+this.__teamId,e,t)}},{key:"listMembers",value:function listMembers(e,t){return a("Getting members of Team "+this.__teamId),this._requestAllPages("/teams/"+this.__teamId+"/members",e,t)}},{key:"getMembership",value:function getMembership(e,t){return a("Getting membership of user "+e+" in Team "+this.__teamId),this._request("GET","/teams/"+this.__teamId+"/memberships/"+e,void 0,t)}},{key:"addMembership",value:function addMembership(e,t,r){return a("Adding user "+e+" to Team "+this.__teamId),this._request("PUT","/teams/"+this.__teamId+"/memberships/"+e,t,r)}},{key:"isManagedRepo",value:function isManagedRepo(e,t,r){return a("Getting repo management by Team "+this.__teamId+" for repo "+e+"/"+t),this._request204or404("/teams/"+this.__teamId+"/repos/"+e+"/"+t,void 0,r)}},{key:"manageRepo",value:function manageRepo(e,t,r,n){return a("Adding or Updating repo management by Team "+this.__teamId+" for repo "+e+"/"+t),this._request204or404("/teams/"+this.__teamId+"/repos/"+e+"/"+t,r,n,"PUT")}},{key:"unmanageRepo",value:function unmanageRepo(e,t,r){return a("Remove repo management by Team "+this.__teamId+" for repo "+e+"/"+t),this._request204or404("/teams/"+this.__teamId+"/repos/"+e+"/"+t,void 0,r,"DELETE")}},{key:"deleteTeam",value:function deleteTeam(e){return a("Deleting Team "+this.__teamId),this._request204or404("/teams/"+this.__teamId,void 0,e,"DELETE")}}]),Team}(i.default);e.exports=o},function(e,t,r){"use strict";var n=function(){function defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&defineProperties(e.prototype,t),r&&defineProperties(e,r),e}}();var i=function(e){function Markdown(e,t){return function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,Markdown),function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(Markdown.__proto__||Object.getPrototypeOf(Markdown)).call(this,e,t))}return function _inherits(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(Markdown,e),n(Markdown,[{key:"render",value:function render(e,t){return this._request("POST","/markdown",e,t,!0)}}]),Markdown}(function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(31)).default);e.exports=i},function(e,t,r){"use strict";var n=function(){function defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&defineProperties(e.prototype,t),r&&defineProperties(e,r),e}}();var i=function(e){function Project(e,t,r){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,Project);var n=function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(Project.__proto__||Object.getPrototypeOf(Project)).call(this,t,r,"inertia-preview"));return n.__id=e,n}return function _inherits(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(Project,e),n(Project,[{key:"getProject",value:function getProject(e){return this._request("GET","/projects/"+this.__id,null,e)}},{key:"updateProject",value:function updateProject(e,t){return this._request("PATCH","/projects/"+this.__id,e,t)}},{key:"deleteProject",value:function deleteProject(e){return this._request("DELETE","/projects/"+this.__id,null,e)}},{key:"listProjectColumns",value:function listProjectColumns(e){return this._requestAllPages("/projects/"+this.__id+"/columns",null,e)}},{key:"getProjectColumn",value:function getProjectColumn(e,t){return this._request("GET","/projects/columns/"+e,null,t)}},{key:"createProjectColumn",value:function createProjectColumn(e,t){return this._request("POST","/projects/"+this.__id+"/columns",e,t)}},{key:"updateProjectColumn",value:function updateProjectColumn(e,t,r){return this._request("PATCH","/projects/columns/"+e,t,r)}},{key:"deleteProjectColumn",value:function deleteProjectColumn(e,t){return this._request("DELETE","/projects/columns/"+e,null,t)}},{key:"moveProjectColumn",value:function moveProjectColumn(e,t,r){return this._request("POST","/projects/columns/"+e+"/moves",{position:t},r)}},{key:"listProjectCards",value:function listProjectCards(e){var t=this;return this.listProjectColumns().then((function(e){var r=e.data;return Promise.all(r.map((function(e){return t._requestAllPages("/projects/columns/"+e.id+"/cards",null)})))})).then((function(t){var r=t.reduce((function(e,t){var r=t.data;return e.push.apply(e,function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}(r)),e}),[]);return e&&e(null,r),r})).catch((function(t){if(!e)throw t;e(t)}))}},{key:"listColumnCards",value:function listColumnCards(e,t){return this._requestAllPages("/projects/columns/"+e+"/cards",null,t)}},{key:"getProjectCard",value:function getProjectCard(e,t){return this._request("GET","/projects/columns/cards/"+e,null,t)}},{key:"createProjectCard",value:function createProjectCard(e,t,r){return this._request("POST","/projects/columns/"+e+"/cards",t,r)}},{key:"updateProjectCard",value:function updateProjectCard(e,t,r){return this._request("PATCH","/projects/columns/cards/"+e,t,r)}},{key:"deleteProjectCard",value:function deleteProjectCard(e,t){return this._request("DELETE","/projects/columns/cards/"+e,null,t)}},{key:"moveProjectCard",value:function moveProjectCard(e,t,r,n){return this._request("POST","/projects/columns/cards/"+e+"/moves",{position:t,column_id:r},n)}}]),Project}(function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(31)).default);e.exports=i},function(e,t,r){var n=r(205),i=r(79)("socket.io-client:url");e.exports=function url(e,t){var r=e;t=t||"undefined"!==typeof location&&location,null==e&&(e=t.protocol+"//"+t.host);"string"===typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?t.protocol+e:t.host+e),/^(https?|wss?):\/\//.test(e)||(i("protocol-less url %s",e),e="undefined"!==typeof t?t.protocol+"//"+e:"https://"+e),i("parse %s",e),r=n(e));r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443"));r.path=r.path||"/";var a=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+a+":"+r.port,r.href=r.protocol+"://"+a+(t&&t.port===r.port?"":":"+r.port),r}},function(e,t,r){var n=r(206);e.exports=function setup(e){function selectColor(e){for(var t=0,r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return createDebug.colors[Math.abs(t)%createDebug.colors.length]}function createDebug(e){var t;function debug(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];if(debug.enabled){var i=debug,a=Number(new Date),o=a-(t||a);i.diff=o,i.prev=t,i.curr=a,t=a,r[0]=createDebug.coerce(r[0]),"string"!==typeof r[0]&&r.unshift("%O");var s=0;r[0]=r[0].replace(/%([a-zA-Z%])/g,(function(e,t){if("%%"===e)return e;s++;var n=createDebug.formatters[t];if("function"===typeof n){var a=r[s];e=n.call(i,a),r.splice(s,1),s--}return e})),createDebug.formatArgs.call(i,r),(i.log||createDebug.log).apply(i,r)}}return debug.namespace=e,debug.enabled=createDebug.enabled(e),debug.useColors=createDebug.useColors(),debug.color=selectColor(e),debug.destroy=destroy,debug.extend=extend,"function"===typeof createDebug.init&&createDebug.init(debug),createDebug.instances.push(debug),debug}function destroy(){var e=createDebug.instances.indexOf(this);return-1!==e&&(createDebug.instances.splice(e,1),!0)}function extend(e,t){var r=createDebug(this.namespace+("undefined"===typeof t?":":t)+e);return r.log=this.log,r}function toNamespace(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return createDebug.debug=createDebug,createDebug.default=createDebug,createDebug.coerce=function coerce(e){if(e instanceof Error)return e.stack||e.message;return e},createDebug.disable=function disable(){var e=[].concat(n(createDebug.names.map(toNamespace)),n(createDebug.skips.map(toNamespace).map((function(e){return"-"+e})))).join(",");return createDebug.enable(""),e},createDebug.enable=function enable(e){var t;createDebug.save(e),createDebug.names=[],createDebug.skips=[];var r=("string"===typeof e?e:"").split(/[\s,]+/),n=r.length;for(t=0;t<n;t++)r[t]&&("-"===(e=r[t].replace(/\*/g,".*?"))[0]?createDebug.skips.push(new RegExp("^"+e.substr(1)+"$")):createDebug.names.push(new RegExp("^"+e+"$")));for(t=0;t<createDebug.instances.length;t++){var i=createDebug.instances[t];i.enabled=createDebug.enabled(i.namespace)}},createDebug.enabled=function enabled(e){if("*"===e[e.length-1])return!0;var t,r;for(t=0,r=createDebug.skips.length;t<r;t++)if(createDebug.skips[t].test(e))return!1;for(t=0,r=createDebug.names.length;t<r;t++)if(createDebug.names[t].test(e))return!0;return!1},createDebug.humanize=r(526),Object.keys(e).forEach((function(t){createDebug[t]=e[t]})),createDebug.instances=[],createDebug.names=[],createDebug.skips=[],createDebug.formatters={},createDebug.selectColor=selectColor,createDebug.enable(createDebug.load()),createDebug}},function(e,t){e.exports=function _arrayWithoutHoles(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}},function(e,t){e.exports=function _iterableToArray(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}},function(e,t){e.exports=function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(e,t){var r=1e3,n=60*r,i=60*n,a=24*i,o=7*a,s=365.25*a;function plural(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,t){t=t||{};var u=typeof e;if("string"===u&&e.length>0)return function parse(e){if((e=String(e)).length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var u=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return u*s;case"weeks":case"week":case"w":return u*o;case"days":case"day":case"d":return u*a;case"hours":case"hour":case"hrs":case"hr":case"h":return u*i;case"minutes":case"minute":case"mins":case"min":case"m":return u*n;case"seconds":case"second":case"secs":case"sec":case"s":return u*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:return}}(e);if("number"===u&&isFinite(e))return t.long?function fmtLong(e){var t=Math.abs(e);if(t>=a)return plural(e,t,a,"day");if(t>=i)return plural(e,t,i,"hour");if(t>=n)return plural(e,t,n,"minute");if(t>=r)return plural(e,t,r,"second");return e+" ms"}(e):function fmtShort(e){var t=Math.abs(e);if(t>=a)return Math.round(e/a)+"d";if(t>=i)return Math.round(e/i)+"h";if(t>=n)return Math.round(e/n)+"m";if(t>=r)return Math.round(e/r)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,r){(function(n){function load(){var e;try{e=t.storage.debug}catch(r){}return!e&&"undefined"!==typeof n&&"env"in n&&(e=Object({NODE_ENV:"production",PUBLIC_URL:"/cabana",REACT_APP_VIDEO_CDN:"https://cabana-video.azureedge.net"}).DEBUG),e}(t=e.exports=r(528)).log=function log(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function formatArgs(e){var r=this.useColors;if(e[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+e[0]+(r?"%c ":" ")+"+"+t.humanize(this.diff),!r)return;var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var i=0,a=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(i++,"%c"===e&&(a=i))})),e.splice(a,0,n)},t.save=function save(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(r){}},t.load=load,t.useColors=function useColors(){if("undefined"!==typeof window&&window.process&&"renderer"===window.process.type)return!0;if("undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!==typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!==typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:function localstorage(){try{return window.localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},t.enable(load())}).call(this,r(45))},function(e,t,r){function createDebug(e){var r;function debug(){if(debug.enabled){var e=debug,n=+new Date,i=n-(r||n);e.diff=i,e.prev=r,e.curr=n,r=n;for(var a=new Array(arguments.length),o=0;o<a.length;o++)a[o]=arguments[o];a[0]=t.coerce(a[0]),"string"!==typeof a[0]&&a.unshift("%O");var s=0;a[0]=a[0].replace(/%([a-zA-Z%])/g,(function(r,n){if("%%"===r)return r;s++;var i=t.formatters[n];if("function"===typeof i){var o=a[s];r=i.call(e,o),a.splice(s,1),s--}return r})),t.formatArgs.call(e,a),(debug.log||t.log||console.log.bind(console)).apply(e,a)}}return debug.namespace=e,debug.enabled=t.enabled(e),debug.useColors=t.useColors(),debug.color=function selectColor(e){var r,n=0;for(r in e)n=(n<<5)-n+e.charCodeAt(r),n|=0;return t.colors[Math.abs(n)%t.colors.length]}(e),debug.destroy=destroy,"function"===typeof t.init&&t.init(debug),t.instances.push(debug),debug}function destroy(){var e=t.instances.indexOf(this);return-1!==e&&(t.instances.splice(e,1),!0)}(t=e.exports=createDebug.debug=createDebug.default=createDebug).coerce=function coerce(e){return e instanceof Error?e.stack||e.message:e},t.disable=function disable(){t.enable("")},t.enable=function enable(e){var r;t.save(e),t.names=[],t.skips=[];var n=("string"===typeof e?e:"").split(/[\s,]+/),i=n.length;for(r=0;r<i;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")));for(r=0;r<t.instances.length;r++){var a=t.instances[r];a.enabled=t.enabled(a.namespace)}},t.enabled=function enabled(e){if("*"===e[e.length-1])return!0;var r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r(203),t.instances=[],t.names=[],t.skips=[],t.formatters={}},function(e,t,r){var n=r(207),i=r(208),a=Object.prototype.toString,o="function"===typeof Blob||"undefined"!==typeof Blob&&"[object BlobConstructor]"===a.call(Blob),s="function"===typeof File||"undefined"!==typeof File&&"[object FileConstructor]"===a.call(File);t.deconstructPacket=function(e){var t=[],r=e.data,a=e;return a.data=function _deconstructPacket(e,t){if(!e)return e;if(i(e)){var r={_placeholder:!0,num:t.length};return t.push(e),r}if(n(e)){for(var a=new Array(e.length),o=0;o<e.length;o++)a[o]=_deconstructPacket(e[o],t);return a}if("object"===typeof e&&!(e instanceof Date)){a={};for(var s in e)a[s]=_deconstructPacket(e[s],t);return a}return e}(r,t),a.attachments=t.length,{packet:a,buffers:t}},t.reconstructPacket=function(e,t){return e.data=function _reconstructPacket(e,t){if(!e)return e;if(e&&e._placeholder)return t[e.num];if(n(e))for(var r=0;r<e.length;r++)e[r]=_reconstructPacket(e[r],t);else if("object"===typeof e)for(var i in e)e[i]=_reconstructPacket(e[i],t);return e}(e.data,t),e.attachments=void 0,e},t.removeBlobs=function(e,t){var r=0,a=e;!function _removeBlobs(e,u,l){if(!e)return e;if(o&&e instanceof Blob||s&&e instanceof File){r++;var c=new FileReader;c.onload=function(){l?l[u]=this.result:a=this.result,--r||t(a)},c.readAsArrayBuffer(e)}else if(n(e))for(var f=0;f<e.length;f++)_removeBlobs(e[f],f,e);else if("object"===typeof e&&!i(e))for(var d in e)_removeBlobs(e[d],d,e)}(a),r||t(a)}},function(e,t,r){e.exports=r(531),e.exports.parser=r(52)},function(e,t,r){var n=r(210),i=r(51),a=r(82)("engine.io-client:socket"),o=r(214),s=r(52),u=r(205),l=r(80);function Socket(e,t){if(!(this instanceof Socket))return new Socket(e,t);t=t||{},e&&"object"===typeof e&&(t=e,e=null),e?(e=u(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=u(t.host).host),this.secure=null!=t.secure?t.secure:"undefined"!==typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.agent=t.agent||!1,this.hostname=t.hostname||("undefined"!==typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!==typeof location&&location.port?location.port:this.secure?443:80),this.query=t.query||{},"string"===typeof this.query&&(this.query=l.decode(this.query)),this.upgrade=!1!==t.upgrade,this.path=(t.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!t.forceJSONP,this.jsonp=!1!==t.jsonp,this.forceBase64=!!t.forceBase64,this.enablesXDR=!!t.enablesXDR,this.withCredentials=!1!==t.withCredentials,this.timestampParam=t.timestampParam||"t",this.timestampRequests=t.timestampRequests,this.transports=t.transports||["polling","websocket"],this.transportOptions=t.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=t.policyPort||843,this.rememberUpgrade=t.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=t.onlyBinaryUpgrades,this.perMessageDeflate=!1!==t.perMessageDeflate&&(t.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=t.pfx||null,this.key=t.key||null,this.passphrase=t.passphrase||null,this.cert=t.cert||null,this.ca=t.ca||null,this.ciphers=t.ciphers||null,this.rejectUnauthorized=void 0===t.rejectUnauthorized||t.rejectUnauthorized,this.forceNode=!!t.forceNode,this.isReactNative="undefined"!==typeof navigator&&"string"===typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),("undefined"===typeof self||this.isReactNative)&&(t.extraHeaders&&Object.keys(t.extraHeaders).length>0&&(this.extraHeaders=t.extraHeaders),t.localAddress&&(this.localAddress=t.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}e.exports=Socket,Socket.priorWebsocketSuccess=!1,i(Socket.prototype),Socket.protocol=s.protocol,Socket.Socket=Socket,Socket.Transport=r(133),Socket.transports=r(210),Socket.parser=r(52),Socket.prototype.createTransport=function(e){a('creating transport "%s"',e);var t=function clone(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}(this.query);t.EIO=s.protocol,t.transport=e;var r=this.transportOptions[e]||{};return this.id&&(t.sid=this.id),new n[e]({query:t,socket:this,agent:r.agent||this.agent,hostname:r.hostname||this.hostname,port:r.port||this.port,secure:r.secure||this.secure,path:r.path||this.path,forceJSONP:r.forceJSONP||this.forceJSONP,jsonp:r.jsonp||this.jsonp,forceBase64:r.forceBase64||this.forceBase64,enablesXDR:r.enablesXDR||this.enablesXDR,withCredentials:r.withCredentials||this.withCredentials,timestampRequests:r.timestampRequests||this.timestampRequests,timestampParam:r.timestampParam||this.timestampParam,policyPort:r.policyPort||this.policyPort,pfx:r.pfx||this.pfx,key:r.key||this.key,passphrase:r.passphrase||this.passphrase,cert:r.cert||this.cert,ca:r.ca||this.ca,ciphers:r.ciphers||this.ciphers,rejectUnauthorized:r.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:r.perMessageDeflate||this.perMessageDeflate,extraHeaders:r.extraHeaders||this.extraHeaders,forceNode:r.forceNode||this.forceNode,localAddress:r.localAddress||this.localAddress,requestTimeout:r.requestTimeout||this.requestTimeout,protocols:r.protocols||void 0,isReactNative:this.isReactNative})},Socket.prototype.open=function(){var e;if(this.rememberUpgrade&&Socket.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length){var t=this;return void setTimeout((function(){t.emit("error","No transports available")}),0)}e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(r){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)},Socket.prototype.setTransport=function(e){a("setting transport %s",e.name);var t=this;this.transport&&(a("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=e,e.on("drain",(function(){t.onDrain()})).on("packet",(function(e){t.onPacket(e)})).on("error",(function(e){t.onError(e)})).on("close",(function(){t.onClose("transport close")}))},Socket.prototype.probe=function(e){a('probing transport "%s"',e);var t=this.createTransport(e,{probe:1}),r=!1,n=this;function onTransportOpen(){if(n.onlyBinaryUpgrades){var i=!this.supportsBinary&&n.transport.supportsBinary;r=r||i}r||(a('probe transport "%s" opened',e),t.send([{type:"ping",data:"probe"}]),t.once("packet",(function(i){if(!r)if("pong"===i.type&&"probe"===i.data){if(a('probe transport "%s" pong',e),n.upgrading=!0,n.emit("upgrading",t),!t)return;Socket.priorWebsocketSuccess="websocket"===t.name,a('pausing current transport "%s"',n.transport.name),n.transport.pause((function(){r||"closed"!==n.readyState&&(a("changing transport and sending upgrade packet"),cleanup(),n.setTransport(t),t.send([{type:"upgrade"}]),n.emit("upgrade",t),t=null,n.upgrading=!1,n.flush())}))}else{a('probe transport "%s" failed',e);var o=new Error("probe error");o.transport=t.name,n.emit("upgradeError",o)}})))}function freezeTransport(){r||(r=!0,cleanup(),t.close(),t=null)}function onerror(r){var i=new Error("probe error: "+r);i.transport=t.name,freezeTransport(),a('probe transport "%s" failed because of error: %s',e,r),n.emit("upgradeError",i)}function onTransportClose(){onerror("transport closed")}function onclose(){onerror("socket closed")}function onupgrade(e){t&&e.name!==t.name&&(a('"%s" works - aborting "%s"',e.name,t.name),freezeTransport())}function cleanup(){t.removeListener("open",onTransportOpen),t.removeListener("error",onerror),t.removeListener("close",onTransportClose),n.removeListener("close",onclose),n.removeListener("upgrading",onupgrade)}Socket.priorWebsocketSuccess=!1,t.once("open",onTransportOpen),t.once("error",onerror),t.once("close",onTransportClose),this.once("close",onclose),this.once("upgrading",onupgrade),t.open()},Socket.prototype.onOpen=function(){if(a("socket open"),this.readyState="open",Socket.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){a("starting upgrade probes");for(var e=0,t=this.upgrades.length;e<t;e++)this.probe(this.upgrades[e])}},Socket.prototype.onPacket=function(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(a('socket receive: type "%s", data "%s"',e.type,e.data),this.emit("packet",e),this.emit("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"pong":this.setPing(),this.emit("pong");break;case"error":var t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emit("data",e.data),this.emit("message",e.data)}else a('packet received with socket readyState "%s"',this.readyState)},Socket.prototype.onHandshake=function(e){this.emit("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.onOpen(),"closed"!==this.readyState&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},Socket.prototype.onHeartbeat=function(e){clearTimeout(this.pingTimeoutTimer);var t=this;t.pingTimeoutTimer=setTimeout((function(){"closed"!==t.readyState&&t.onClose("ping timeout")}),e||t.pingInterval+t.pingTimeout)},Socket.prototype.setPing=function(){var e=this;clearTimeout(e.pingIntervalTimer),e.pingIntervalTimer=setTimeout((function(){a("writing ping packet - expecting pong within %sms",e.pingTimeout),e.ping(),e.onHeartbeat(e.pingTimeout)}),e.pingInterval)},Socket.prototype.ping=function(){var e=this;this.sendPacket("ping",(function(){e.emit("ping")}))},Socket.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emit("drain"):this.flush()},Socket.prototype.flush=function(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(a("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},Socket.prototype.write=Socket.prototype.send=function(e,t,r){return this.sendPacket("message",e,t,r),this},Socket.prototype.sendPacket=function(e,t,r,n){if("function"===typeof t&&(n=t,t=void 0),"function"===typeof r&&(n=r,r=null),"closing"!==this.readyState&&"closed"!==this.readyState){(r=r||{}).compress=!1!==r.compress;var i={type:e,data:t,options:r};this.emit("packetCreate",i),this.writeBuffer.push(i),n&&this.once("flush",n),this.flush()}},Socket.prototype.close=function(){if("opening"===this.readyState||"open"===this.readyState){this.readyState="closing";var e=this;this.writeBuffer.length?this.once("drain",(function(){this.upgrading?waitForUpgrade():close()})):this.upgrading?waitForUpgrade():close()}function close(){e.onClose("forced close"),a("socket closing - telling transport to close"),e.transport.close()}function cleanupAndClose(){e.removeListener("upgrade",cleanupAndClose),e.removeListener("upgradeError",cleanupAndClose),close()}function waitForUpgrade(){e.once("upgrade",cleanupAndClose),e.once("upgradeError",cleanupAndClose)}return this},Socket.prototype.onError=function(e){a("socket error %j",e),Socket.priorWebsocketSuccess=!1,this.emit("error",e),this.onClose("transport error",e)},Socket.prototype.onClose=function(e,t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){a('socket close with reason: "%s"',e);clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",e,t),this.writeBuffer=[],this.prevBufferLen=0}},Socket.prototype.filterUpgrades=function(e){for(var t=[],r=0,n=e.length;r<n;r++)~o(this.transports,e[r])&&t.push(e[r]);return t}},function(e,t){try{e.exports="undefined"!==typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(r){e.exports=!1}},function(e,t,r){var n=r(132),i=r(211),a=r(51),o=r(81),s=r(82)("engine.io-client:polling-xhr");function empty(){}function XHR(e){if(i.call(this,e),this.requestTimeout=e.requestTimeout,this.extraHeaders=e.extraHeaders,"undefined"!==typeof location){var t="https:"===location.protocol,r=location.port;r||(r=t?443:80),this.xd="undefined"!==typeof location&&e.hostname!==location.hostname||r!==e.port,this.xs=e.secure!==t}}function Request(e){this.method=e.method||"GET",this.uri=e.uri,this.xd=!!e.xd,this.xs=!!e.xs,this.async=!1!==e.async,this.data=void 0!==e.data?e.data:null,this.agent=e.agent,this.isBinary=e.isBinary,this.supportsBinary=e.supportsBinary,this.enablesXDR=e.enablesXDR,this.withCredentials=e.withCredentials,this.requestTimeout=e.requestTimeout,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.extraHeaders=e.extraHeaders,this.create()}if(e.exports=XHR,e.exports.Request=Request,o(XHR,i),XHR.prototype.supportsBinary=!0,XHR.prototype.request=function(e){return(e=e||{}).uri=this.uri(),e.xd=this.xd,e.xs=this.xs,e.agent=this.agent||!1,e.supportsBinary=this.supportsBinary,e.enablesXDR=this.enablesXDR,e.withCredentials=this.withCredentials,e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized,e.requestTimeout=this.requestTimeout,e.extraHeaders=this.extraHeaders,new Request(e)},XHR.prototype.doWrite=function(e,t){var r="string"!==typeof e&&void 0!==e,n=this.request({method:"POST",data:e,isBinary:r}),i=this;n.on("success",t),n.on("error",(function(e){i.onError("xhr post error",e)})),this.sendXhr=n},XHR.prototype.doPoll=function(){s("xhr poll");var e=this.request(),t=this;e.on("data",(function(e){t.onData(e)})),e.on("error",(function(e){t.onError("xhr poll error",e)})),this.pollXhr=e},a(Request.prototype),Request.prototype.create=function(){var e={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized;var t=this.xhr=new n(e),r=this;try{s("xhr open %s: %s",this.method,this.uri),t.open(this.method,this.uri,this.async);try{if(this.extraHeaders)for(var i in t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0),this.extraHeaders)this.extraHeaders.hasOwnProperty(i)&&t.setRequestHeader(i,this.extraHeaders[i])}catch(a){}if("POST"===this.method)try{this.isBinary?t.setRequestHeader("Content-type","application/octet-stream"):t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(a){}try{t.setRequestHeader("Accept","*/*")}catch(a){}"withCredentials"in t&&(t.withCredentials=this.withCredentials),this.requestTimeout&&(t.timeout=this.requestTimeout),this.hasXDR()?(t.onload=function(){r.onLoad()},t.onerror=function(){r.onError(t.responseText)}):t.onreadystatechange=function(){if(2===t.readyState)try{var e=t.getResponseHeader("Content-Type");(r.supportsBinary&&"application/octet-stream"===e||"application/octet-stream; charset=UTF-8"===e)&&(t.responseType="arraybuffer")}catch(a){}4===t.readyState&&(200===t.status||1223===t.status?r.onLoad():setTimeout((function(){r.onError("number"===typeof t.status?t.status:0)}),0))},s("xhr data %s",this.data),t.send(this.data)}catch(a){return void setTimeout((function(){r.onError(a)}),0)}"undefined"!==typeof document&&(this.index=Request.requestsCount++,Request.requests[this.index]=this)},Request.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},Request.prototype.onData=function(e){this.emit("data",e),this.onSuccess()},Request.prototype.onError=function(e){this.emit("error",e),this.cleanup(!0)},Request.prototype.cleanup=function(e){if("undefined"!==typeof this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=empty:this.xhr.onreadystatechange=empty,e)try{this.xhr.abort()}catch(t){}"undefined"!==typeof document&&delete Request.requests[this.index],this.xhr=null}},Request.prototype.onLoad=function(){var e;try{var t;try{t=this.xhr.getResponseHeader("Content-Type")}catch(r){}e=("application/octet-stream"===t||"application/octet-stream; charset=UTF-8"===t)&&this.xhr.response||this.xhr.responseText}catch(r){this.onError(r)}null!=e&&this.onData(e)},Request.prototype.hasXDR=function(){return"undefined"!==typeof XDomainRequest&&!this.xs&&this.enablesXDR},Request.prototype.abort=function(){this.cleanup()},Request.requestsCount=0,Request.requests={},"undefined"!==typeof document)if("function"===typeof attachEvent)attachEvent("onunload",unloadHandler);else if("function"===typeof addEventListener){var u="onpagehide"in self?"pagehide":"unload";addEventListener(u,unloadHandler,!1)}function unloadHandler(){for(var e in Request.requests)Request.requests.hasOwnProperty(e)&&Request.requests[e].abort()}},function(e,t){e.exports=Object.keys||function keys(e){var t=[],r=Object.prototype.hasOwnProperty;for(var n in e)r.call(e,n)&&t.push(n);return t}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t){e.exports=function(e,t,r){var n=e.byteLength;if(t=t||0,r=r||n,e.slice)return e.slice(t,r);if(t<0&&(t+=n),r<0&&(r+=n),r>n&&(r=n),t>=n||t>=r||0===n)return new ArrayBuffer(0);for(var i=new Uint8Array(e),a=new Uint8Array(r-t),o=t,s=0;o<r;o++,s++)a[s]=i[o];return a.buffer}},function(e,t){function noop(){}e.exports=function after(e,t,r){var n=!1;return r=r||noop,proxy.count=e,0===e?t():proxy;function proxy(e,i){if(proxy.count<=0)throw new Error("after called too many times");--proxy.count,e?(n=!0,t(e),t=r):0!==proxy.count||n||t(null,i)}}},function(e,t){var r,n,i,a=String.fromCharCode;function ucs2decode(e){for(var t,r,n=[],i=0,a=e.length;i<a;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<a?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function checkScalarValue(e,t){if(e>=55296&&e<=57343){if(t)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function createByte(e,t){return a(e>>t&63|128)}function encodeCodePoint(e,t){if(0==(4294967168&e))return a(e);var r="";return 0==(4294965248&e)?r=a(e>>6&31|192):0==(4294901760&e)?(checkScalarValue(e,t)||(e=65533),r=a(e>>12&15|224),r+=createByte(e,6)):0==(4292870144&e)&&(r=a(e>>18&7|240),r+=createByte(e,12),r+=createByte(e,6)),r+=a(63&e|128)}function readContinuationByte(){if(i>=n)throw Error("Invalid byte index");var e=255&r[i];if(i++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function decodeSymbol(e){var t,a;if(i>n)throw Error("Invalid byte index");if(i==n)return!1;if(t=255&r[i],i++,0==(128&t))return t;if(192==(224&t)){if((a=(31&t)<<6|readContinuationByte())>=128)return a;throw Error("Invalid continuation byte")}if(224==(240&t)){if((a=(15&t)<<12|readContinuationByte()<<6|readContinuationByte())>=2048)return checkScalarValue(a,e)?a:65533;throw Error("Invalid continuation byte")}if(240==(248&t)&&(a=(7&t)<<18|readContinuationByte()<<12|readContinuationByte()<<6|readContinuationByte())>=65536&&a<=1114111)return a;throw Error("Invalid UTF-8 detected")}e.exports={version:"2.1.2",encode:function utf8encode(e,t){for(var r=!1!==(t=t||{}).strict,n=ucs2decode(e),i=n.length,a=-1,o="";++a<i;)o+=encodeCodePoint(n[a],r);return o},decode:function utf8decode(e,t){var o=!1!==(t=t||{}).strict;r=ucs2decode(e),n=r.length,i=0;for(var s,u=[];!1!==(s=decodeSymbol(o));)u.push(s);return function ucs2encode(e){for(var t,r=e.length,n=-1,i="";++n<r;)(t=e[n])>65535&&(i+=a((t-=65536)>>>10&1023|55296),t=56320|1023&t),i+=a(t);return i}(u)}}},function(e,t){!function(){"use strict";for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=new Uint8Array(256),n=0;n<e.length;n++)r[e.charCodeAt(n)]=n;t.encode=function(t){var r,n=new Uint8Array(t),i=n.length,a="";for(r=0;r<i;r+=3)a+=e[n[r]>>2],a+=e[(3&n[r])<<4|n[r+1]>>4],a+=e[(15&n[r+1])<<2|n[r+2]>>6],a+=e[63&n[r+2]];return i%3===2?a=a.substring(0,a.length-1)+"=":i%3===1&&(a=a.substring(0,a.length-2)+"=="),a},t.decode=function(e){var t,n,i,a,o,s=.75*e.length,u=e.length,l=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);var c=new ArrayBuffer(s),f=new Uint8Array(c);for(t=0;t<u;t+=4)n=r[e.charCodeAt(t)],i=r[e.charCodeAt(t+1)],a=r[e.charCodeAt(t+2)],o=r[e.charCodeAt(t+3)],f[l++]=n<<2|i>>4,f[l++]=(15&i)<<4|a>>2,f[l++]=(3&a)<<6|63&o;return c}}()},function(e,t){var r="undefined"!==typeof r?r:"undefined"!==typeof WebKitBlobBuilder?WebKitBlobBuilder:"undefined"!==typeof MSBlobBuilder?MSBlobBuilder:"undefined"!==typeof MozBlobBuilder&&MozBlobBuilder,n=function(){try{return 2===new Blob(["hi"]).size}catch(e){return!1}}(),i=n&&function(){try{return 2===new Blob([new Uint8Array([1,2])]).size}catch(e){return!1}}(),a=r&&r.prototype.append&&r.prototype.getBlob;function mapArrayBufferViews(e){return e.map((function(e){if(e.buffer instanceof ArrayBuffer){var t=e.buffer;if(e.byteLength!==t.byteLength){var r=new Uint8Array(e.byteLength);r.set(new Uint8Array(t,e.byteOffset,e.byteLength)),t=r.buffer}return t}return e}))}function BlobBuilderConstructor(e,t){t=t||{};var n=new r;return mapArrayBufferViews(e).forEach((function(e){n.append(e)})),t.type?n.getBlob(t.type):n.getBlob()}function BlobConstructor(e,t){return new Blob(mapArrayBufferViews(e),t||{})}"undefined"!==typeof Blob&&(BlobBuilderConstructor.prototype=Blob.prototype,BlobConstructor.prototype=Blob.prototype),e.exports=n?i?Blob:BlobConstructor:a?BlobBuilderConstructor:void 0},function(e,t,r){var n=r(206);e.exports=function setup(e){function selectColor(e){for(var t=0,r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return createDebug.colors[Math.abs(t)%createDebug.colors.length]}function createDebug(e){var t;function debug(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];if(debug.enabled){var i=debug,a=Number(new Date),o=a-(t||a);i.diff=o,i.prev=t,i.curr=a,t=a,r[0]=createDebug.coerce(r[0]),"string"!==typeof r[0]&&r.unshift("%O");var s=0;r[0]=r[0].replace(/%([a-zA-Z%])/g,(function(e,t){if("%%"===e)return e;s++;var n=createDebug.formatters[t];if("function"===typeof n){var a=r[s];e=n.call(i,a),r.splice(s,1),s--}return e})),createDebug.formatArgs.call(i,r),(i.log||createDebug.log).apply(i,r)}}return debug.namespace=e,debug.enabled=createDebug.enabled(e),debug.useColors=createDebug.useColors(),debug.color=selectColor(e),debug.destroy=destroy,debug.extend=extend,"function"===typeof createDebug.init&&createDebug.init(debug),createDebug.instances.push(debug),debug}function destroy(){var e=createDebug.instances.indexOf(this);return-1!==e&&(createDebug.instances.splice(e,1),!0)}function extend(e,t){var r=createDebug(this.namespace+("undefined"===typeof t?":":t)+e);return r.log=this.log,r}function toNamespace(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return createDebug.debug=createDebug,createDebug.default=createDebug,createDebug.coerce=function coerce(e){if(e instanceof Error)return e.stack||e.message;return e},createDebug.disable=function disable(){var e=[].concat(n(createDebug.names.map(toNamespace)),n(createDebug.skips.map(toNamespace).map((function(e){return"-"+e})))).join(",");return createDebug.enable(""),e},createDebug.enable=function enable(e){var t;createDebug.save(e),createDebug.names=[],createDebug.skips=[];var r=("string"===typeof e?e:"").split(/[\s,]+/),n=r.length;for(t=0;t<n;t++)r[t]&&("-"===(e=r[t].replace(/\*/g,".*?"))[0]?createDebug.skips.push(new RegExp("^"+e.substr(1)+"$")):createDebug.names.push(new RegExp("^"+e+"$")));for(t=0;t<createDebug.instances.length;t++){var i=createDebug.instances[t];i.enabled=createDebug.enabled(i.namespace)}},createDebug.enabled=function enabled(e){if("*"===e[e.length-1])return!0;var t,r;for(t=0,r=createDebug.skips.length;t<r;t++)if(createDebug.skips[t].test(e))return!1;for(t=0,r=createDebug.names.length;t<r;t++)if(createDebug.names[t].test(e))return!0;return!1},createDebug.humanize=r(542),Object.keys(e).forEach((function(t){createDebug[t]=e[t]})),createDebug.instances=[],createDebug.names=[],createDebug.skips=[],createDebug.formatters={},createDebug.selectColor=selectColor,createDebug.enable(createDebug.load()),createDebug}},function(e,t){var r=1e3,n=60*r,i=60*n,a=24*i,o=7*a,s=365.25*a;function plural(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,t){t=t||{};var u=typeof e;if("string"===u&&e.length>0)return function parse(e){if((e=String(e)).length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var u=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return u*s;case"weeks":case"week":case"w":return u*o;case"days":case"day":case"d":return u*a;case"hours":case"hour":case"hrs":case"hr":case"h":return u*i;case"minutes":case"minute":case"mins":case"min":case"m":return u*n;case"seconds":case"second":case"secs":case"sec":case"s":return u*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:return}}(e);if("number"===u&&isFinite(e))return t.long?function fmtLong(e){var t=Math.abs(e);if(t>=a)return plural(e,t,a,"day");if(t>=i)return plural(e,t,i,"hour");if(t>=n)return plural(e,t,n,"minute");if(t>=r)return plural(e,t,r,"second");return e+" ms"}(e):function fmtShort(e){var t=Math.abs(e);if(t>=a)return Math.round(e/a)+"d";if(t>=i)return Math.round(e/i)+"h";if(t>=n)return Math.round(e/n)+"m";if(t>=r)return Math.round(e/r)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,r){(function(t){var n=r(211),i=r(81);e.exports=JSONPPolling;var a,o=/\n/g,s=/\\n/g;function empty(){}function glob(){return"undefined"!==typeof self?self:"undefined"!==typeof window?window:"undefined"!==typeof t?t:{}}function JSONPPolling(e){if(n.call(this,e),this.query=this.query||{},!a){var t=glob();a=t.___eio=t.___eio||[]}this.index=a.length;var r=this;a.push((function(e){r.onData(e)})),this.query.j=this.index,"function"===typeof addEventListener&&addEventListener("beforeunload",(function(){r.script&&(r.script.onerror=empty)}),!1)}i(JSONPPolling,n),JSONPPolling.prototype.supportsBinary=!1,JSONPPolling.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),n.prototype.doClose.call(this)},JSONPPolling.prototype.doPoll=function(){var e=this,t=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),t.async=!0,t.src=this.uri(),t.onerror=function(t){e.onError("jsonp poll error",t)};var r=document.getElementsByTagName("script")[0];r?r.parentNode.insertBefore(t,r):(document.head||document.body).appendChild(t),this.script=t,"undefined"!==typeof navigator&&/gecko/i.test(navigator.userAgent)&&setTimeout((function(){var e=document.createElement("iframe");document.body.appendChild(e),document.body.removeChild(e)}),100)},JSONPPolling.prototype.doWrite=function(e,t){var r=this;if(!this.form){var n,i=document.createElement("form"),a=document.createElement("textarea"),u=this.iframeId="eio_iframe_"+this.index;i.className="socketio",i.style.position="absolute",i.style.top="-1000px",i.style.left="-1000px",i.target=u,i.method="POST",i.setAttribute("accept-charset","utf-8"),a.name="d",i.appendChild(a),document.body.appendChild(i),this.form=i,this.area=a}function complete(){initIframe(),t()}function initIframe(){if(r.iframe)try{r.form.removeChild(r.iframe)}catch(t){r.onError("jsonp polling iframe removal error",t)}try{var e='<iframe src="javascript:0" name="'+r.iframeId+'">';n=document.createElement(e)}catch(t){(n=document.createElement("iframe")).name=r.iframeId,n.src="javascript:0"}n.id=r.iframeId,r.form.appendChild(n),r.iframe=n}this.form.action=this.uri(),initIframe(),e=e.replace(s,"\\\n"),this.area.value=e.replace(o,"\\n");try{this.form.submit()}catch(l){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===r.iframe.readyState&&complete()}:this.iframe.onload=complete}}).call(this,r(18))},function(e,t,r){(function(t){var n,i,a=r(133),o=r(52),s=r(80),u=r(81),l=r(213),c=r(82)("engine.io-client:websocket");if("undefined"!==typeof WebSocket?n=WebSocket:"undefined"!==typeof self&&(n=self.WebSocket||self.MozWebSocket),"undefined"===typeof window)try{i=r(545)}catch(d){}var f=n||i;function WS(e){e&&e.forceBase64&&(this.supportsBinary=!1),this.perMessageDeflate=e.perMessageDeflate,this.usingBrowserWebSocket=n&&!e.forceNode,this.protocols=e.protocols,this.usingBrowserWebSocket||(f=i),a.call(this,e)}e.exports=WS,u(WS,a),WS.prototype.name="websocket",WS.prototype.supportsBinary=!0,WS.prototype.doOpen=function(){if(this.check()){var e=this.uri(),t=this.protocols,r={agent:this.agent,perMessageDeflate:this.perMessageDeflate};r.pfx=this.pfx,r.key=this.key,r.passphrase=this.passphrase,r.cert=this.cert,r.ca=this.ca,r.ciphers=this.ciphers,r.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(r.headers=this.extraHeaders),this.localAddress&&(r.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket&&!this.isReactNative?t?new f(e,t):new f(e):new f(e,t,r)}catch(n){return this.emit("error",n)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},WS.prototype.addEventListeners=function(){var e=this;this.ws.onopen=function(){e.onOpen()},this.ws.onclose=function(){e.onClose()},this.ws.onmessage=function(t){e.onData(t.data)},this.ws.onerror=function(t){e.onError("websocket error",t)}},WS.prototype.write=function(e){var r=this;this.writable=!1;for(var n=e.length,i=0,a=n;i<a;i++)!function(e){o.encodePacket(e,r.supportsBinary,(function(i){if(!r.usingBrowserWebSocket){var a={};if(e.options&&(a.compress=e.options.compress),r.perMessageDeflate)("string"===typeof i?t.byteLength(i):i.length)<r.perMessageDeflate.threshold&&(a.compress=!1)}try{r.usingBrowserWebSocket?r.ws.send(i):r.ws.send(i,a)}catch(d){c("websocket closed before onclose event")}--n||done()}))}(e[i]);function done(){r.emit("flush"),setTimeout((function(){r.writable=!0,r.emit("drain")}),0)}},WS.prototype.onClose=function(){a.prototype.onClose.call(this)},WS.prototype.doClose=function(){"undefined"!==typeof this.ws&&this.ws.close()},WS.prototype.uri=function(){var e=this.query||{},t=this.secure?"wss":"ws",r="";return this.port&&("wss"===t&&443!==Number(this.port)||"ws"===t&&80!==Number(this.port))&&(r=":"+this.port),this.timestampRequests&&(e[this.timestampParam]=l()),this.supportsBinary||(e.b64=1),(e=s.encode(e)).length&&(e="?"+e),t+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+r+this.path+e},WS.prototype.check=function(){return!!f&&!("__initialize"in f&&this.name===WS.prototype.name)}}).call(this,r(21).Buffer)},,function(e,t){e.exports=function toArray(e,t){for(var r=[],n=(t=t||0)||0;n<e.length;n++)r[n-t]=e[n];return r}},function(e,t){function Backoff(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}e.exports=Backoff,Backoff.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-r:e+r}return 0|Math.min(e,this.max)},Backoff.prototype.reset=function(){this.attempts=0},Backoff.prototype.setMin=function(e){this.ms=e},Backoff.prototype.setMax=function(e){this.max=e},Backoff.prototype.setJitter=function(e){this.jitter=e}},,,,,,,,function(e,t,r){"use strict";var n={};r.r(n),r.d(n,"aggregate",(function(){return Aggregate})),r.d(n,"bin",(function(){return Bin})),r.d(n,"collect",(function(){return Collect})),r.d(n,"compare",(function(){return Compare})),r.d(n,"countpattern",(function(){return CountPattern})),r.d(n,"cross",(function(){return Cross})),r.d(n,"density",(function(){return Density})),r.d(n,"expression",(function(){return Expression})),r.d(n,"extent",(function(){return Extent})),r.d(n,"facet",(function(){return Facet})),r.d(n,"field",(function(){return Field})),r.d(n,"filter",(function(){return Filter})),r.d(n,"flatten",(function(){return Flatten})),r.d(n,"fold",(function(){return Fold})),r.d(n,"formula",(function(){return Formula})),r.d(n,"generate",(function(){return Generate})),r.d(n,"impute",(function(){return Impute})),r.d(n,"joinaggregate",(function(){return JoinAggregate})),r.d(n,"kde",(function(){return KDE})),r.d(n,"key",(function(){return Key})),r.d(n,"load",(function(){return Load})),r.d(n,"lookup",(function(){return Lookup})),r.d(n,"multiextent",(function(){return MultiExtent})),r.d(n,"multivalues",(function(){return MultiValues})),r.d(n,"params",(function(){return Params})),r.d(n,"pivot",(function(){return Pivot})),r.d(n,"prefacet",(function(){return PreFacet})),r.d(n,"project",(function(){return Project})),r.d(n,"proxy",(function(){return Proxy})),r.d(n,"relay",(function(){return Relay})),r.d(n,"sample",(function(){return Sample})),r.d(n,"sequence",(function(){return Sequence})),r.d(n,"sieve",(function(){return Sieve})),r.d(n,"subflow",(function(){return Subflow})),r.d(n,"tupleindex",(function(){return TupleIndex})),r.d(n,"values",(function(){return Values})),r.d(n,"window",(function(){return Window}));var a={};r.r(a),r.d(a,"bound",(function(){return Bound})),r.d(a,"identifier",(function(){return Identifier_Identifier})),r.d(a,"mark",(function(){return Mark})),r.d(a,"overlap",(function(){return Overlap})),r.d(a,"render",(function(){return Render})),r.d(a,"viewlayout",(function(){return ViewLayout}));var o={};r.r(o),r.d(o,"interpolate",(function(){return _s})),r.d(o,"interpolateArray",(function(){return us})),r.d(o,"interpolateBasis",(function(){return rs})),r.d(o,"interpolateBasisClosed",(function(){return ns})),r.d(o,"interpolateDate",(function(){return ls})),r.d(o,"interpolateDiscrete",(function(){return bs})),r.d(o,"interpolateHue",(function(){return xs})),r.d(o,"interpolateNumber",(function(){return cs})),r.d(o,"interpolateObject",(function(){return fs})),r.d(o,"interpolateRound",(function(){return ws})),r.d(o,"interpolateString",(function(){return ys})),r.d(o,"interpolateTransformCss",(function(){return Cs})),r.d(o,"interpolateTransformSvg",(function(){return Ts})),r.d(o,"interpolateZoom",(function(){return As})),r.d(o,"interpolateRgb",(function(){return as})),r.d(o,"interpolateRgbBasis",(function(){return os})),r.d(o,"interpolateRgbBasisClosed",(function(){return ss})),r.d(o,"interpolateHsl",(function(){return Rs})),r.d(o,"interpolateHslLong",(function(){return Ds})),r.d(o,"interpolateLab",(function(){return lab_lab})),r.d(o,"interpolateHcl",(function(){return zs})),r.d(o,"interpolateHclLong",(function(){return qs})),r.d(o,"interpolateCubehelix",(function(){return Xs})),r.d(o,"interpolateCubehelixLong",(function(){return Ks})),r.d(o,"piecewise",(function(){return piecewise_piecewise})),r.d(o,"quantize",(function(){return Js}));var s={};r.r(s),r.d(s,"axisticks",(function(){return AxisTicks})),r.d(s,"datajoin",(function(){return DataJoin})),r.d(s,"encode",(function(){return Encode})),r.d(s,"legendentries",(function(){return LegendEntries})),r.d(s,"linkpath",(function(){return LinkPath})),r.d(s,"pie",(function(){return Pie})),r.d(s,"scale",(function(){return Scale})),r.d(s,"sortitems",(function(){return SortItems})),r.d(s,"stack",(function(){return Stack})),r.d(s,"validTicks",(function(){return validTicks}));var u={};r.r(u),r.d(u,"contour",(function(){return Contour})),r.d(u,"geojson",(function(){return GeoJSON})),r.d(u,"geopath",(function(){return GeoPath})),r.d(u,"geopoint",(function(){return GeoPoint})),r.d(u,"geoshape",(function(){return GeoShape})),r.d(u,"graticule",(function(){return Graticule})),r.d(u,"projection",(function(){return Projection}));var l={};r.r(l),r.d(l,"force",(function(){return Force}));var c={};r.r(c),r.d(c,"nest",(function(){return Nest})),r.d(c,"pack",(function(){return Pack})),r.d(c,"partition",(function(){return Partition})),r.d(c,"stratify",(function(){return Stratify})),r.d(c,"tree",(function(){return Tree})),r.d(c,"treelinks",(function(){return TreeLinks})),r.d(c,"treemap",(function(){return Treemap}));var d={};r.r(d),r.d(d,"loess",(function(){return Loess})),r.d(d,"regression",(function(){return Regression}));var h={};r.r(h),r.d(h,"voronoi",(function(){return Voronoi_Voronoi}));var g={};r.r(g),r.d(g,"wordcloud",(function(){return Wordcloud}));var m={};r.r(m),r.d(m,"crossfilter",(function(){return CrossFilter})),r.d(m,"resolvefilter",(function(){return ResolveFilter}));var v={};r.r(v),r.d(v,"version",(function(){return qd.a})),r.d(v,"Dataflow",(function(){return Dataflow})),r.d(v,"EventStream",(function(){return EventStream})),r.d(v,"Parameters",(function(){return Parameters})),r.d(v,"Pulse",(function(){return Pulse})),r.d(v,"MultiPulse",(function(){return MultiPulse})),r.d(v,"Operator",(function(){return Operator})),r.d(v,"Transform",(function(){return Transform})),r.d(v,"changeset",(function(){return ChangeSet_changeset})),r.d(v,"ingest",(function(){return ingest})),r.d(v,"isTuple",(function(){return isTuple})),r.d(v,"definition",(function(){return register_definition})),r.d(v,"transform",(function(){return register_transform})),r.d(v,"transforms",(function(){return yt})),r.d(v,"tupleid",(function(){return tupleid})),r.d(v,"scale",(function(){return scales_scale})),r.d(v,"scheme",(function(){return schemes_scheme})),r.d(v,"interpolate",(function(){return interpolate_interpolate})),r.d(v,"interpolateColors",(function(){return interpolateColors})),r.d(v,"interpolateRange",(function(){return interpolateRange})),r.d(v,"timeInterval",(function(){return timeInterval})),r.d(v,"quantizeInterpolator",(function(){return quantizeInterpolator})),r.d(v,"projection",(function(){return projections_projection})),r.d(v,"View",(function(){return View})),r.d(v,"expressionFunction",(function(){return expressionFunction})),r.d(v,"formatLocale",(function(){return defaultLocale_defaultLocale})),r.d(v,"timeFormatLocale",(function(){return defaultLocale})),r.d(v,"parse",(function(){return Aw})),r.d(v,"runtime",(function(){return jw})),r.d(v,"runtimeContext",(function(){return Fw})),r.d(v,"bin",(function(){return xt})),r.d(v,"bootstrapCI",(function(){return Tt})),r.d(v,"quartiles",(function(){return Ot})),r.d(v,"random",(function(){return kt})),r.d(v,"setRandom",(function(){return setRandom})),r.d(v,"randomLCG",(function(){return At})),r.d(v,"randomInteger",(function(){return Rt})),r.d(v,"randomKDE",(function(){return Pt})),r.d(v,"randomMixture",(function(){return jt})),r.d(v,"randomNormal",(function(){return Dt})),r.d(v,"randomUniform",(function(){return Mt})),r.d(v,"regressionLinear",(function(){return Lt})),r.d(v,"regressionLog",(function(){return Nt})),r.d(v,"regressionExp",(function(){return Bt})),r.d(v,"regressionPow",(function(){return Ut})),r.d(v,"regressionQuad",(function(){return zt})),r.d(v,"regressionPoly",(function(){return Wt})),r.d(v,"regressionLoess",(function(){return Ht})),r.d(v,"sampleCurve",(function(){return Yt})),r.d(v,"accessor",(function(){return V.f})),r.d(v,"accessorName",(function(){return V.h})),r.d(v,"accessorFields",(function(){return V.g})),r.d(v,"id",(function(){return V.w})),r.d(v,"identity",(function(){return V.x})),r.d(v,"zero",(function(){return V.hb})),r.d(v,"one",(function(){return V.M})),r.d(v,"truthy",(function(){return V.eb})),r.d(v,"falsy",(function(){return V.r})),r.d(v,"logger",(function(){return V.K})),r.d(v,"None",(function(){return V.d})),r.d(v,"Error",(function(){return V.b})),r.d(v,"Warn",(function(){return V.e})),r.d(v,"Info",(function(){return V.c})),r.d(v,"Debug",(function(){return V.a})),r.d(v,"panLinear",(function(){return V.O})),r.d(v,"panLog",(function(){return V.P})),r.d(v,"panPow",(function(){return V.Q})),r.d(v,"panSymlog",(function(){return V.R})),r.d(v,"zoomLinear",(function(){return V.ib})),r.d(v,"zoomLog",(function(){return V.jb})),r.d(v,"zoomPow",(function(){return V.kb})),r.d(v,"zoomSymlog",(function(){return V.lb})),r.d(v,"quarter",(function(){return V.T})),r.d(v,"utcquarter",(function(){return V.fb})),r.d(v,"array",(function(){return V.i})),r.d(v,"clampRange",(function(){return V.j})),r.d(v,"compare",(function(){return V.k})),r.d(v,"constant",(function(){return V.l})),r.d(v,"debounce",(function(){return V.m})),r.d(v,"error",(function(){return V.n})),r.d(v,"extend",(function(){return V.o})),r.d(v,"extent",(function(){return V.p})),r.d(v,"extentIndex",(function(){return V.q})),r.d(v,"fastmap",(function(){return V.s})),r.d(v,"field",(function(){return V.t})),r.d(v,"flush",(function(){return V.u})),r.d(v,"hasOwnProperty",(function(){return V.v})),r.d(v,"inherits",(function(){return V.y})),r.d(v,"inrange",(function(){return V.z})),r.d(v,"isArray",(function(){return V.A})),r.d(v,"isBoolean",(function(){return V.B})),r.d(v,"isDate",(function(){return V.C})),r.d(v,"isFunction",(function(){return V.D})),r.d(v,"isNumber",(function(){return V.E})),r.d(v,"isObject",(function(){return V.F})),r.d(v,"isRegExp",(function(){return V.G})),r.d(v,"isString",(function(){return V.H})),r.d(v,"key",(function(){return V.I})),r.d(v,"lerp",(function(){return V.J})),r.d(v,"merge",(function(){return V.L})),r.d(v,"pad",(function(){return V.N})),r.d(v,"peek",(function(){return V.S})),r.d(v,"repeat",(function(){return V.U})),r.d(v,"span",(function(){return V.V})),r.d(v,"splitAccessPath",(function(){return V.W})),r.d(v,"stringValue",(function(){return V.X})),r.d(v,"toBoolean",(function(){return V.Y})),r.d(v,"toDate",(function(){return V.Z})),r.d(v,"toNumber",(function(){return V.ab})),r.d(v,"toString",(function(){return V.cb})),r.d(v,"toSet",(function(){return V.bb})),r.d(v,"truncate",(function(){return V.db})),r.d(v,"visitArray",(function(){return V.gb})),r.d(v,"loader",(function(){return eh})),r.d(v,"read",(function(){return Zd})),r.d(v,"inferType",(function(){return src_type_inferType})),r.d(v,"inferTypes",(function(){return src_type_inferTypes})),r.d(v,"typeParsers",(function(){return Yd})),r.d(v,"format",(function(){return Qd})),r.d(v,"formats",(function(){return vega_loader_src_formats_formats})),r.d(v,"responseType",(function(){return src_formats_responseType})),r.d(v,"Bounds",(function(){return Bounds_Bounds})),r.d(v,"Gradient",(function(){return ih})),r.d(v,"GroupItem",(function(){return GroupItem_GroupItem})),r.d(v,"ResourceLoader",(function(){return ResourceLoader_ResourceLoader})),r.d(v,"Item",(function(){return Item_Item})),r.d(v,"Scenegraph",(function(){return Scenegraph_Scenegraph})),r.d(v,"Handler",(function(){return src_Handler_Handler})),r.d(v,"Renderer",(function(){return src_Renderer_Renderer})),r.d(v,"CanvasHandler",(function(){return CanvasHandler_CanvasHandler})),r.d(v,"CanvasRenderer",(function(){return CanvasRenderer_CanvasRenderer})),r.d(v,"SVGHandler",(function(){return SVGHandler_SVGHandler})),r.d(v,"SVGRenderer",(function(){return SVGRenderer_SVGRenderer})),r.d(v,"SVGStringRenderer",(function(){return SVGStringRenderer_SVGStringRenderer})),r.d(v,"RenderType",(function(){return Mp})),r.d(v,"renderModule",(function(){return modules_renderModule})),r.d(v,"intersect",(function(){return src_intersect_intersect})),r.d(v,"Marks",(function(){return op})),r.d(v,"boundClip",(function(){return Lp})),r.d(v,"boundContext",(function(){return bound_boundContext_context})),r.d(v,"boundStroke",(function(){return Ph})),r.d(v,"boundItem",(function(){return sp})),r.d(v,"boundMark",(function(){return lp})),r.d(v,"pathCurves",(function(){return curves_curves})),r.d(v,"pathSymbols",(function(){return path_symbols_symbols})),r.d(v,"pathRectangle",(function(){return wh})),r.d(v,"pathTrail",(function(){return kh})),r.d(v,"pathParse",(function(){return lh})),r.d(v,"pathRender",(function(){return _h})),r.d(v,"point",(function(){return dp})),r.d(v,"domCreate",(function(){return dom_domCreate})),r.d(v,"domFind",(function(){return dom_domFind})),r.d(v,"domChild",(function(){return dom_domChild})),r.d(v,"domClear",(function(){return dom_domClear})),r.d(v,"openTag",(function(){return tags_openTag})),r.d(v,"closeTag",(function(){return tags_closeTag})),r.d(v,"font",(function(){return util_text_font})),r.d(v,"fontFamily",(function(){return text_fontFamily})),r.d(v,"fontSize",(function(){return util_text_fontSize})),r.d(v,"textMetrics",(function(){return np})),r.d(v,"resetSVGClipId",(function(){return clip_resetSVGClipId})),r.d(v,"sceneEqual",(function(){return equal_sceneEqual})),r.d(v,"pathEqual",(function(){return equal_pathEqual})),r.d(v,"sceneToJSON",(function(){return serialize_sceneToJSON})),r.d(v,"sceneFromJSON",(function(){return serialize_sceneFromJSON})),r.d(v,"intersectPath",(function(){return intersect_intersectPath})),r.d(v,"intersectPoint",(function(){return intersect_intersectPoint})),r.d(v,"intersectRule",(function(){return intersect_intersectRule})),r.d(v,"intersectBoxLine",(function(){return intersect_intersectBoxLine})),r.d(v,"sceneZOrder",(function(){return visit_zorder})),r.d(v,"sceneVisit",(function(){return util_visit_visit})),r.d(v,"scenePickVisit",(function(){return visit_pickVisit}));var y={};r.r(y),r.d(y,"INVALID_SPEC",(function(){return kS})),r.d(y,"FIT_NON_SINGLE",(function(){return SS})),r.d(y,"CANNOT_FIX_RANGE_STEP_WITH_FIT",(function(){return ES})),r.d(y,"cannotProjectOnChannelWithoutField",(function(){return cannotProjectOnChannelWithoutField})),r.d(y,"nearestNotSupportForContinuous",(function(){return nearestNotSupportForContinuous})),r.d(y,"selectionNotSupported",(function(){return selectionNotSupported})),r.d(y,"selectionNotFound",(function(){return selectionNotFound})),r.d(y,"SCALE_BINDINGS_CONTINUOUS",(function(){return CS})),r.d(y,"NO_INIT_SCALE_BINDINGS",(function(){return TS})),r.d(y,"noSuchRepeatedValue",(function(){return noSuchRepeatedValue})),r.d(y,"columnsNotSupportByRowCol",(function(){return columnsNotSupportByRowCol})),r.d(y,"CONCAT_CANNOT_SHARE_AXIS",(function(){return OS})),r.d(y,"REPEAT_CANNOT_SHARE_AXIS",(function(){return AS})),r.d(y,"unrecognizedParse",(function(){return unrecognizedParse})),r.d(y,"differentParse",(function(){return differentParse})),r.d(y,"invalidTransformIgnored",(function(){return invalidTransformIgnored})),r.d(y,"NO_FIELDS_NEEDS_AS",(function(){return RS})),r.d(y,"encodingOverridden",(function(){return encodingOverridden})),r.d(y,"projectionOverridden",(function(){return projectionOverridden})),r.d(y,"primitiveChannelDef",(function(){return primitiveChannelDef})),r.d(y,"invalidFieldType",(function(){return invalidFieldType})),r.d(y,"nonZeroScaleUsedWithLengthMark",(function(){return nonZeroScaleUsedWithLengthMark})),r.d(y,"invalidFieldTypeForCountAggregate",(function(){return invalidFieldTypeForCountAggregate})),r.d(y,"invalidAggregate",(function(){return invalidAggregate})),r.d(y,"missingFieldType",(function(){return missingFieldType})),r.d(y,"droppingColor",(function(){return droppingColor})),r.d(y,"emptyFieldDef",(function(){return emptyFieldDef})),r.d(y,"latLongDeprecated",(function(){return latLongDeprecated})),r.d(y,"LINE_WITH_VARYING_SIZE",(function(){return DS})),r.d(y,"incompatibleChannel",(function(){return incompatibleChannel})),r.d(y,"invalidEncodingChannel",(function(){return invalidEncodingChannel})),r.d(y,"facetChannelShouldBeDiscrete",(function(){return facetChannelShouldBeDiscrete})),r.d(y,"facetChannelDropped",(function(){return facetChannelDropped})),r.d(y,"discreteChannelCannotEncode",(function(){return discreteChannelCannotEncode})),r.d(y,"BAR_WITH_POINT_SCALE_AND_RANGESTEP_NULL",(function(){return PS})),r.d(y,"lineWithRange",(function(){return lineWithRange})),r.d(y,"orientOverridden",(function(){return orientOverridden})),r.d(y,"CANNOT_UNION_CUSTOM_DOMAIN_WITH_FIELD_DOMAIN",(function(){return jS})),r.d(y,"cannotUseScalePropertyWithNonColor",(function(){return cannotUseScalePropertyWithNonColor})),r.d(y,"unaggregateDomainHasNoEffectForRawField",(function(){return unaggregateDomainHasNoEffectForRawField})),r.d(y,"unaggregateDomainWithNonSharedDomainOp",(function(){return unaggregateDomainWithNonSharedDomainOp})),r.d(y,"unaggregatedDomainWithLogScale",(function(){return unaggregatedDomainWithLogScale})),r.d(y,"cannotApplySizeToNonOrientedMark",(function(){return cannotApplySizeToNonOrientedMark})),r.d(y,"rangeStepDropped",(function(){return rangeStepDropped})),r.d(y,"scaleTypeNotWorkWithChannel",(function(){return scaleTypeNotWorkWithChannel})),r.d(y,"scaleTypeNotWorkWithFieldDef",(function(){return scaleTypeNotWorkWithFieldDef})),r.d(y,"scalePropertyNotWorkWithScaleType",(function(){return scalePropertyNotWorkWithScaleType})),r.d(y,"scaleTypeNotWorkWithMark",(function(){return scaleTypeNotWorkWithMark})),r.d(y,"mergeConflictingProperty",(function(){return mergeConflictingProperty})),r.d(y,"mergeConflictingDomainProperty",(function(){return mergeConflictingDomainProperty})),r.d(y,"independentScaleMeansIndependentGuide",(function(){return independentScaleMeansIndependentGuide})),r.d(y,"domainSortDropped",(function(){return domainSortDropped})),r.d(y,"UNABLE_TO_MERGE_DOMAINS",(function(){return MS})),r.d(y,"MORE_THAN_ONE_SORT",(function(){return FS})),r.d(y,"INVALID_CHANNEL_FOR_AXIS",(function(){return IS})),r.d(y,"cannotStackRangedMark",(function(){return cannotStackRangedMark})),r.d(y,"cannotStackNonLinearScale",(function(){return cannotStackNonLinearScale})),r.d(y,"stackNonSummativeAggregate",(function(){return stackNonSummativeAggregate})),r.d(y,"invalidTimeUnit",(function(){return invalidTimeUnit})),r.d(y,"dayReplacedWithDate",(function(){return dayReplacedWithDate})),r.d(y,"droppedDay",(function(){return droppedDay})),r.d(y,"errorBarCenterAndExtentAreNotNeeded",(function(){return errorBarCenterAndExtentAreNotNeeded})),r.d(y,"errorBarCenterIsUsedWithWrongExtent",(function(){return errorBarCenterIsUsedWithWrongExtent})),r.d(y,"errorBarContinuousAxisHasCustomizedAggregate",(function(){return errorBarContinuousAxisHasCustomizedAggregate})),r.d(y,"errorBarCenterIsNotNeeded",(function(){return errorBarCenterIsNotNeeded})),r.d(y,"errorBand1DNotSupport",(function(){return errorBand1DNotSupport})),r.d(y,"channelRequiredForBinned",(function(){return channelRequiredForBinned})),r.d(y,"domainRequiredForThresholdScale",(function(){return domainRequiredForThresholdScale}));var x={};r.r(x),r.d(x,"symbols",(function(){return encode_symbols})),r.d(x,"gradient",(function(){return legend_encode_gradient})),r.d(x,"labels",(function(){return encode_labels})),r.d(x,"getFirstConditionValue",(function(){return getFirstConditionValue}));var w={};r.r(w),r.d(w,"compile",(function(){return compile})),r.d(w,"extractTransforms",(function(){return extractTransforms})),r.d(w,"normalize",(function(){return normalize_normalize})),r.d(w,"version",(function(){return rO}));var k={};r.r(k),r.d(k,"dark",(function(){return oO})),r.d(k,"excel",(function(){return sO})),r.d(k,"fivethirtyeight",(function(){return uO})),r.d(k,"ggplot2",(function(){return lO})),r.d(k,"latimes",(function(){return dO})),r.d(k,"quartz",(function(){return hO})),r.d(k,"vox",(function(){return pO})),r.d(k,"version",(function(){return gO}));var S=r(16),E=r.n(S),C=r(1),T=r.n(C),O=r(4),A=r.n(O);function __rest(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}var R="http://www.w3.org/1999/xhtml",D={svg:"http://www.w3.org/2000/svg",xhtml:R,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},P=function(e){var t=e+="",r=t.indexOf(":");return r>=0&&"xmlns"!==(t=e.slice(0,r))&&(e=e.slice(r+1)),D.hasOwnProperty(t)?{space:D[t],local:e}:e};function creatorInherit(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===R&&t.documentElement.namespaceURI===R?t.createElement(e):t.createElementNS(r,e)}}function creatorFixed(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}var j=function(e){var t=P(e);return(t.local?creatorFixed:creatorInherit)(t)};function none(){}var M=function(e){return null==e?none:function(){return this.querySelector(e)}};function empty(){return[]}var F=function(e){return new Array(e.length)};function EnterNode(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}EnterNode.prototype={constructor:EnterNode,appendChild:function appendChild(e){return this._parent.insertBefore(e,this._next)},insertBefore:function insertBefore(e,t){return this._parent.insertBefore(e,t)},querySelector:function querySelector(e){return this._parent.querySelector(e)},querySelectorAll:function querySelectorAll(e){return this._parent.querySelectorAll(e)}};var I="$";function bindIndex(e,t,r,n,i,a){for(var o,s=0,u=t.length,l=a.length;s<l;++s)(o=t[s])?(o.__data__=a[s],n[s]=o):r[s]=new EnterNode(e,a[s]);for(;s<u;++s)(o=t[s])&&(i[s]=o)}function bindKey(e,t,r,n,i,a,o){var s,u,l,c={},f=t.length,d=a.length,h=new Array(f);for(s=0;s<f;++s)(u=t[s])&&(h[s]=l=I+o.call(u,u.__data__,s,t),l in c?i[s]=u:c[l]=u);for(s=0;s<d;++s)(u=c[l=I+o.call(e,a[s],s,a)])?(n[s]=u,u.__data__=a[s],c[l]=null):r[s]=new EnterNode(e,a[s]);for(s=0;s<f;++s)(u=t[s])&&c[h[s]]===u&&(i[s]=u)}function ascending(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function attrRemove(e){return function(){this.removeAttribute(e)}}function attrRemoveNS(e){return function(){this.removeAttributeNS(e.space,e.local)}}function attrConstant(e,t){return function(){this.setAttribute(e,t)}}function attrConstantNS(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function attrFunction(e,t){return function(){var r=t.apply(this,arguments);null==r?this.removeAttribute(e):this.setAttribute(e,r)}}function attrFunctionNS(e,t){return function(){var r=t.apply(this,arguments);null==r?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}var L=function(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView};function styleRemove(e){return function(){this.style.removeProperty(e)}}function styleConstant(e,t,r){return function(){this.style.setProperty(e,t,r)}}function styleFunction(e,t,r){return function(){var n=t.apply(this,arguments);null==n?this.style.removeProperty(e):this.style.setProperty(e,n,r)}}function styleValue(e,t){return e.style.getPropertyValue(t)||L(e).getComputedStyle(e,null).getPropertyValue(t)}function propertyRemove(e){return function(){delete this[e]}}function propertyConstant(e,t){return function(){this[e]=t}}function propertyFunction(e,t){return function(){var r=t.apply(this,arguments);null==r?delete this[e]:this[e]=r}}function classArray(e){return e.trim().split(/^|\s+/)}function classList(e){return e.classList||new ClassList(e)}function ClassList(e){this._node=e,this._names=classArray(e.getAttribute("class")||"")}function classedAdd(e,t){for(var r=classList(e),n=-1,i=t.length;++n<i;)r.add(t[n])}function classedRemove(e,t){for(var r=classList(e),n=-1,i=t.length;++n<i;)r.remove(t[n])}function classedTrue(e){return function(){classedAdd(this,e)}}function classedFalse(e){return function(){classedRemove(this,e)}}function classedFunction(e,t){return function(){(t.apply(this,arguments)?classedAdd:classedRemove)(this,e)}}ClassList.prototype={add:function add(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function remove(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function contains(e){return this._names.indexOf(e)>=0}};function textRemove(){this.textContent=""}function textConstant(e){return function(){this.textContent=e}}function textFunction(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function htmlRemove(){this.innerHTML=""}function htmlConstant(e){return function(){this.innerHTML=e}}function htmlFunction(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function raise(){this.nextSibling&&this.parentNode.appendChild(this)}function lower_lower(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function constantNull(){return null}function remove_remove(){var e=this.parentNode;e&&e.removeChild(this)}function selection_cloneShallow(){return this.parentNode.insertBefore(this.cloneNode(!1),this.nextSibling)}function selection_cloneDeep(){return this.parentNode.insertBefore(this.cloneNode(!0),this.nextSibling)}var N={},B=null;"undefined"!==typeof document&&("onmouseenter"in document.documentElement||(N={mouseenter:"mouseover",mouseleave:"mouseout"}));function filterContextListener(e,t,r){return e=contextListener(e,t,r),function(t){var r=t.relatedTarget;r&&(r===this||8&r.compareDocumentPosition(this))||e.call(this,t)}}function contextListener(e,t,r){return function(n){var i=B;B=n;try{e.call(this,this.__data__,t,r)}finally{B=i}}}function parseTypenames(e){return e.trim().split(/^|\s+/).map((function(e){var t="",r=e.indexOf(".");return r>=0&&(t=e.slice(r+1),e=e.slice(0,r)),{type:e,name:t}}))}function onRemove(e){return function(){var t=this.__on;if(t){for(var r,n=0,i=-1,a=t.length;n<a;++n)r=t[n],e.type&&r.type!==e.type||r.name!==e.name?t[++i]=r:this.removeEventListener(r.type,r.listener,r.capture);++i?t.length=i:delete this.__on}}}function onAdd(e,t,r){var n=N.hasOwnProperty(e.type)?filterContextListener:contextListener;return function(i,a,o){var s,u=this.__on,l=n(t,a,o);if(u)for(var c=0,f=u.length;c<f;++c)if((s=u[c]).type===e.type&&s.name===e.name)return this.removeEventListener(s.type,s.listener,s.capture),this.addEventListener(s.type,s.listener=l,s.capture=r),void(s.value=t);this.addEventListener(e.type,l,r),s={type:e.type,name:e.name,value:t,listener:l,capture:r},u?u.push(s):this.__on=[s]}}function dispatchEvent(e,t,r){var n=L(e),i=n.CustomEvent;"function"===typeof i?i=new i(t,r):(i=n.document.createEvent("Event"),r?(i.initEvent(t,r.bubbles,r.cancelable),i.detail=r.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function dispatchConstant(e,t){return function(){return dispatchEvent(this,e,t)}}function dispatchFunction(e,t){return function(){return dispatchEvent(this,e,t.apply(this,arguments))}}var U=[null];function Selection(e,t){this._groups=e,this._parents=t}function selection_selection(){return new Selection([[document.documentElement]],U)}Selection.prototype=selection_selection.prototype={constructor:Selection,select:function(e){"function"!==typeof e&&(e=M(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i<r;++i)for(var a,o,s=t[i],u=s.length,l=n[i]=new Array(u),c=0;c<u;++c)(a=s[c])&&(o=e.call(a,a.__data__,c,s))&&("__data__"in a&&(o.__data__=a.__data__),l[c]=o);return new Selection(n,this._parents)},selectAll:function(e){var t;"function"!==typeof e&&(e=null==(t=e)?empty:function(){return this.querySelectorAll(t)});for(var r=this._groups,n=r.length,i=[],a=[],o=0;o<n;++o)for(var s,u=r[o],l=u.length,c=0;c<l;++c)(s=u[c])&&(i.push(e.call(s,s.__data__,c,u)),a.push(s));return new Selection(i,a)},filter:function(e){var t;"function"!==typeof e&&(t=e,e=function(){return this.matches(t)});for(var r=this._groups,n=r.length,i=new Array(n),a=0;a<n;++a)for(var o,s=r[a],u=s.length,l=i[a]=[],c=0;c<u;++c)(o=s[c])&&e.call(o,o.__data__,c,s)&&l.push(o);return new Selection(i,this._parents)},data:function(e,t){if(!e)return p=new Array(this.size()),c=-1,this.each((function(e){p[++c]=e})),p;var r,n=t?bindKey:bindIndex,i=this._parents,a=this._groups;"function"!==typeof e&&(r=e,e=function(){return r});for(var o=a.length,s=new Array(o),u=new Array(o),l=new Array(o),c=0;c<o;++c){var f=i[c],d=a[c],h=d.length,p=e.call(f,f&&f.__data__,c,i),g=p.length,m=u[c]=new Array(g),v=s[c]=new Array(g);n(f,d,m,v,l[c]=new Array(h),p,t);for(var y,_,b=0,x=0;b<g;++b)if(y=m[b]){for(b>=x&&(x=b+1);!(_=v[x])&&++x<g;);y._next=_||null}}return(s=new Selection(s,i))._enter=u,s._exit=l,s},enter:function(){return new Selection(this._enter||this._groups.map(F),this._parents)},exit:function(){return new Selection(this._exit||this._groups.map(F),this._parents)},join:function(e,t,r){var n=this.enter(),i=this,a=this.exit();return n="function"===typeof e?e(n):n.append(e+""),null!=t&&(i=t(i)),null==r?a.remove():r(a),n&&i?n.merge(i).order():i},merge:function(e){for(var t=this._groups,r=e._groups,n=t.length,i=r.length,a=Math.min(n,i),o=new Array(n),s=0;s<a;++s)for(var u,l=t[s],c=r[s],f=l.length,d=o[s]=new Array(f),h=0;h<f;++h)(u=l[h]||c[h])&&(d[h]=u);for(;s<n;++s)o[s]=t[s];return new Selection(o,this._parents)},order:function(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var n,i=e[t],a=i.length-1,o=i[a];--a>=0;)(n=i[a])&&(o&&4^n.compareDocumentPosition(o)&&o.parentNode.insertBefore(n,o),o=n);return this},sort:function(e){function compareNode(t,r){return t&&r?e(t.__data__,r.__data__):!t-!r}e||(e=ascending);for(var t=this._groups,r=t.length,n=new Array(r),i=0;i<r;++i){for(var a,o=t[i],s=o.length,u=n[i]=new Array(s),l=0;l<s;++l)(a=o[l])&&(u[l]=a);u.sort(compareNode)}return new Selection(n,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){var e=new Array(this.size()),t=-1;return this.each((function(){e[++t]=this})),e},node:function(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var n=e[t],i=0,a=n.length;i<a;++i){var o=n[i];if(o)return o}return null},size:function(){var e=0;return this.each((function(){++e})),e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,r=0,n=t.length;r<n;++r)for(var i,a=t[r],o=0,s=a.length;o<s;++o)(i=a[o])&&e.call(i,i.__data__,o,a);return this},attr:function(e,t){var r=P(e);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((null==t?r.local?attrRemoveNS:attrRemove:"function"===typeof t?r.local?attrFunctionNS:attrFunction:r.local?attrConstantNS:attrConstant)(r,t))},style:function(e,t,r){return arguments.length>1?this.each((null==t?styleRemove:"function"===typeof t?styleFunction:styleConstant)(e,t,null==r?"":r)):styleValue(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?propertyRemove:"function"===typeof t?propertyFunction:propertyConstant)(e,t)):this.node()[e]},classed:function(e,t){var r=classArray(e+"");if(arguments.length<2){for(var n=classList(this.node()),i=-1,a=r.length;++i<a;)if(!n.contains(r[i]))return!1;return!0}return this.each(("function"===typeof t?classedFunction:t?classedTrue:classedFalse)(r,t))},text:function(e){return arguments.length?this.each(null==e?textRemove:("function"===typeof e?textFunction:textConstant)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?htmlRemove:("function"===typeof e?htmlFunction:htmlConstant)(e)):this.node().innerHTML},raise:function(){return this.each(raise)},lower:function(){return this.each(lower_lower)},append:function(e){var t="function"===typeof e?e:j(e);return this.select((function(){return this.appendChild(t.apply(this,arguments))}))},insert:function(e,t){var r="function"===typeof e?e:j(e),n=null==t?constantNull:"function"===typeof t?t:M(t);return this.select((function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)}))},remove:function(){return this.each(remove_remove)},clone:function(e){return this.select(e?selection_cloneDeep:selection_cloneShallow)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,r){var n,i,a=parseTypenames(e+""),o=a.length;if(!(arguments.length<2)){for(s=t?onAdd:onRemove,null==r&&(r=!1),n=0;n<o;++n)this.each(s(a[n],t,r));return this}var s=this.node().__on;if(s)for(var u,l=0,c=s.length;l<c;++l)for(n=0,u=s[l];n<o;++n)if((i=a[n]).type===u.type&&i.name===u.name)return u.value},dispatch:function(e,t){return this.each(("function"===typeof t?dispatchFunction:dispatchConstant)(e,t))}};var z=function(e){return"string"===typeof e?new Selection([[document.querySelector(e)]],[document.documentElement]):new Selection([[e]],U)},q=0;function Local(){this._="@"+(++q).toString(36)}Local.prototype=function local_local(){return new Local}.prototype={constructor:Local,get:function get(e){for(var t=this._;!(t in e);)if(!(e=e.parentNode))return;return e[t]},set:function set(e,t){return e[this._]=t},remove:function remove(e){return this._ in e&&delete e[this._]},toString:function toString(){return this._}};var W=r(95),G=r.n(W),H=r(138),V=r(0);function UniqueList(e){var t=e||V.x,r=[],n={};return r.add=function(e){var i=t(e);return n[i]||(n[i]=1,r.push(e)),r},r.remove=function(e){var i,a=t(e);return n[a]&&(n[a]=0,(i=r.indexOf(e))>=0&&r.splice(i,1)),r},r}var Y=r(12),$=function(e,t){return asyncCallback_ref.apply(this,arguments)};function asyncCallback_ref(){return(asyncCallback_ref=Object(Y.a)(A.a.mark((function _callee(e,t){return A.a.wrap((function _callee$(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,t(e);case 3:r.next=8;break;case 5:r.prev=5,r.t0=r.catch(0),e.error(r.t0);case 8:case"end":return r.stop()}}),_callee,null,[[0,5]])})))).apply(this,arguments)}var X=Symbol("vega_id"),K=1;function isTuple(e){return!(!e||!tupleid(e))}function tupleid(e){return e[X]}function setid(e,t){return e[X]=t,e}function ingest(e){var t=e===Object(e)?e:{data:e};return tupleid(t)?t:setid(t,K++)}function Tuple_derive(e){return rederive(e,ingest({}))}function rederive(e,t){for(var r in e)t[r]=e[r];return t}function replace(e,t){return setid(t,tupleid(e))}function stableCompare(e,t){return e?t?function(r,n){return e(r,n)||tupleid(t(r))-tupleid(t(n))}:function(t,r){return e(t,r)||tupleid(t)-tupleid(r)}:null}function isChangeSet(e){return e&&e.constructor===ChangeSet_changeset}function ChangeSet_changeset(){var e=[],t=[],r=[],n=[],i=[],a=!1;return{constructor:ChangeSet_changeset,insert:function insert(t){for(var r=Object(V.i)(t),n=0,i=r.length;n<i;++n)e.push(r[n]);return this},remove:function remove(e){for(var r=Object(V.D)(e)?n:t,i=Object(V.i)(e),a=0,o=i.length;a<o;++a)r.push(i[a]);return this},modify:function modify(e,t,n){var a={field:t,value:Object(V.l)(n)};return Object(V.D)(e)?(a.filter=e,i.push(a)):(a.tuple=e,r.push(a)),this},encode:function encode(e,t){return Object(V.D)(e)?i.push({filter:e,field:t}):r.push({tuple:e,field:t}),this},reflow:function reflow(){return a=!0,this},pulse:function pulse(o,s){var u,l,c,f,d,h,p={},g={};for(u=0,l=s.length;u<l;++u)p[tupleid(s[u])]=1;for(u=0,l=t.length;u<l;++u)p[tupleid(d=t[u])]=-1;for(u=0,l=n.length;u<l;++u)f=n[u],s.forEach((function(e){f(e)&&(p[tupleid(e)]=-1)}));for(u=0,l=e.length;u<l;++u)h=tupleid(d=e[u]),p[h]?p[h]=1:o.add.push(ingest(e[u]));for(u=0,l=s.length;u<l;++u)d=s[u],p[tupleid(d)]<0&&o.rem.push(d);function modify(e,t,r){r?e[t]=r(e):o.encode=t,a||(g[tupleid(e)]=e)}for(u=0,l=r.length;u<l;++u)d=(c=r[u]).tuple,f=c.field,(h=p[tupleid(d)])>0&&(modify(d,f,c.value),o.modifies(f));for(u=0,l=i.length;u<l;++u)c=i[u],f=c.filter,s.forEach((function(e){f(e)&&p[tupleid(e)]>0&&modify(e,c.field,c.value)})),o.modifies(c.field);if(a)o.mod=t.length||n.length?s.filter((function(e){return p[tupleid(e)]>0})):s.slice();else for(h in g)o.mod.push(g[h]);return o}}}var J="_:mod:_";function Parameters(){Object.defineProperty(this,J,{writable:!0,value:{}})}var Q=Parameters.prototype;Q.set=function(e,t,r,n){var i=this,a=i[e],o=i[J];return null!=t&&t>=0?(a[t]!==r||n)&&(a[t]=r,o[t+":"+e]=-1,o[e]=-1):(a!==r||n)&&(i[e]=r,o[e]=Object(V.A)(r)?1+r.length:-1),i},Q.modified=function(e,t){var r,n=this[J];if(!arguments.length){for(r in n)if(n[r])return!0;return!1}if(Object(V.A)(e)){for(r=0;r<e.length;++r)if(n[e[r]])return!0;return!1}return null!=t&&t>=0?t+1<n[e]||!!n[t+":"+e]:!!n[e]},Q.clear=function(){return this[J]={},this};var Z=0,ee=new Parameters;function Operator(e,t,r,n){this.id=++Z,this.value=e,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,t&&(this._update=t),r&&this.parameters(r,n)}var te=Operator.prototype;function Operator_flag(e){return function(t){var r=this.flags;return 0===arguments.length?!!(r&e):(this.flags=t?r|e:r&~e,this)}}te.targets=function(){return this._targets||(this._targets=UniqueList(V.w))},te.set=function(e){return this.value!==e?(this.value=e,1):0},te.skip=Operator_flag(1),te.modified=Operator_flag(2),te.parameters=function(e,t,r){t=!1!==t;var n,i,a,o,s=this,u=s._argval=s._argval||new Parameters,l=s._argops=s._argops||[],c=[];function add(e,r,n){n instanceof Operator?(n!==s&&(t&&n.targets().add(s),c.push(n)),l.push({op:n,name:e,index:r})):u.set(e,r,n)}for(n in e)if(i=e[n],"pulse"===n)Object(V.i)(i).forEach((function(e){e instanceof Operator?e!==s&&(e.targets().add(s),c.push(e)):Object(V.n)("Pulse parameters must be operator instances.")})),s.source=i;else if(Object(V.A)(i))for(u.set(n,-1,Array(a=i.length)),o=0;o<a;++o)add(n,o,i[o]);else add(n,-1,i);return this.marshall().clear(),r&&(l.initonly=!0),c},te.marshall=function(e){var t,r,n,i,a,o=this._argval||ee,s=this._argops;if(s){for(r=0,n=s.length;r<n;++r)a=(i=(t=s[r]).op).modified()&&i.stamp===e,o.set(t.name,t.index,i.value,a);if(s.initonly){for(r=0;r<n;++r)(t=s[r]).op.targets().remove(this);this._argops=null,this._update=null}}return o},te.evaluate=function(e){var t=this._update;if(t){var r=this.marshall(e.stamp),n=t.call(this,r,e);if(r.clear(),n!==this.value)this.value=n;else if(!this.modified())return e.StopPropagation}},te.run=function(e){return e.stamp<this.stamp?e.StopPropagation:(this.skip()?(this.skip(!1),t=0):t=this.evaluate(e),this.pulse=t||e);var t};var re=0;function EventStream(e,t,r){this.id=++re,this.value=null,r&&(this.receive=r),e&&(this._filter=e),t&&(this._apply=t)}function EventStream_stream(e,t,r){return new EventStream(e,t,r)}var ne=EventStream.prototype;ne._filter=V.eb,ne._apply=V.x,ne.targets=function(){return this._targets||(this._targets=UniqueList(V.w))},ne.consume=function(e){return arguments.length?(this._consume=!!e,this):!!this._consume},ne.receive=function(e){if(this._filter(e)){for(var t=this.value=this._apply(e),r=this._targets,n=r?r.length:0,i=0;i<n;++i)r[i].receive(t);this._consume&&(e.preventDefault(),e.stopPropagation())}},ne.filter=function(e){var t=EventStream_stream(e);return this.targets().add(t),t},ne.apply=function(e){var t=EventStream_stream(null,e);return this.targets().add(t),t},ne.merge=function(){var e=EventStream_stream();this.targets().add(e);for(var t=0,r=arguments.length;t<r;++t)arguments[t].targets().add(e);return e},ne.throttle=function(e){var t=-1;return this.filter((function(){var r=Date.now();return r-t>e?(t=r,1):0}))},ne.debounce=function(e){var t=EventStream_stream();return this.targets().add(EventStream_stream(null,null,Object(V.m)(e,(function(e){var r=e.dataflow;t.receive(e),r&&r.run&&r.run()})))),t},ne.between=function(e,t){var r=!1;return e.targets().add(EventStream_stream(null,null,(function(){r=!0}))),t.targets().add(EventStream_stream(null,null,(function(){r=!1}))),this.filter((function(){return r}))};var ie=/^([A-Za-z]+:)?\/\//,ae=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,oe=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,se="file://";function load(e,t){return _load.apply(this,arguments)}function _load(){return(_load=Object(Y.a)(A.a.mark((function _callee2(e,t){var r,n;return A.a.wrap((function _callee2$(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,this.sanitize(e,t);case 2:return r=i.sent,n=r.href,i.abrupt("return",r.localFile?this.file(n):this.http(n,t));case 5:case"end":return i.stop()}}),_callee2,this)})))).apply(this,arguments)}function sanitize(e,t){return _sanitize.apply(this,arguments)}function _sanitize(){return(_sanitize=Object(Y.a)(A.a.mark((function _callee3(e,t){var r,n,i,a,o,s,u;return A.a.wrap((function _callee3$(l){for(;;)switch(l.prev=l.next){case 0:return t=Object(V.o)({},this.options,t),r=this.fileAccess,n={href:null},s=ae.test(e.replace(oe,"")),null!=e&&"string"===typeof e&&s||Object(V.n)("Sanitize failure, invalid URI: "+Object(V.X)(e)),u=ie.test(e),(o=t.baseURL)&&!u&&(e.startsWith("/")||"/"===o[o.length-1]||(e="/"+e),e=o+e),a=(i=e.startsWith(se))||"file"===t.mode||"http"!==t.mode&&!u&&r,i?e=e.slice(se.length):e.startsWith("//")&&("file"===t.defaultProtocol?(e=e.slice(2),a=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(n,"localFile",{value:!!a}),n.href=e,t.target&&(n.target=t.target+""),t.rel&&(n.rel=t.rel+""),l.abrupt("return",n);case 13:case"end":return l.stop()}}),_callee3,this)})))).apply(this,arguments)}function fileLoader(e){return e?function(t){return new Promise((function(r,n){e.readFile(t,(function(e,t){e?n(e):r(t)}))}))}:fileReject}function fileReject(){return _fileReject.apply(this,arguments)}function _fileReject(){return(_fileReject=Object(Y.a)(A.a.mark((function _callee4(){return A.a.wrap((function _callee4$(e){for(;;)switch(e.prev=e.next){case 0:Object(V.n)("No file system access.");case 1:case"end":return e.stop()}}),_callee4)})))).apply(this,arguments)}function httpLoader(e){return e?function(){var t=Object(Y.a)(A.a.mark((function _callee(t,r){var n,i,a;return A.a.wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:return n=Object(V.o)({},this.options.http,r),i=r&&r.response,o.next=4,e(t,n);case 4:return a=o.sent,o.abrupt("return",a.ok?Object(V.D)(a[i])?a[i]():a.text():Object(V.n)(a.status+""+a.statusText));case 6:case"end":return o.stop()}}),_callee,this)})));return function(e,r){return t.apply(this,arguments)}}():httpReject}function httpReject(){return _httpReject.apply(this,arguments)}function _httpReject(){return(_httpReject=Object(Y.a)(A.a.mark((function _callee5(){return A.a.wrap((function _callee5$(e){for(;;)switch(e.prev=e.next){case 0:Object(V.n)("No HTTP fetch method available.");case 1:case"end":return e.stop()}}),_callee5)})))).apply(this,arguments)}var ue={boolean:V.Y,integer:V.ab,number:V.ab,date:V.Z,string:V.cb,unknown:V.x},le=[function isBoolean(e){return"true"===e||"false"===e||!0===e||!1===e},function isInteger(e){return isNumber(e)&&(e=+e)===~~e},isNumber,function isDate(e){return!isNaN(Date.parse(e))}],ce=["boolean","integer","number","date"];function inferTypes(e,t){return t.reduce((function(t,r){return t[r]=function inferType(e,t){if(!e||!e.length)return"unknown";var r,n,i,a,o=0,s=e.length,u=le.length,l=le.map((function(e,t){return t+1}));for(n=0,s=e.length;n<s;++n)for(r=t?e[n][t]:e[n],i=0;i<u;++i)if(l[i]&&(null!=(a=r)&&a===a)&&!le[i](r)&&(l[i]=0,++o===le.length))return"string";return o=l.reduce((function(e,t){return 0===e?t:e}),0)-1,ce[o]}(e,r),t}),{})}function isNumber(e){return!isNaN(+e)&&!(e instanceof Date)}var fe={},de={},he=34,pe=10,ge=13;function objectConverter(e){return new Function("d","return {"+e.map((function(e,t){return JSON.stringify(e)+": d["+t+"]"})).join(",")+"}")}function inferColumns(e){var t=Object.create(null),r=[];return e.forEach((function(e){for(var n in e)n in t||r.push(t[n]=n)})),r}function dsv_pad(e,t){var r=e+"",n=r.length;return n<t?new Array(t-n+1).join(0)+r:r}function formatDate(e){var t=e.getUTCHours(),r=e.getUTCMinutes(),n=e.getUTCSeconds(),i=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":function dsv_formatYear(e){return e<0?"-"+dsv_pad(-e,6):e>9999?"+"+dsv_pad(e,6):dsv_pad(e,4)}(e.getUTCFullYear())+"-"+dsv_pad(e.getUTCMonth()+1,2)+"-"+dsv_pad(e.getUTCDate(),2)+(i?"T"+dsv_pad(t,2)+":"+dsv_pad(r,2)+":"+dsv_pad(n,2)+"."+dsv_pad(i,3)+"Z":n?"T"+dsv_pad(t,2)+":"+dsv_pad(r,2)+":"+dsv_pad(n,2)+"Z":r||t?"T"+dsv_pad(t,2)+":"+dsv_pad(r,2)+"Z":"")}var me=function(e){var t=new RegExp('["'+e+"\n\r]"),r=e.charCodeAt(0);function parseRows(e,t){var n,i=[],a=e.length,o=0,s=0,u=a<=0,l=!1;function token(){if(u)return de;if(l)return l=!1,fe;var t,n,i=o;if(e.charCodeAt(i)===he){for(;o++<a&&e.charCodeAt(o)!==he||e.charCodeAt(++o)===he;);return(t=o)>=a?u=!0:(n=e.charCodeAt(o++))===pe?l=!0:n===ge&&(l=!0,e.charCodeAt(o)===pe&&++o),e.slice(i+1,t-1).replace(/""/g,'"')}for(;o<a;){if((n=e.charCodeAt(t=o++))===pe)l=!0;else if(n===ge)l=!0,e.charCodeAt(o)===pe&&++o;else if(n!==r)continue;return e.slice(i,t)}return u=!0,e.slice(i,a)}for(e.charCodeAt(a-1)===pe&&--a,e.charCodeAt(a-1)===ge&&--a;(n=token())!==de;){for(var c=[];n!==fe&&n!==de;)c.push(n),n=token();t&&null==(c=t(c,s++))||i.push(c)}return i}function preformatBody(t,r){return t.map((function(t){return r.map((function(e){return formatValue(t[e])})).join(e)}))}function formatRow(t){return t.map(formatValue).join(e)}function formatValue(e){return null==e?"":e instanceof Date?formatDate(e):t.test(e+="")?'"'+e.replace(/"/g,'""')+'"':e}return{parse:function parse(e,t){var r,n,i=parseRows(e,(function(e,i){if(r)return r(e,i-1);n=e,r=t?function customConverter(e,t){var r=objectConverter(e);return function(n,i){return t(r(n),i,e)}}(e,t):objectConverter(e)}));return i.columns=n||[],i},parseRows:parseRows,format:function format(t,r){return null==r&&(r=inferColumns(t)),[r.map(formatValue).join(e)].concat(preformatBody(t,r)).join("\n")},formatBody:function formatBody(e,t){return null==t&&(t=inferColumns(e)),preformatBody(e,t).join("\n")},formatRows:function formatRows(e){return e.map(formatRow).join("\n")}}},ve=me(","),ye=(ve.parse,ve.parseRows,ve.format,ve.formatBody,ve.formatRows,me("\t"));ye.parse,ye.parseRows,ye.format,ye.formatBody,ye.formatRows;function delimitedFormat(e){var t=function parse(t,r){var n={delimiter:e};return dsv_dsv(t,r?Object(V.o)(r,n):n)};return t.responseType="text",t}function dsv_dsv(e,t){return t.header&&(e=t.header.map(V.X).join(t.delimiter)+"\n"+e),me(t.delimiter).parse(e+"")}dsv_dsv.responseType="text";var _e=r(87),be=function(e){return e},xe=function(e){if(null==e)return be;var t,r,n=e.scale[0],i=e.scale[1],a=e.translate[0],o=e.translate[1];return function(e,s){s||(t=r=0);var u=2,l=e.length,c=new Array(l);for(c[0]=(t+=e[0])*n+a,c[1]=(r+=e[1])*i+o;u<l;)c[u]=e[u],++u;return c}},we=function(e,t){for(var r,n=e.length,i=n-t;i<--n;)r=e[i],e[i++]=e[n],e[n]=r},ke=function(e,t){return"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map((function(t){return feature_feature(e,t)}))}:feature_feature(e,t)};function feature_feature(e,t){var r=t.id,n=t.bbox,i=null==t.properties?{}:t.properties,a=feature_object(e,t);return null==r&&null==n?{type:"Feature",properties:i,geometry:a}:null==n?{type:"Feature",id:r,properties:i,geometry:a}:{type:"Feature",id:r,bbox:n,properties:i,geometry:a}}function feature_object(e,t){var r=xe(e.transform),n=e.arcs;function arc(e,t){t.length&&t.pop();for(var i=n[e<0?~e:e],a=0,o=i.length;a<o;++a)t.push(r(i[a],a));e<0&&we(t,o)}function point(e){return r(e)}function line(e){for(var t=[],r=0,n=e.length;r<n;++r)arc(e[r],t);return t.length<2&&t.push(t[0]),t}function ring(e){for(var t=line(e);t.length<4;)t.push(t[0]);return t}function polygon(e){return e.map(ring)}return function geometry(e){var t,r=e.type;switch(r){case"GeometryCollection":return{type:r,geometries:e.geometries.map(geometry)};case"Point":t=point(e.coordinates);break;case"MultiPoint":t=e.coordinates.map(point);break;case"LineString":t=line(e.arcs);break;case"MultiLineString":t=e.arcs.map(line);break;case"Polygon":t=polygon(e.arcs);break;case"MultiPolygon":t=e.arcs.map(polygon);break;default:return null}return{type:r,coordinates:t}}(t)}var Se=function(e,t){var r={},n={},i={},a=[],o=-1;function flush(e,t){for(var n in e){var i=e[n];delete t[i.start],delete i.start,delete i.end,i.forEach((function(e){r[e<0?~e:e]=1})),a.push(i)}}return t.forEach((function(r,n){var i,a=e.arcs[r<0?~r:r];a.length<3&&!a[1][0]&&!a[1][1]&&(i=t[++o],t[o]=r,t[n]=i)})),t.forEach((function(t){var r,a,o=function ends(t){var r,n=e.arcs[t<0?~t:t],i=n[0];e.transform?(r=[0,0],n.forEach((function(e){r[0]+=e[0],r[1]+=e[1]}))):r=n[n.length-1];return t<0?[r,i]:[i,r]}(t),s=o[0],u=o[1];if(r=i[s])if(delete i[r.end],r.push(t),r.end=u,a=n[u]){delete n[a.start];var l=a===r?r:r.concat(a);n[l.start=r.start]=i[l.end=a.end]=l}else n[r.start]=i[r.end]=r;else if(r=n[u])if(delete n[r.start],r.unshift(t),r.start=s,a=i[s]){delete i[a.end];var c=a===r?r:a.concat(r);n[c.start=a.start]=i[c.end=r.end]=c}else n[r.start]=i[r.end]=r;else n[(r=[t]).start=s]=i[r.end=u]=r})),flush(i,n),flush(n,i),t.forEach((function(e){r[e<0?~e:e]||a.push([e])})),a},Ee=function(e){return feature_object(e,meshArcs.apply(this,arguments))};function meshArcs(e,t,r){var n,i,a;if(arguments.length>1)n=function extractArcs(e,t,r){var n,i=[],a=[];function extract0(e){var t=e<0?~e:e;(a[t]||(a[t]=[])).push({i:e,g:n})}function extract1(e){e.forEach(extract0)}function extract2(e){e.forEach(extract1)}return function geometry(e){switch(n=e,e.type){case"GeometryCollection":e.geometries.forEach(geometry);break;case"LineString":extract1(e.arcs);break;case"MultiLineString":case"Polygon":extract2(e.arcs);break;case"MultiPolygon":!function extract3(e){e.forEach(extract2)}(e.arcs)}}(t),a.forEach(null==r?function(e){i.push(e[0].i)}:function(e){r(e[0].g,e[e.length-1].g)&&i.push(e[0].i)}),i}(0,t,r);else for(i=0,n=new Array(a=e.arcs.length);i<a;++i)n[i]=i;return{type:"MultiLineString",arcs:Se(e,n)}}var Ce={interior:function interior(e,t){return e!==t},exterior:function exterior(e,t){return e===t}};function topojson(e,t){var r,n,i,a;return e=Object(_e.a)(e,t),t&&t.feature?(r=ke,i=t.feature):t&&t.mesh?(r=Ee,i=t.mesh,a=Ce[t.filter]):Object(V.n)("Missing TopoJSON feature or mesh parameter."),(n=(n=e.objects[i])?r(e,n,a):Object(V.n)("Invalid TopoJSON object: "+i))&&n.features||[n]}topojson.responseType="json";var Te={dsv:dsv_dsv,csv:delimitedFormat(","),tsv:delimitedFormat("\t"),json:_e.a,topojson:topojson};function formats_formats(e,t){return arguments.length>1?(Te[e]=t,this):Object(V.v)(Te,e)?Te[e]:null}function responseType(e){var t=formats_formats(e);return t&&t.responseType||"text"}var Oe=new Date,Ae=new Date;function newInterval(e,t,r,n){function interval(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return interval.floor=function(t){return e(t=new Date(+t)),t},interval.ceil=function(r){return e(r=new Date(r-1)),t(r,1),e(r),r},interval.round=function(e){var t=interval(e),r=interval.ceil(e);return e-t<r-e?t:r},interval.offset=function(e,r){return t(e=new Date(+e),null==r?1:Math.floor(r)),e},interval.range=function(r,n,i){var a,o=[];if(r=interval.ceil(r),i=null==i?1:Math.floor(i),!(r<n)||!(i>0))return o;do{o.push(a=new Date(+r)),t(r,i),e(r)}while(a<r&&r<n);return o},interval.filter=function(r){return newInterval((function(t){if(t>=t)for(;e(t),!r(t);)t.setTime(t-1)}),(function(e,n){if(e>=e)if(n<0)for(;++n<=0;)for(;t(e,-1),!r(e););else for(;--n>=0;)for(;t(e,1),!r(e););}))},r&&(interval.count=function(t,n){return Oe.setTime(+t),Ae.setTime(+n),e(Oe),e(Ae),Math.floor(r(Oe,Ae))},interval.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?interval.filter(n?function(t){return n(t)%e===0}:function(t){return interval.count(0,t)%e===0}):interval:null}),interval}var Re=6e4,De=6048e5;function utcWeekday(e){return newInterval((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/De}))}var Pe=utcWeekday(0),je=utcWeekday(1),Me=utcWeekday(2),Fe=utcWeekday(3),Ie=utcWeekday(4),Le=utcWeekday(5),Ne=utcWeekday(6),Be=(Pe.range,je.range,Me.range,Fe.range,Ie.range,Le.range,Ne.range,newInterval((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/864e5}),(function(e){return e.getUTCDate()-1}))),Ue=Be;Be.range;function weekday(e){return newInterval((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Re)/De}))}var ze=weekday(0),qe=weekday(1),We=weekday(2),Ge=weekday(3),He=weekday(4),Ve=weekday(5),Ye=weekday(6),$e=(ze.range,qe.range,We.range,Ge.range,He.range,Ve.range,Ye.range,newInterval((function(e){e.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Re)/864e5}),(function(e){return e.getDate()-1}))),Xe=$e,Ke=($e.range,newInterval((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()})));Ke.every=function(e){return isFinite(e=Math.floor(e))&&e>0?newInterval((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,r){t.setFullYear(t.getFullYear()+r*e)})):null};var Je=Ke,Qe=(Ke.range,newInterval((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()})));Qe.every=function(e){return isFinite(e=Math.floor(e))&&e>0?newInterval((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,r){t.setUTCFullYear(t.getUTCFullYear()+r*e)})):null};var Ze=Qe;Qe.range;function localDate(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function utcDate(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function newYear(e){return{y:e,m:0,d:1,H:0,M:0,S:0,L:0}}var et,tt,rt,nt,it,at={"-":"",_:" ",0:"0"},ot=/^\s*\d+/,st=/^%/,ut=/[\\^$*+?|[\]().{}]/g;function locale_pad(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a<r?new Array(r-a+1).join(t)+i:i)}function requote(e){return e.replace(ut,"\\$&")}function formatRe(e){return new RegExp("^(?:"+e.map(requote).join("|")+")","i")}function formatLookup(e){for(var t={},r=-1,n=e.length;++r<n;)t[e[r].toLowerCase()]=r;return t}function parseWeekdayNumberSunday(e,t,r){var n=ot.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function parseWeekdayNumberMonday(e,t,r){var n=ot.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function parseWeekNumberSunday(e,t,r){var n=ot.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function parseWeekNumberISO(e,t,r){var n=ot.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function parseWeekNumberMonday(e,t,r){var n=ot.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function parseFullYear(e,t,r){var n=ot.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function parseYear(e,t,r){var n=ot.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function parseZone(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function parseMonthNumber(e,t,r){var n=ot.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function parseDayOfMonth(e,t,r){var n=ot.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function parseDayOfYear(e,t,r){var n=ot.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function parseHour24(e,t,r){var n=ot.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function parseMinutes(e,t,r){var n=ot.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function parseSeconds(e,t,r){var n=ot.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function parseMilliseconds(e,t,r){var n=ot.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function parseMicroseconds(e,t,r){var n=ot.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function parseLiteralPercent(e,t,r){var n=st.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function parseUnixTimestamp(e,t,r){var n=ot.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function parseUnixTimestampSeconds(e,t,r){var n=ot.exec(t.slice(r));return n?(e.Q=1e3*+n[0],r+n[0].length):-1}function formatDayOfMonth(e,t){return locale_pad(e.getDate(),t,2)}function formatHour24(e,t){return locale_pad(e.getHours(),t,2)}function formatHour12(e,t){return locale_pad(e.getHours()%12||12,t,2)}function formatDayOfYear(e,t){return locale_pad(1+Xe.count(Je(e),e),t,3)}function formatMilliseconds(e,t){return locale_pad(e.getMilliseconds(),t,3)}function formatMicroseconds(e,t){return formatMilliseconds(e,t)+"000"}function formatMonthNumber(e,t){return locale_pad(e.getMonth()+1,t,2)}function formatMinutes(e,t){return locale_pad(e.getMinutes(),t,2)}function formatSeconds(e,t){return locale_pad(e.getSeconds(),t,2)}function formatWeekdayNumberMonday(e){var t=e.getDay();return 0===t?7:t}function formatWeekNumberSunday(e,t){return locale_pad(ze.count(Je(e),e),t,2)}function formatWeekNumberISO(e,t){var r=e.getDay();return e=r>=4||0===r?He(e):He.ceil(e),locale_pad(He.count(Je(e),e)+(4===Je(e).getDay()),t,2)}function formatWeekdayNumberSunday(e){return e.getDay()}function formatWeekNumberMonday(e,t){return locale_pad(qe.count(Je(e),e),t,2)}function locale_formatYear(e,t){return locale_pad(e.getFullYear()%100,t,2)}function formatFullYear(e,t){return locale_pad(e.getFullYear()%1e4,t,4)}function formatZone(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+locale_pad(t/60|0,"0",2)+locale_pad(t%60,"0",2)}function formatUTCDayOfMonth(e,t){return locale_pad(e.getUTCDate(),t,2)}function formatUTCHour24(e,t){return locale_pad(e.getUTCHours(),t,2)}function formatUTCHour12(e,t){return locale_pad(e.getUTCHours()%12||12,t,2)}function formatUTCDayOfYear(e,t){return locale_pad(1+Ue.count(Ze(e),e),t,3)}function formatUTCMilliseconds(e,t){return locale_pad(e.getUTCMilliseconds(),t,3)}function formatUTCMicroseconds(e,t){return formatUTCMilliseconds(e,t)+"000"}function formatUTCMonthNumber(e,t){return locale_pad(e.getUTCMonth()+1,t,2)}function formatUTCMinutes(e,t){return locale_pad(e.getUTCMinutes(),t,2)}function formatUTCSeconds(e,t){return locale_pad(e.getUTCSeconds(),t,2)}function formatUTCWeekdayNumberMonday(e){var t=e.getUTCDay();return 0===t?7:t}function formatUTCWeekNumberSunday(e,t){return locale_pad(Pe.count(Ze(e),e),t,2)}function formatUTCWeekNumberISO(e,t){var r=e.getUTCDay();return e=r>=4||0===r?Ie(e):Ie.ceil(e),locale_pad(Ie.count(Ze(e),e)+(4===Ze(e).getUTCDay()),t,2)}function formatUTCWeekdayNumberSunday(e){return e.getUTCDay()}function formatUTCWeekNumberMonday(e,t){return locale_pad(je.count(Ze(e),e),t,2)}function formatUTCYear(e,t){return locale_pad(e.getUTCFullYear()%100,t,2)}function formatUTCFullYear(e,t){return locale_pad(e.getUTCFullYear()%1e4,t,4)}function formatUTCZone(){return"+0000"}function formatLiteralPercent(){return"%"}function formatUnixTimestamp(e){return+e}function formatUnixTimestampSeconds(e){return Math.floor(+e/1e3)}function defaultLocale(e){return et=function formatLocale(e){var t=e.dateTime,r=e.date,n=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,u=e.shortMonths,l=formatRe(i),c=formatLookup(i),f=formatRe(a),d=formatLookup(a),h=formatRe(o),p=formatLookup(o),g=formatRe(s),m=formatLookup(s),v=formatRe(u),y=formatLookup(u),_={a:function formatShortWeekday(e){return o[e.getDay()]},A:function formatWeekday(e){return a[e.getDay()]},b:function formatShortMonth(e){return u[e.getMonth()]},B:function formatMonth(e){return s[e.getMonth()]},c:null,d:formatDayOfMonth,e:formatDayOfMonth,f:formatMicroseconds,H:formatHour24,I:formatHour12,j:formatDayOfYear,L:formatMilliseconds,m:formatMonthNumber,M:formatMinutes,p:function formatPeriod(e){return i[+(e.getHours()>=12)]},Q:formatUnixTimestamp,s:formatUnixTimestampSeconds,S:formatSeconds,u:formatWeekdayNumberMonday,U:formatWeekNumberSunday,V:formatWeekNumberISO,w:formatWeekdayNumberSunday,W:formatWeekNumberMonday,x:null,X:null,y:locale_formatYear,Y:formatFullYear,Z:formatZone,"%":formatLiteralPercent},b={a:function formatUTCShortWeekday(e){return o[e.getUTCDay()]},A:function formatUTCWeekday(e){return a[e.getUTCDay()]},b:function formatUTCShortMonth(e){return u[e.getUTCMonth()]},B:function formatUTCMonth(e){return s[e.getUTCMonth()]},c:null,d:formatUTCDayOfMonth,e:formatUTCDayOfMonth,f:formatUTCMicroseconds,H:formatUTCHour24,I:formatUTCHour12,j:formatUTCDayOfYear,L:formatUTCMilliseconds,m:formatUTCMonthNumber,M:formatUTCMinutes,p:function formatUTCPeriod(e){return i[+(e.getUTCHours()>=12)]},Q:formatUnixTimestamp,s:formatUnixTimestampSeconds,S:formatUTCSeconds,u:formatUTCWeekdayNumberMonday,U:formatUTCWeekNumberSunday,V:formatUTCWeekNumberISO,w:formatUTCWeekdayNumberSunday,W:formatUTCWeekNumberMonday,x:null,X:null,y:formatUTCYear,Y:formatUTCFullYear,Z:formatUTCZone,"%":formatLiteralPercent},x={a:function parseShortWeekday(e,t,r){var n=h.exec(t.slice(r));return n?(e.w=p[n[0].toLowerCase()],r+n[0].length):-1},A:function parseWeekday(e,t,r){var n=f.exec(t.slice(r));return n?(e.w=d[n[0].toLowerCase()],r+n[0].length):-1},b:function parseShortMonth(e,t,r){var n=v.exec(t.slice(r));return n?(e.m=y[n[0].toLowerCase()],r+n[0].length):-1},B:function parseMonth(e,t,r){var n=g.exec(t.slice(r));return n?(e.m=m[n[0].toLowerCase()],r+n[0].length):-1},c:function parseLocaleDateTime(e,r,n){return parseSpecifier(e,t,r,n)},d:parseDayOfMonth,e:parseDayOfMonth,f:parseMicroseconds,H:parseHour24,I:parseHour24,j:parseDayOfYear,L:parseMilliseconds,m:parseMonthNumber,M:parseMinutes,p:function parsePeriod(e,t,r){var n=l.exec(t.slice(r));return n?(e.p=c[n[0].toLowerCase()],r+n[0].length):-1},Q:parseUnixTimestamp,s:parseUnixTimestampSeconds,S:parseSeconds,u:parseWeekdayNumberMonday,U:parseWeekNumberSunday,V:parseWeekNumberISO,w:parseWeekdayNumberSunday,W:parseWeekNumberMonday,x:function parseLocaleDate(e,t,n){return parseSpecifier(e,r,t,n)},X:function parseLocaleTime(e,t,r){return parseSpecifier(e,n,t,r)},y:parseYear,Y:parseFullYear,Z:parseZone,"%":parseLiteralPercent};function newFormat(e,t){return function(r){var n,i,a,o=[],s=-1,u=0,l=e.length;for(r instanceof Date||(r=new Date(+r));++s<l;)37===e.charCodeAt(s)&&(o.push(e.slice(u,s)),null!=(i=at[n=e.charAt(++s)])?n=e.charAt(++s):i="e"===n?" ":"0",(a=t[n])&&(n=a(r,i)),o.push(n),u=s+1);return o.push(e.slice(u,s)),o.join("")}}function newParse(e,t){return function(r){var n,i,a=newYear(1900);if(parseSpecifier(a,e,r+="",0)!=r.length)return null;if("Q"in a)return new Date(a.Q);if("p"in a&&(a.H=a.H%12+12*a.p),"V"in a){if(a.V<1||a.V>53)return null;"w"in a||(a.w=1),"Z"in a?(i=(n=utcDate(newYear(a.y))).getUTCDay(),n=i>4||0===i?je.ceil(n):je(n),n=Ue.offset(n,7*(a.V-1)),a.y=n.getUTCFullYear(),a.m=n.getUTCMonth(),a.d=n.getUTCDate()+(a.w+6)%7):(i=(n=t(newYear(a.y))).getDay(),n=i>4||0===i?qe.ceil(n):qe(n),n=Xe.offset(n,7*(a.V-1)),a.y=n.getFullYear(),a.m=n.getMonth(),a.d=n.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),i="Z"in a?utcDate(newYear(a.y)).getUTCDay():t(newYear(a.y)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(i+5)%7:a.w+7*a.U-(i+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,utcDate(a)):t(a)}}function parseSpecifier(e,t,r,n){for(var i,a,o=0,s=t.length,u=r.length;o<s;){if(n>=u)return-1;if(37===(i=t.charCodeAt(o++))){if(i=t.charAt(o++),!(a=x[i in at?t.charAt(o++):i])||(n=a(e,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}return _.x=newFormat(r,_),_.X=newFormat(n,_),_.c=newFormat(t,_),b.x=newFormat(r,b),b.X=newFormat(n,b),b.c=newFormat(t,b),{format:function format(e){var t=newFormat(e+="",_);return t.toString=function(){return e},t},parse:function parse(e){var t=newParse(e+="",localDate);return t.toString=function(){return e},t},utcFormat:function utcFormat(e){var t=newFormat(e+="",b);return t.toString=function(){return e},t},utcParse:function utcParse(e){var t=newParse(e,utcDate);return t.toString=function(){return e},t}}}(e),tt=et.format,rt=et.parse,nt=et.utcFormat,it=et.utcParse,et}defaultLocale({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});Date.prototype.toISOString||nt("%Y-%m-%dT%H:%M:%S.%LZ");+new Date("2000-01-01T00:00:00.000Z")||it("%Y-%m-%dT%H:%M:%S.%LZ");var lt=function(e,t){return function(r){return{options:r||{},sanitize:sanitize,load:load,fileAccess:!!t,file:fileLoader(t),http:httpLoader(e)}}}("undefined"!==typeof fetch&&fetch,null),ct=function(e,t,r){var n=formats_formats((t=t||{}).type||"json");return n||Object(V.n)("Unknown data format type: "+t.type),e=n(e,t),t.parse&&function read_parse(e,t,r){if(!e.length)return;r=r||rt;var n,i,a,o,s,u,l,c=e.columns||Object.keys(e[0]);"auto"===t&&(t=inferTypes(e,c));for(c=Object.keys(t),n=c.map((function(e){var n,i,a=t[e];if(a&&(0===a.indexOf("date:")||0===a.indexOf("utc:")))return("'"===(i=(n=a.split(/:(.+)?/,2))[1])[0]&&"'"===i[i.length-1]||'"'===i[0]&&'"'===i[i.length-1])&&(i=i.slice(1,-1)),"utc"===n[0]?it(i):r(i);if(!ue[a])throw Error("Illegal format pattern: "+e+":"+a);return ue[a]})),o=0,u=e.length,l=c.length;o<u;++o)for(i=e[o],s=0;s<l;++s)a=c[s],i[a]=n[s](i[a])}(e,t.parse,r),Object(V.v)(e,"columns")&&delete e.columns,e};function _request(){return(_request=Object(Y.a)(A.a.mark((function _callee(e,t){var r,n,i;return A.a.wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:return r=this,n=0,a.prev=2,a.next=5,r.loader().load(e,{context:"dataflow",response:responseType(t&&t.type)});case 5:i=a.sent;try{i=ct(i,t)}catch(o){n=-2,r.warn("Data ingestion failed",e,o)}a.next=13;break;case 9:a.prev=9,a.t0=a.catch(2),n=-1,r.warn("Loading failed",e,a.t0);case 13:return a.abrupt("return",{data:i,status:n});case 14:case"end":return a.stop()}}),_callee,this,[[2,9]])})))).apply(this,arguments)}function _preload(){return(_preload=Object(Y.a)(A.a.mark((function _callee2(e,t,r){var n,i,a;return A.a.wrap((function _callee2$(o){for(;;)switch(o.prev=o.next){case 0:return(i=(n=this)._pending||loadPending(n)).requests+=1,o.next=4,n.request(t,r);case 4:return a=o.sent,n.pulse(e,n.changeset().remove(V.eb).insert(a.data||[])),i.done(),o.abrupt("return",a);case 8:case"end":return o.stop()}}),_callee2,this)})))).apply(this,arguments)}function loadPending(e){var t,r=new Promise((function(e){t=e}));return r.requests=0,r.done=function(){0===--r.requests&&(e._pending=null,t(e))},e._pending=r}var ft={skip:!0};function onStream(e,t,r,n,i,a){var o,s,u=Object(V.o)({},a,ft);Object(V.D)(r)||(r=Object(V.l)(r)),void 0===n?o=function func(t){return e.touch(r(t))}:Object(V.D)(n)?(s=new Operator(null,n,i,!1),o=function func(t){s.evaluate(t);var n=r(t),i=s.value;isChangeSet(i)?e.pulse(n,i,a):e.update(n,i,u)}):o=function func(t){return e.update(r(t),n,u)},t.apply(o)}function onOperator(e,t,r,n,i,a){if(void 0===n)t.targets().add(r);else{var o=a||{},s=new Operator(null,function updater(e,t){return t=Object(V.D)(t)?t:Object(V.l)(t),e?function(r,n){var i=t(r,n);return e.skip()||(e.skip(i!==this.value).value=i),i}:t}(r,n),i,!1);s.modified(o.force),s.rank=t.rank,t.targets().add(s),r&&(s.skip(!0),s.value=r.value,s.targets().add(r),e.connect(r,[s]))}}var dt={};function Pulse(e,t,r){this.dataflow=e,this.stamp=null==t?-1:t,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=r||null}var ht=Pulse.prototype;function addFilter(e,t){return e?function(r,n){return e(r,n)&&t(r,n)}:t}function materialize(e,t){var r=[];return Object(V.gb)(e,t,(function(e){r.push(e)})),r}function Pulse_filter(e,t){var r={};return e.visit(t,(function(e){r[tupleid(e)]=1})),function(e){return r[tupleid(e)]?null:e}}function MultiPulse(e,t,r,n){var i,a,o,s,u,l=this,c=0;for(this.dataflow=e,this.stamp=t,this.fields=null,this.encode=n||null,this.pulses=r,o=0,s=r.length;o<s;++o)if((i=r[o]).stamp===t){if(i.fields)for(u in a=l.fields||(l.fields={}),i.fields)a[u]=1;i.changed(l.ADD)&&(c|=l.ADD),i.changed(l.REM)&&(c|=l.REM),i.changed(l.MOD)&&(c|=l.MOD)}this.changes=c}ht.StopPropagation=dt,ht.ADD=1,ht.REM=2,ht.MOD=4,ht.ADD_REM=3,ht.ADD_MOD=5,ht.ALL=7,ht.REFLOW=8,ht.SOURCE=16,ht.NO_SOURCE=32,ht.NO_FIELDS=64,ht.fork=function(e){return new Pulse(this.dataflow).init(this,e)},ht.clone=function(){var e=this.fork(7);return e.add=e.add.slice(),e.rem=e.rem.slice(),e.mod=e.mod.slice(),e.source&&(e.source=e.source.slice()),e.materialize(23)},ht.addAll=function(){var e=this;return this.source&&this.source.length!==this.add.length?((e=new Pulse(this.dataflow).init(this)).add=e.source,e):e},ht.init=function(e,t){var r=this;return r.stamp=e.stamp,r.encode=e.encode,!e.fields||64&t||(r.fields=e.fields),1&t?(r.addF=e.addF,r.add=e.add):(r.addF=null,r.add=[]),2&t?(r.remF=e.remF,r.rem=e.rem):(r.remF=null,r.rem=[]),4&t?(r.modF=e.modF,r.mod=e.mod):(r.modF=null,r.mod=[]),32&t?(r.srcF=null,r.source=null):(r.srcF=e.srcF,r.source=e.source),r},ht.runAfter=function(e){this.dataflow.runAfter(e)},ht.changed=function(e){var t=e||7;return 1&t&&this.add.length||2&t&&this.rem.length||4&t&&this.mod.length},ht.reflow=function(e){if(e)return this.fork(7).reflow();var t=this.add.length,r=this.source&&this.source.length;return r&&r!==t&&(this.mod=this.source,t&&this.filter(4,Pulse_filter(this,1))),this},ht.modifies=function(e){var t=Object(V.i)(e),r=this.fields||(this.fields={});return t.forEach((function(e){r[e]=!0})),this},ht.modified=function(e,t){var r=this.fields;return!(!t&&!this.mod.length||!r)&&(arguments.length?Object(V.A)(e)?e.some((function(e){return r[e]})):r[e]:!!r)},ht.filter=function(e,t){var r=this;return 1&e&&(r.addF=addFilter(r.addF,t)),2&e&&(r.remF=addFilter(r.remF,t)),4&e&&(r.modF=addFilter(r.modF,t)),16&e&&(r.srcF=addFilter(r.srcF,t)),r},ht.materialize=function(e){var t=this;return 1&(e=e||7)&&t.addF&&(t.add=materialize(t.add,t.addF),t.addF=null),2&e&&t.remF&&(t.rem=materialize(t.rem,t.remF),t.remF=null),4&e&&t.modF&&(t.mod=materialize(t.mod,t.modF),t.modF=null),16&e&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},ht.visit=function(e,t){var r,n,i=this,a=t;return 16&e?(Object(V.gb)(i.source,i.srcF,a),i):(1&e&&Object(V.gb)(i.add,i.addF,a),2&e&&Object(V.gb)(i.rem,i.remF,a),4&e&&Object(V.gb)(i.mod,i.modF,a),8&e&&(r=i.source)&&((n=i.add.length+i.mod.length)===r.length||(n?Object(V.gb)(r,Pulse_filter(i,5),a):Object(V.gb)(r,i.srcF,a))),i)};var pt=Object(V.y)(MultiPulse,Pulse);function _evaluate(){return(_evaluate=Object(Y.a)(A.a.mark((function _callee(e,t,r){var n,i,a,o,s,u,l,c,f,d;return A.a.wrap((function _callee$(h){for(;;)switch(h.prev=h.next){case 0:if(i=(n=this).logLevel(),!n._pulse){h.next=3;break}return h.abrupt("return",reentrant(n));case 3:if(!n._pending){h.next=6;break}return h.next=6,n._pending;case 6:if(!t){h.next=9;break}return h.next=9,$(n,t);case 9:if(n._touched.length){h.next=12;break}return n.info("Dataflow invoked, but nothing to do."),h.abrupt("return",n);case 12:a=++n._clock,o=0,n._pulse=new Pulse(n,a,e),i>=V.c&&(l=Date.now(),n.debug("-- START PROPAGATION ("+a+") -----")),n._touched.forEach((function(e){return n._enqueue(e,!0)})),n._touched=UniqueList(V.w),h.prev=17;case 18:if(!(n._heap.size()>0)){h.next=33;break}if((s=n._heap.pop()).rank===s.qrank){h.next=23;break}return n._enqueue(s,!0),h.abrupt("continue",18);case 23:if(!(u=s.run(n._getPulse(s,e))).then){h.next=28;break}return h.next=27,u;case 27:u=h.sent;case 28:i>=V.a&&n.debug(s.id,u===dt?"STOP":u,s),u!==dt&&s._targets&&s._targets.forEach((function(e){return n._enqueue(e)})),++o,h.next=18;break;case 33:h.next=39;break;case 35:h.prev=35,h.t0=h.catch(17),n._heap.clear(),c=h.t0;case 39:if(n._input={},n._pulse=null,i>=V.c&&(l=Date.now()-l,n.info("> Pulse "+a+": "+o+" operators; "+l+"ms")),c&&(n._postrun=[],n.error(c)),!n._postrun.length){h.next=53;break}f=n._postrun.sort((function(e,t){return t.priority-e.priority})),n._postrun=[],d=0;case 47:if(!(d<f.length)){h.next=53;break}return h.next=50,$(n,f[d].callback);case 50:++d,h.next=47;break;case 53:if(!r){h.next=56;break}return h.next=56,$(n,r);case 56:return h.abrupt("return",n);case 57:case"end":return h.stop()}}),_callee,this,[[17,35]])})))).apply(this,arguments)}function _runAsync(){return(_runAsync=Object(Y.a)(A.a.mark((function _callee2(e,t,r){var n,i=this;return A.a.wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:if(!this._running){a.next=5;break}return a.next=3,this._running;case 3:a.next=0;break;case 5:return n=function clear(){return i._running=null},(this._running=this.evaluate(e,t,r)).then(n,n),a.abrupt("return",this._running);case 8:case"end":return a.stop()}}),_callee2,this)})))).apply(this,arguments)}function reentrant(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}pt.fork=function(e){var t=new Pulse(this.dataflow).init(this,e&this.NO_FIELDS);return void 0!==e&&(e&t.ADD&&this.visit(t.ADD,(function(e){return t.add.push(e)})),e&t.REM&&this.visit(t.REM,(function(e){return t.rem.push(e)})),e&t.MOD&&this.visit(t.MOD,(function(e){return t.mod.push(e)}))),t},pt.changed=function(e){return this.changes&e},pt.modified=function(e){var t=this,r=t.fields;return r&&t.changes&t.MOD?Object(V.A)(e)?e.some((function(e){return r[e]})):r[e]:0},pt.filter=function(){Object(V.n)("MultiPulse does not support filtering.")},pt.materialize=function(){Object(V.n)("MultiPulse does not support materialization.")},pt.visit=function(e,t){var r=this,n=r.pulses,i=n.length,a=0;if(e&r.SOURCE)for(;a<i;++a)n[a].visit(e,t);else for(;a<i;++a)n[a].stamp===r.stamp&&n[a].visit(e,t);return r};var gt={skip:!1,force:!1};function Heap(e){var t=[];return{clear:function clear(){return t=[]},size:function size(){return t.length},peek:function peek(){return t[0]},push:function push(r){return t.push(r),siftdown(t,0,t.length-1,e)},pop:function pop(){var r,n=t.pop();return t.length?(r=t[0],t[0]=n,function siftup(e,t,r){var n,i=t,a=e.length,o=e[t],s=1+(t<<1);for(;s<a;)(n=s+1)<a&&r(e[s],e[n])>=0&&(s=n),e[t]=e[s],s=1+((t=s)<<1);return e[t]=o,siftdown(e,i,t,r)}(t,0,e)):r=n,r}}}function siftdown(e,t,r,n){var i,a,o;for(i=e[r];r>t&&n(i,a=e[o=r-1>>1])<0;)e[r]=a,r=o;return e[r]=i}function Dataflow(){this.logger(Object(V.K)()),this.logLevel(V.b),this._clock=0,this._rank=0;try{this._loader=lt()}catch(e){}this._touched=UniqueList(V.w),this._input={},this._pulse=null,this._heap=Heap((function(e,t){return e.qrank-t.qrank})),this._postrun=[]}var mt=Dataflow.prototype;function logMethod(e){return function(){return this._log[e].apply(this,arguments)}}function Transform(e,t){Operator.call(this,e,null,t)}mt.stamp=function(){return this._clock},mt.loader=function(e){return arguments.length?(this._loader=e,this):this._loader},mt.cleanThreshold=1e4,mt.add=function(e,t,r,n){var i,a=1;return e instanceof Operator?i=e:e&&e.prototype instanceof Operator?i=new e:Object(V.D)(e)?i=new Operator(null,e):(a=0,i=new Operator(e,t)),this.rank(i),a&&(n=r,r=t),r&&this.connect(i,i.parameters(r,n)),this.touch(i),i},mt.connect=function(e,t){var r,n,i=e.rank;for(r=0,n=t.length;r<n;++r)if(i<t[r].rank)return void this.rerank(e)},mt.rank=function rank(e){e.rank=++this._rank},mt.rerank=function rerank(e){for(var t,r,n,i=[e];i.length;)if(this.rank(t=i.pop()),r=t._targets)for(n=r.length;--n>=0;)i.push(t=r[n]),t===e&&Object(V.n)("Cycle detected in dataflow graph.")},mt.pulse=function update_pulse(e,t,r){this.touch(e,r||gt);var n=new Pulse(this,this._clock+(this._pulse?0:1)),i=e.pulse&&e.pulse.source||[];return n.target=e,this._input[e.id]=t.pulse(n,i),this},mt.touch=function update_touch(e,t){var r=t||gt;return this._pulse?this._enqueue(e):this._touched.add(e),r.skip&&e.skip(!0),this},mt.update=function update_update(e,t,r){var n=r||gt;return(e.set(t)||n.force)&&this.touch(e,n),this},mt.changeset=ChangeSet_changeset,mt.ingest=function load_ingest(e,t,r){return this.pulse(e,this.changeset().insert(ct(t,r)))},mt.parse=ct,mt.preload=function preload(e,t,r){return _preload.apply(this,arguments)},mt.request=function request(e,t){return _request.apply(this,arguments)},mt.events=function(e,t,r,n){for(var i,a=this,o=EventStream_stream(r,n),s=function send(e){e.dataflow=a;try{o.receive(e)}catch(t){a.error(t)}finally{a.run()}},u=0,l=(i="string"===typeof e&&"undefined"!==typeof document?document.querySelectorAll(e):Object(V.i)(e)).length;u<l;++u)i[u].addEventListener(t,s);return o},mt.on=function(e,t,r,n,i){return(e instanceof Operator?onOperator:onStream)(this,e,t,r,n,i),this},mt.evaluate=function evaluate(e,t,r){return _evaluate.apply(this,arguments)},mt.run=function run_run(e,t,r){return this._pulse?reentrant(this):(this.evaluate(e,t,r),this)},mt.runAsync=function runAsync(e,t,r){return _runAsync.apply(this,arguments)},mt.runAfter=function runAfter(e,t,r){if(this._pulse||t)this._postrun.push({priority:r||0,callback:e});else try{e(this)}catch(n){this.error(n)}},mt._enqueue=function enqueue(e,t){var r=e.stamp<this._clock;r&&(e.stamp=this._clock),(r||t)&&(e.qrank=e.rank,this._heap.push(e))},mt._getPulse=function getPulse(e,t){var r=e.source,n=this._clock;return r&&Object(V.A)(r)?new MultiPulse(this,n,r.map((function(e){return e.pulse})),t):this._input[e.id]||function singlePulse(e,t){if(t&&t.stamp===e.stamp)return t;e=e.fork(),t&&t!==dt&&(e.source=t.source);return e}(this._pulse,r&&r.pulse)},mt.logger=function(e){return arguments.length?(this._log=e,this):this._log},mt.error=logMethod("error"),mt.warn=logMethod("warn"),mt.info=logMethod("info"),mt.debug=logMethod("debug"),mt.logLevel=logMethod("level");var vt=Object(V.y)(Transform,Operator);vt.run=function(e){var t,r=this;return e.stamp<this.stamp?e.StopPropagation:(this.skip()?this.skip(!1):t=this.evaluate(e),(t=t||e).then?t=t.then((function(e){return r.pulse=e})):t!==e.StopPropagation&&(this.pulse=t),t)},vt.evaluate=function(e){var t=this.marshall(e.stamp),r=this.transform(t,e);return t.clear(),r},vt.transform=function(){};var yt={};function register_definition(e){var t=register_transform(e);return t&&t.Definition||null}function register_transform(e){return e=e&&e.toLowerCase(),Object(V.v)(yt,e)?yt[e]:null}function groupkey(e){return e&&e.length?1===e.length?e[0]:function multikey(e){return function(t){for(var r=e.length,n=1,i=String(e[0](t));n<r;++n)i+="|"+e[n](t);return i}}(e):function(){return""}}function measureName(e,t,r){return r||e+(t?"_"+t:"")}var _t={values:measure({name:"values",init:"cell.store = true;",set:"cell.data.values()",idx:-1}),count:measure({name:"count",set:"cell.num"}),__count__:measure({name:"count",set:"this.missing + this.valid"}),missing:measure({name:"missing",set:"this.missing"}),valid:measure({name:"valid",set:"this.valid"}),sum:measure({name:"sum",init:"this.sum = 0;",add:"this.sum += +v;",rem:"this.sum -= v;",set:"this.sum"}),mean:measure({name:"mean",init:"this.mean = 0;",add:"var d = v - this.mean; this.mean += d / this.valid;",rem:"var d = v - this.mean; this.mean -= this.valid ? d / this.valid : this.mean;",set:"this.valid ? this.mean : undefined"}),average:measure({name:"average",set:"this.valid ? this.mean : undefined",req:["mean"],idx:1}),variance:measure({name:"variance",init:"this.dev = 0;",add:"this.dev += d * (v - this.mean);",rem:"this.dev -= d * (v - this.mean);",set:"this.valid > 1 ? this.dev / (this.valid-1) : undefined",req:["mean"],idx:1}),variancep:measure({name:"variancep",set:"this.valid > 1 ? this.dev / this.valid : undefined",req:["variance"],idx:2}),stdev:measure({name:"stdev",set:"this.valid > 1 ? Math.sqrt(this.dev / (this.valid-1)) : undefined",req:["variance"],idx:2}),stdevp:measure({name:"stdevp",set:"this.valid > 1 ? Math.sqrt(this.dev / this.valid) : undefined",req:["variance"],idx:2}),stderr:measure({name:"stderr",set:"this.valid > 1 ? Math.sqrt(this.dev / (this.valid * (this.valid-1))) : undefined",req:["variance"],idx:2}),distinct:measure({name:"distinct",set:"cell.data.distinct(this.get)",req:["values"],idx:3}),ci0:measure({name:"ci0",set:"cell.data.ci0(this.get)",req:["values"],idx:3}),ci1:measure({name:"ci1",set:"cell.data.ci1(this.get)",req:["values"],idx:3}),median:measure({name:"median",set:"cell.data.q2(this.get)",req:["values"],idx:3}),q1:measure({name:"q1",set:"cell.data.q1(this.get)",req:["values"],idx:3}),q3:measure({name:"q3",set:"cell.data.q3(this.get)",req:["values"],idx:3}),argmin:measure({name:"argmin",init:"this.argmin = undefined;",add:"if (v < this.min) this.argmin = t;",rem:"if (v <= this.min) this.argmin = undefined;",set:"this.argmin || cell.data.argmin(this.get)",req:["min"],str:["values"],idx:3}),argmax:measure({name:"argmax",init:"this.argmax = undefined;",add:"if (v > this.max) this.argmax = t;",rem:"if (v >= this.max) this.argmax = undefined;",set:"this.argmax || cell.data.argmax(this.get)",req:["max"],str:["values"],idx:3}),min:measure({name:"min",init:"this.min = undefined;",add:"if (v < this.min || this.min === undefined) this.min = v;",rem:"if (v <= this.min) this.min = NaN;",set:"this.min = (isNaN(this.min) ? cell.data.min(this.get) : this.min)",str:["values"],idx:4}),max:measure({name:"max",init:"this.max = undefined;",add:"if (v > this.max || this.max === undefined) this.max = v;",rem:"if (v >= this.max) this.max = NaN;",set:"this.max = (isNaN(this.max) ? cell.data.max(this.get) : this.max)",str:["values"],idx:4})},bt=Object.keys(_t);function createMeasure(e,t){return _t[e](t)}function measure(e){return function(t){var r=Object(V.o)({init:"",add:"",rem:"",idx:0},e);return r.out=t||e.name,r}}function compareIndex(e,t){return e.idx-t.idx}function compileMeasures(e,t){var r=t||V.x,n=function AggregateOps_resolve(e,t){var r,n=e.reduce((function collect(e,r){function helper(t){e[t]||collect(e,e[t]=_t[t]())}return r.req&&r.req.forEach(helper),t&&r.str&&r.str.forEach(helper),e}),e.reduce((function(e,t){return e[t.name]=t,e}),{})),i=[];for(r in n)i.push(n[r]);return i.sort(compareIndex)}(e,!0),i="var cell = this.cell; this.valid = 0; this.missing = 0;",a="this.cell = cell; this.init();",o="if(v==null){++this.missing; return;} if(v!==v) return; ++this.valid;",s="if(v==null){--this.missing; return;} if(v!==v) return; --this.valid;",u="var cell = this.cell;";return n.forEach((function(e){i+=e.init,o+=e.add,s+=e.rem})),e.slice().sort(compareIndex).forEach((function(e){u+="t["+Object(V.X)(e.out)+"]="+e.set+";"})),u+="return t;",(a=Function("cell",a)).prototype.init=Function(i),a.prototype.add=Function("v","t",o),a.prototype.rem=Function("v","t",s),a.prototype.set=Function("t",u),a.prototype.get=r,a.fields=e.map((function(e){return e.out})),a}var xt=function(e){var t,r,n,i,a,o,s,u,l=e.maxbins||20,c=e.base||10,f=Math.log(c),d=e.divide||[5,2],h=e.extent[0],p=e.extent[1],g=e.span||p-h||Math.abs(h)||1;if(e.step)t=e.step;else if(e.steps){for(a=g/l,o=0,s=e.steps.length;o<s&&e.steps[o]<a;++o);t=e.steps[Math.max(0,o-1)]}else{for(r=Math.ceil(Math.log(l)/f),n=e.minstep||0,t=Math.max(n,Math.pow(c,Math.round(Math.log(g)/f)-r));Math.ceil(g/t)>l;)t*=c;for(o=0,s=d.length;o<s;++o)(a=t/d[o])>=n&&g/a<=l&&(t=a)}return i=(a=Math.log(t))>=0?0:1+~~(-a/f),u=Math.pow(c,-i-1),(e.nice||void 0===e.nice)&&(h=h<(a=Math.floor(h/t+u)*t)?a-t:a,p=Math.ceil(p/t)*t),{start:h,stop:p===h?h+t:p,step:t}},wt=A.a.mark(numbers_callee);function numbers_callee(e,t){var r,n,i,a,o,s,u,l,c,f,d,h,p;return A.a.wrap((function _callee$(g){for(;;)switch(g.prev=g.next){case 0:if(void 0!==t){g.next=30;break}r=!0,n=!1,i=void 0,g.prev=4,a=e[Symbol.iterator]();case 6:if(r=(o=a.next()).done){g.next=14;break}if(!(null!=(s=o.value)&&(s=+s)>=s)){g.next=11;break}return g.next=11,s;case 11:r=!0,g.next=6;break;case 14:g.next=20;break;case 16:g.prev=16,g.t0=g.catch(4),n=!0,i=g.t0;case 20:g.prev=20,g.prev=21,r||null==a.return||a.return();case 23:if(g.prev=23,!n){g.next=26;break}throw i;case 26:return g.finish(23);case 27:return g.finish(20);case 28:g.next=58;break;case 30:u=-1,l=!0,c=!1,f=void 0,g.prev=34,d=e[Symbol.iterator]();case 36:if(l=(h=d.next()).done){g.next=44;break}if(p=h.value,!(null!=(p=t(p,++u,e))&&(p=+p)>=p)){g.next=41;break}return g.next=41,p;case 41:l=!0,g.next=36;break;case 44:g.next=50;break;case 46:g.prev=46,g.t1=g.catch(34),c=!0,f=g.t1;case 50:g.prev=50,g.prev=51,l||null==d.return||d.return();case 53:if(g.prev=53,!c){g.next=56;break}throw f;case 56:return g.finish(53);case 57:return g.finish(50);case 58:case"end":return g.stop()}}),wt,null,[[4,16,20,28],[21,,23,27],[34,46,50,58],[51,,53,57]])}var kt=Math.random;function setRandom(e){kt=e}var St=function(e,t){return e<t?-1:e>t?1:e>=t?0:NaN},Et=A.a.mark(number_numbers),Ct=function(e){return null===e?NaN:+e};function number_numbers(e,t){var r,n,i,a,o,s,u,l,c,f,d,h,p;return A.a.wrap((function numbers$(g){for(;;)switch(g.prev=g.next){case 0:if(void 0!==t){g.next=30;break}r=!0,n=!1,i=void 0,g.prev=4,a=e[Symbol.iterator]();case 6:if(r=(o=a.next()).done){g.next=14;break}if(!(null!=(s=o.value)&&(s=+s)>=s)){g.next=11;break}return g.next=11,s;case 11:r=!0,g.next=6;break;case 14:g.next=20;break;case 16:g.prev=16,g.t0=g.catch(4),n=!0,i=g.t0;case 20:g.prev=20,g.prev=21,r||null==a.return||a.return();case 23:if(g.prev=23,!n){g.next=26;break}throw i;case 26:return g.finish(23);case 27:return g.finish(20);case 28:g.next=58;break;case 30:u=-1,l=!0,c=!1,f=void 0,g.prev=34,d=e[Symbol.iterator]();case 36:if(l=(h=d.next()).done){g.next=44;break}if(p=h.value,!(null!=(p=t(p,++u,e))&&(p=+p)>=p)){g.next=41;break}return g.next=41,p;case 41:l=!0,g.next=36;break;case 44:g.next=50;break;case 46:g.prev=46,g.t1=g.catch(34),c=!0,f=g.t1;case 50:g.prev=50,g.prev=51,l||null==d.return||d.return();case 53:if(g.prev=53,!c){g.next=56;break}throw f;case 56:return g.finish(53);case 57:return g.finish(50);case 58:case"end":return g.stop()}}),Et,null,[[4,16,20,28],[21,,23,27],[34,46,50,58],[51,,53,57]])}function quantile(e,t,r){return function quantileSorted(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ct;if(!(n=e.length))return;if((t=+t)<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),o=+r(e[a],a,e),s=+r(e[a+1],a+1,e);return o+(s-o)*(i-a)}(Float64Array.from(number_numbers(e,r)).sort(St),t)}var Tt=function(e,t,r,n){if(!e.length)return[void 0,void 0];var i,a,o,s,u=Float64Array.from(numbers_callee(e,n)),l=u.length,c=t;for(o=0,s=Array(c);o<c;++o){for(i=0,a=0;a<l;++a)i+=u[~~(kt()*l)];s[o]=i/l}return s.sort(St),[quantile(s,r/2),quantile(s,1-r/2)]},Ot=function(e,t){var r=Float64Array.from(numbers_callee(e,t));return r.sort(St),[quantile(r,.25),quantile(r,.5),quantile(r,.75)]},At=function(e){return function(){return(e=(1103515245*e+12345)%2147483647)/2147483647}},Rt=function(e,t){null==t&&(t=e,e=0);var r,n,i,a={};return a.min=function(e){return arguments.length?(i=n-(r=e||0),a):r},a.max=function(e){return arguments.length?(i=(n=e||0)-r,a):n},a.sample=function(){return r+Math.floor(i*kt())},a.pdf=function(e){return e===Math.floor(e)&&e>=r&&e<n?1/i:0},a.cdf=function(e){var t=Math.floor(e);return t<r?0:t>=n?1:(t-r+1)/i},a.icdf=function(e){return e>=0&&e<=1?r-1+Math.floor(e*i):NaN},a.min(e).max(t)},Dt=function(e,t){var r,n,i=NaN,a={mean:function(e){return arguments.length?(r=e||0,i=NaN,a):r},stdev:function(e){return arguments.length?(n=null==e?1:e,i=NaN,a):n},sample:function(){var e,t,a=0,o=0;if(i===i)return a=i,i=NaN,a;do{e=(a=2*kt()-1)*a+(o=2*kt()-1)*o}while(0===e||e>1);return t=Math.sqrt(-2*Math.log(e)/e),i=r+o*t*n,r+a*t*n},pdf:function(e){var t=Math.exp(Math.pow(e-r,2)/(-2*Math.pow(n,2)));return 1/(n*Math.sqrt(2*Math.PI))*t},cdf:function(e){var t,i=(e-r)/n,a=Math.abs(i);if(a>37)t=0;else{var o=Math.exp(-a*a/2);a<7.07106781186547?(t=o*((((((.0352624965998911*a+.700383064443688)*a+6.37396220353165)*a+33.912866078383)*a+112.079291497871)*a+221.213596169931)*a+220.206867912376),t/=((((((.0883883476483184*a+1.75566716318264)*a+16.064177579207)*a+86.7807322029461)*a+296.564248779674)*a+637.333633378831)*a+793.826512519948)*a+440.413735824752):t=o/(a+1/(a+2/(a+3/(a+4/(a+.65)))))/2.506628274631}return i>0?1-t:t},icdf:function(e){if(e<=0||e>=1)return NaN;var t=2*e-1,i=8*(Math.PI-3)/(3*Math.PI*(4-Math.PI)),a=2/(Math.PI*i)+Math.log(1-Math.pow(t,2))/2,o=Math.log(1-t*t)/i,s=(t>0?1:-1)*Math.sqrt(Math.sqrt(a*a-o)-a);return r+n*Math.SQRT2*s}};return a.mean(e).stdev(t)};var Pt=function(e,t){var r=Dt(),n={},i=0;return n.data=function(r){return arguments.length?(e=r,i=r?r.length:0,n.bandwidth(t)):e},n.bandwidth=function(r){return arguments.length?(!(t=r)&&e&&(t=estimateBandwidth(e)),n):t},n.sample=function(){return e[~~(kt()*i)]+t*r.sample()},n.pdf=function(n){for(var a=0,o=0;o<i;++o)a+=r.pdf((n-e[o])/t);return a/t/i},n.cdf=function(n){for(var a=0,o=0;o<i;++o)a+=r.cdf((n-e[o])/t);return a/i},n.icdf=function(){throw Error("KDE icdf not supported.")},n.data(e)};function estimateBandwidth(e){var t=e.length,r=Ot(e),n=(r[2]-r[0])/1.34;return 1.06*Math.min(Math.sqrt(function variance(e,t){var r,n=0,i=0,a=0;if(void 0===t){var o=!0,s=!1,u=void 0;try{for(var l,c=e[Symbol.iterator]();!(o=(l=c.next()).done);o=!0){var f=l.value;null!=f&&(f=+f)>=f&&(a+=(r=f-i)*(f-(i+=r/++n)))}}catch(_){s=!0,u=_}finally{try{o||null==c.return||c.return()}finally{if(s)throw u}}}else{var d=-1,h=!0,p=!1,g=void 0;try{for(var m,v=e[Symbol.iterator]();!(h=(m=v.next()).done);h=!0){var y=m.value;null!=(y=t(y,++d,e))&&(y=+y)>=y&&(a+=(r=y-i)*(y-(i+=r/++n)))}}catch(_){p=!0,g=_}finally{try{h||null==v.return||v.return()}finally{if(p)throw g}}}if(n>1)return a/(n-1)}(e)),n)*Math.pow(t,-.2)}var jt=function(e,t){var r,n={},i=0;function normalize(e){var t,r=[],n=0;for(t=0;t<i;++t)n+=r[t]=null==e[t]?1:+e[t];for(t=0;t<i;++t)r[t]/=n;return r}return n.weights=function(e){return arguments.length?(r=normalize(t=e||[]),n):t},n.distributions=function(r){return arguments.length?(r?(i=r.length,e=r):(i=0,e=[]),n.weights(t)):e},n.sample=function(){for(var t=kt(),n=e[i-1],a=r[0],o=0;o<i-1;a+=r[++o])if(t<a){n=e[o];break}return n.sample()},n.pdf=function(t){for(var n=0,a=0;a<i;++a)n+=r[a]*e[a].pdf(t);return n},n.cdf=function(t){for(var n=0,a=0;a<i;++a)n+=r[a]*e[a].cdf(t);return n},n.icdf=function(){throw Error("Mixture icdf not supported.")},n.distributions(e).weights(t)},Mt=function(e,t){null==t&&(t=null==e?1:e,e=0);var r,n,i,a={};return a.min=function(e){return arguments.length?(i=n-(r=e||0),a):r},a.max=function(e){return arguments.length?(i=(n=e||0)-r,a):n},a.sample=function(){return r+i*kt()},a.pdf=function(e){return e>=r&&e<=n?1/i:0},a.cdf=function(e){return e<r?0:e>n?1:(e-r)/i},a.icdf=function(e){return e>=0&&e<=1?r+e*i:NaN},a.min(e).max(t)},Ft=function(e,t,r,n){var i=n-e*e,a=Math.abs(i)<1e-24?0:(r-e*t)/i;return[t-a*e,a]};function points_points(e,t,r,n){e=e.filter((function(e){var n=t(e),i=r(e);return null!=n&&(n=+n)>=n&&null!=i&&(i=+i)>=i})),n&&e.sort((function(e,r){return t(e)-t(r)}));var i=new Float64Array(e.length),a=new Float64Array(e.length),o=0,s=!0,u=!1,l=void 0;try{for(var c,f=e[Symbol.iterator]();!(s=(c=f.next()).done);s=!0){var d=c.value;i[o]=t(d),a[o]=r(d),++o}}catch(h){u=!0,l=h}finally{try{s||null==f.return||f.return()}finally{if(u)throw l}}return[i,a]}function visitPoints(e,t,r,n){var i,a,o=-1,s=-1,u=!0,l=!1,c=void 0;try{for(var f,d=e[Symbol.iterator]();!(u=(f=d.next()).done);u=!0){var h=f.value;i=t(h,++o,e),a=r(h,o,e),null!=i&&(i=+i)>=i&&null!=a&&(a=+a)>=a&&n(i,a,++s)}}catch(p){l=!0,c=p}finally{try{u||null==d.return||d.return()}finally{if(l)throw c}}}var It=function(e,t,r,n,i){var a=0,o=0;return visitPoints(e,t,r,(function(e,t){var r=t-i(e),s=t-n;a+=r*r,o+=s*s})),1-a/o},Lt=function(e,t,r){var n=0,i=0,a=0,o=0,s=0;visitPoints(e,t,r,(function(e,t){n+=e,i+=t,a+=e*t,o+=e*e,++s}));var u=Ft(n/s,i/s,a/s,o/s),l=function predict(e){return u[0]+u[1]*e};return{coef:u,predict:l,rSquared:It(e,t,r,i/s,l)}},Nt=function(e,t,r){var n=0,i=0,a=0,o=0,s=0;visitPoints(e,t,r,(function(e,t){e=Math.log(e),n+=e,i+=t,a+=e*t,o+=e*e,++s}));var u=Ft(n/s,i/s,a/s,o/s),l=function predict(e){return u[0]+u[1]*Math.log(e)};return{coef:u,predict:l,rSquared:It(e,t,r,i/s,l)}},Bt=function(e,t,r){var n=0,i=0,a=0,o=0,s=0,u=0;visitPoints(e,t,r,(function(e,t){var r=Math.log(t),l=e*t;n+=t,a+=l,s+=e*l,i+=t*r,o+=l*r,++u}));var l=Ft(a/n,i/n,o/n,s/n),c=function predict(e){return l[0]*Math.exp(l[1]*e)};return l[0]=Math.exp(l[0]),{coef:l,predict:c,rSquared:It(e,t,r,n/u,c)}},Ut=function(e,t,r){var n=0,i=0,a=0,o=0,s=0,u=0;visitPoints(e,t,r,(function(e,t){var r=Math.log(e),l=Math.log(t);n+=r,i+=l,a+=r*l,o+=r*r,s+=t,++u}));var l=Ft(n/u,i/u,a/u,o/u),c=function predict(e){return l[0]*Math.pow(e,l[1])};return l[0]=Math.exp(l[0]),{coef:l,predict:c,rSquared:It(e,t,r,s/u,c)}},zt=function(e,t,r){var n=0,i=0,a=0,o=0,s=0,u=0,l=0,c=0;visitPoints(e,t,r,(function(e,t){var r=e*e;n+=e,i+=t,a+=r,o+=r*e,s+=r*r,u+=e*t,l+=r*t,++c}));var f=a-n*n/c,d=o-a*n/c,h=s-a*a/c,p=f*h-d*d,g=((l-=a*(i/=c))*f-(u-=n*i)*d)/p,m=(u*h-l*d)/p,v=i-m*(n/c)-g*(a/c),y=function predict(e){return g*e*e+m*e+v};return{coef:[v,m,g],predict:y,rSquared:It(e,t,r,i,y)}},qt=r(11),Wt=function(e,t,r,n){if(1===n)return Lt(e,t,r);if(2===n)return zt(e,t,r);var i,a,o,s,u,l=points_points(e,t,r),c=Object(qt.a)(l,2),f=c[0],d=c[1],h=f.length,p=[],g=[],m=n+1,v=0;for(i=0;i<h;++i)v+=d[i];for(i=0;i<m;++i){for(o=0,s=0;o<h;++o)s+=Math.pow(f[o],i)*d[o];for(p.push(s),u=new Float64Array(m),a=0;a<m;++a){for(o=0,s=0;o<h;++o)s+=Math.pow(f[o],i+a);u[a]=s}g.push(u)}g.push(p);var y=function gaussianElimination(e){var t,r,n,i,a,o=e.length-1,s=[];for(t=0;t<o;++t){for(i=t,r=t+1;r<o;++r)Math.abs(e[t][r])>Math.abs(e[t][i])&&(i=r);for(n=t;n<o+1;++n)a=e[n][t],e[n][t]=e[n][i],e[n][i]=a;for(r=t+1;r<o;++r)for(n=o;n>=t;n--)e[n][r]-=e[n][t]*e[t][r]/e[t][t]}for(r=o-1;r>=0;--r){for(a=0,n=r+1;n<o;++n)a+=e[n][r]*s[n];s[r]=(e[o][r]-a)/e[r][r]}return s}(g),_=function predict(e){for(var t=0,r=0,n=y.length;r<n;++r)t+=y[r]*Math.pow(e,r);return t};return{coef:y,predict:_,rSquared:It(e,t,r,v/h,_)}};function quickselect(e,t){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.length-1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:St;n>r;){if(n-r>600){var a=n-r+1,o=t-r+1,s=Math.log(a),u=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*u*(a-u)/a)*(o-a/2<0?-1:1);quickselect(e,t,Math.max(r,Math.floor(t-o*u/a+l)),Math.min(n,Math.floor(t+(a-o)*u/a+l)),i)}var c=e[t],f=r,d=n;for(swap(e,r,t),i(e[n],c)>0&&swap(e,r,n);f<d;){for(swap(e,f,d),++f,--d;i(e[f],c)<0;)++f;for(;i(e[d],c)>0;)--d}0===i(e[r],c)?swap(e,r,d):swap(e,++d,n),d<=t&&(r=d+1),t<=d&&(n=d-1)}return e}function swap(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}var Gt=function(e,t){if((e=Float64Array.from(number_numbers(e,t))).length){var r=e.length,n=r>>1;return quickselect(e,n-1,0),0===(1&r)&&quickselect(e,n,n),quantile(e,.5)}},Ht=function(e,t,r,n){for(var i=points_points(e,t,r,!0),a=Object(qt.a)(i,2),o=a[0],s=a[1],u=o.length,l=Math.max(2,~~(n*u)),c=new Float64Array(u),f=new Float64Array(u),d=new Float64Array(u).fill(1),h=-1;++h<=2;){for(var p=[0,l-1],g=0;g<u;++g){for(var m=o[g],v=p[0],y=p[1],_=m-o[v]>o[y]-m?v:y,b=0,x=0,w=0,k=0,S=0,E=1/Math.abs(o[_]-m||1),C=v;C<=y;++C){var T=o[C],O=s[C],A=tricube(Math.abs(m-T)*E)*d[C],R=T*A;b+=A,x+=R,w+=O*A,k+=O*R,S+=T*R}var D=Ft(x/b,w/b,k/b,S/b),P=Object(qt.a)(D,2),j=P[0],M=P[1];c[g]=j+M*m,f[g]=Math.abs(s[g]-c[g]),updateInterval(o,g+1,p)}if(2===h)break;var F=Gt(f);if(Math.abs(F)<1e-12)break;for(var I,L,N=0;N<u;++N)I=f[N]/(6*F),d[N]=I>=1?1e-12:(L=1-I*I)*L}return function loess_output(e,t){for(var r,n=e.length,i=[],a=0,o=0,s=[];a<n;++a)r=e[a],s[0]===r?s[1]+=(t[a]-s[1])/++o:(o=0,s=[r,t[a]],i.push(s));return i}(o,c)};function tricube(e){return(e=1-e*e*e)*e*e}function updateInterval(e,t,r){var n=e[t],i=r[0],a=r[1]+1;if(!(a>=e.length))for(;t>i&&e[a]-n<=n-e[i];)r[0]=++i,r[1]=a,++a}var Vt=.1*Math.PI/180,Yt=function(e,t,r,n){r=r||25,n=Math.max(r,n||200);var i=function point(t){return[t,e(t)]},a=t[0],o=t[1],s=o-a,u=s/n,l=[i(a)],c=[];if(r===n){for(var f=1;f<n;++f)l.push(i(a+f/r*s));return l.push(i(o)),l}c.push(i(o));for(var d=r;--d>0;)c.push(i(a+d/r*s));for(var h=l[0],p=c[c.length-1];p;){var g=i((h[0]+p[0])/2);g[0]-h[0]>=u&&angleDelta(h,g,p)>Vt?c.push(g):(h=p,l.push(p),c.pop()),p=c[c.length-1]}return l};function angleDelta(e,t,r){var n=Math.atan2(r[1]-e[1],r[0]-e[0]),i=Math.atan2(t[1]-e[1],t[0]-e[0]);return Math.abs(n-i)}function TupleStore(e){this._key=e?Object(V.t)(e):tupleid,this.reset()}var $t=TupleStore.prototype;function Aggregate(e){Transform.call(this,null,e),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}$t.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},$t.add=function(e){this._add.push(e)},$t.rem=function(e){this._rem.push(e)},$t.values=function(){if(this._get=null,0===this._rem.length)return this._add;var e,t,r,n=this._add,i=this._rem,a=this._key,o=n.length,s=i.length,u=Array(o-s),l={};for(e=0;e<s;++e)l[a(i[e])]=1;for(e=0,t=0;e<o;++e)l[a(r=n[e])]?l[a(r)]=0:u[t++]=r;return this._rem=[],this._add=u},$t.distinct=function(e){for(var t,r=this.values(),n=r.length,i={},a=0;--n>=0;)t=e(r[n])+"",Object(V.v)(i,t)||(i[t]=1,++a);return a},$t.extent=function(e){if(this._get!==e||!this._ext){var t=this.values(),r=Object(V.q)(t,e);this._ext=[t[r[0]],t[r[1]]],this._get=e}return this._ext},$t.argmin=function(e){return this.extent(e)[0]||{}},$t.argmax=function(e){return this.extent(e)[1]||{}},$t.min=function(e){var t=this.extent(e)[0];return null!=t?e(t):void 0},$t.max=function(e){var t=this.extent(e)[1];return null!=t?e(t):void 0},$t.quartile=function(e){return this._get===e&&this._q||(this._q=Ot(this.values(),e),this._get=e),this._q},$t.q1=function(e){return this.quartile(e)[0]},$t.q2=function(e){return this.quartile(e)[1]},$t.q3=function(e){return this.quartile(e)[2]},$t.ci=function(e){return this._get===e&&this._ci||(this._ci=Tt(this.values(),1e3,.05,e),this._get=e),this._ci},$t.ci0=function(e){return this.ci(e)[0]},$t.ci1=function(e){return this.ci(e)[1]},Aggregate.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:bt},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]};var Xt=Object(V.y)(Aggregate,Transform);Xt.transform=function(e,t){var r=this,n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.modified();return r.stamp=n.stamp,r.value&&(i||t.modified(r._inputs,!0))?(r._prev=r.value,r.value=i?r.init(e):{},t.visit(t.SOURCE,(function(e){return r.add(e)}))):(r.value=r.value||r.init(e),t.visit(t.REM,(function(e){return r.rem(e)})),t.visit(t.ADD,(function(e){return r.add(e)}))),n.modifies(r._outputs),r._drop=!1!==e.drop,e.cross&&r._dims.length>1&&(r._drop=!1,r.cross()),r.changes(n)},Xt.cross=function(){var e=this,t=e.value,r=e._dnames,n=r.map((function(){return{}})),i=r.length;function collect(e){var t,a,o,s;for(t in e)for(o=e[t].tuple,a=0;a<i;++a)n[a][s=o[r[a]]]=s}collect(e._prev),collect(t),function generate(a,o,s){var u,l,c=r[s],f=n[s++];for(u in f)o[c]=f[u],l=a?a+"|"+u:u,s<i?generate(l,o,s):t[l]||e.cell(l,o)}("",{},0)},Xt.init=function(e){var t=this._inputs=[],r=this._outputs=[],n={};function inputVisit(e){for(var r,i=Object(V.i)(Object(V.g)(e)),a=0,o=i.length;a<o;++a)n[r=i[a]]||(n[r]=1,t.push(r))}this._dims=Object(V.i)(e.groupby),this._dnames=this._dims.map((function(e){var t=Object(V.h)(e);return inputVisit(e),r.push(t),t})),this.cellkey=e.key?e.key:groupkey(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];var i,a,o,s,u,l,c=e.fields||[null],f=e.ops||["count"],d=e.as||[],h=c.length,p={};for(h!==f.length&&Object(V.n)("Unmatched number of fields and aggregate ops."),l=0;l<h;++l)i=c[l],a=f[l],null==i&&"count"!==a&&Object(V.n)("Null aggregate field specified."),u=measureName(a,s=Object(V.h)(i),d[l]),r.push(u),"count"!==a?((o=p[s])||(inputVisit(i),(o=p[s]=[]).field=i,this._measures.push(o)),"count"!==a&&(this._countOnly=!1),o.push(createMeasure(a,u))):this._counts.push(u);return this._measures=this._measures.map((function(e){return compileMeasures(e,e.field)})),{}},Xt.cellkey=groupkey(),Xt.cell=function(e,t){var r=this.value[e];return r?0===r.num&&this._drop&&r.stamp<this.stamp?(r.stamp=this.stamp,this._adds[this._alen++]=r):r.stamp<this.stamp&&(r.stamp=this.stamp,this._mods[this._mlen++]=r):(r=this.value[e]=this.newcell(e,t),this._adds[this._alen++]=r),r},Xt.newcell=function(e,t){var r={key:e,num:0,agg:null,tuple:this.newtuple(t,this._prev&&this._prev[e]),stamp:this.stamp,store:!1};if(!this._countOnly){var n,i=this._measures,a=i.length;for(r.agg=Array(a),n=0;n<a;++n)r.agg[n]=new i[n](r)}return r.store&&(r.data=new TupleStore),r},Xt.newtuple=function(e,t){var r,n,i=this._dnames,a=this._dims,o={};for(r=0,n=a.length;r<n;++r)o[i[r]]=a[r](e);return t?replace(t.tuple,o):ingest(o)},Xt.add=function(e){var t,r,n,i=this.cellkey(e),a=this.cell(i,e);if(a.num+=1,!this._countOnly)for(a.store&&a.data.add(e),r=0,n=(t=a.agg).length;r<n;++r)t[r].add(t[r].get(e),e)},Xt.rem=function(e){var t,r,n,i=this.cellkey(e),a=this.cell(i,e);if(a.num-=1,!this._countOnly)for(a.store&&a.data.rem(e),r=0,n=(t=a.agg).length;r<n;++r)t[r].rem(t[r].get(e),e)},Xt.celltuple=function(e){var t,r,n,i=e.tuple,a=this._counts;for(e.store&&e.data.values(),r=0,n=a.length;r<n;++r)i[a[r]]=e.num;if(!this._countOnly)for(r=0,n=(t=e.agg).length;r<n;++r)t[r].set(i);return i},Xt.changes=function(e){var t,r,n,i,a=this._adds,o=this._mods,s=this._prev,u=this._drop,l=e.add,c=e.rem,f=e.mod;if(s)for(r in s)t=s[r],u&&!t.num||c.push(t.tuple);for(n=0,i=this._alen;n<i;++n)l.push(this.celltuple(a[n])),a[n]=null;for(n=0,i=this._mlen;n<i;++n)(0===(t=o[n]).num&&u?c:f).push(this.celltuple(t)),o[n]=null;return this._alen=this._mlen=0,this._prev=null,e};function Bin(e){Transform.call(this,null,e)}Bin.Definition={type:"Bin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"anchor",type:"number"},{name:"maxbins",type:"number",default:20},{name:"base",type:"number",default:10},{name:"divide",type:"number",array:!0,default:[5,2]},{name:"extent",type:"number",array:!0,length:2,required:!0},{name:"span",type:"number"},{name:"step",type:"number"},{name:"steps",type:"number",array:!0},{name:"minstep",type:"number",default:0},{name:"nice",type:"boolean",default:!0},{name:"name",type:"string"},{name:"as",type:"string",array:!0,length:2,default:["bin0","bin1"]}]};var Kt=Object(V.y)(Bin,Transform);Kt.transform=function(e,t){var r,n=this._bins(e),i=n.start,a=n.step,o=e.as||["bin0","bin1"],s=o[0],u=o[1];return r=e.modified()?(t=t.reflow(!0)).SOURCE:t.modified(Object(V.g)(e.field))?t.ADD_MOD:t.ADD,t.visit(r,(function(e){var t=n(e);e[s]=t,e[u]=null==t?null:i+a*(1+(t-i)/a)})),t.modifies(o)},Kt._bins=function(e){if(this.value&&!e.modified())return this.value;var t,r,n=e.field,i=xt(e),a=i.start,o=i.stop,s=i.step;null!=(t=e.anchor)&&(r=t-(a+s*Math.floor((t-a)/s)),a+=r,o+=r);var u=function f(e){var t=n(e);return null==t?null:(t=Math.max(a,Math.min(+t,o-s)),a+s*Math.floor(1e-14+(t-a)/s))};return u.start=a,u.stop=o,u.step=s,this.value=Object(V.f)(u,Object(V.g)(n),e.name||"bin_"+Object(V.h)(n))};var Jt=function(e,t,r){var n=e,i=t||[],a=r||[],o={},s=0;return{add:function add(e){a.push(e)},remove:function remove(e){o[n(e)]=++s},size:function size(){return i.length},data:function data(e,t){return s&&(i=i.filter((function(e){return!o[n(e)]})),o={},s=0),t&&e&&i.sort(e),a.length&&(i=e?Object(V.L)(e,i,a.sort(e)):i.concat(a),a=[]),i}}};function Collect(e){Transform.call(this,[],e)}function Compare(e){Operator.call(this,null,Compare_update,e)}function Compare_update(e){return this.value&&!e.modified()?this.value:Object(V.k)(e.fields,e.orders)}function CountPattern(e){Transform.call(this,null,e)}Collect.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},Object(V.y)(Collect,Transform).transform=function(e,t){var r=t.fork(t.ALL),n=Jt(tupleid,this.value,r.materialize(r.ADD).add),i=e.sort,a=t.changed()||i&&(e.modified("sort")||t.modified(i.fields));return r.visit(r.REM,n.remove),this.modified(a),this.value=r.source=n.data(stableCompare(i),a),t.source&&t.source.root&&(this.value.root=t.source.root),r},Object(V.y)(Compare,Operator),CountPattern.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]};var Qt=Object(V.y)(CountPattern,Transform);function Cross(e){Transform.call(this,null,e)}Qt.transform=function(e,t){function process(t){return function(r){for(var n,s=function tokenize(e,t,r){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase()}return e.match(r)}(o(r),e.case,i)||[],u=0,l=s.length;u<l;++u)a.test(n=s[u])||t(n)}}var r=this._parameterCheck(e,t),n=this._counts,i=this._match,a=this._stop,o=e.field,s=e.as||["text","count"],u=process((function(e){n[e]=1+(n[e]||0)})),l=process((function(e){n[e]-=1}));return r?t.visit(t.SOURCE,u):(t.visit(t.ADD,u),t.visit(t.REM,l)),this._finish(t,s)},Qt._parameterCheck=function(e,t){var r=!1;return!e.modified("stopwords")&&this._stop||(this._stop=new RegExp("^"+(e.stopwords||"")+"$","i"),r=!0),!e.modified("pattern")&&this._match||(this._match=new RegExp(e.pattern||"[\\w']+","g"),r=!0),(e.modified("field")||t.modified(e.field.fields))&&(r=!0),r&&(this._counts={}),r},Qt._finish=function(e,t){var r,n,i,a=this._counts,o=this._tuples||(this._tuples={}),s=t[0],u=t[1],l=e.fork(e.NO_SOURCE|e.NO_FIELDS);for(r in a)n=o[r],i=a[r]||0,!n&&i?(o[r]=n=ingest({}),n[s]=r,n[u]=i,l.add.push(n)):0===i?(n&&l.rem.push(n),a[r]=null,o[r]=null):n[u]!==i&&(n[u]=i,l.mod.push(n));return l.modifies(t)},Cross.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},Object(V.y)(Cross,Transform).transform=function(e,t){var r=t.fork(t.NO_SOURCE),n=this.value,i=e.as||["a","b"],a=i[0],o=i[1];return!n||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter")?(n&&(r.rem=n),n=t.materialize(t.SOURCE).source,r.add=this.value=function Cross_cross(e,t,r,n){for(var i,a,o=[],s={},u=e.length,l=0;l<u;++l)for(s[t]=a=e[l],i=0;i<u;++i)s[r]=e[i],n(s)&&(o.push(ingest(s)),(s={})[t]=a);return o}(n,a,o,e.filter||V.eb)):r.mod=n,r.source=this.value,r.modifies(i)};var Zt={kde:Pt,mixture:jt,normal:Dt,uniform:Mt},er="distributions",tr="function",rr="field";function Density(e){Transform.call(this,null,e)}var nr=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],ar={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:nr},{name:"weights",type:"number",array:!0}]};function Expression(e){Operator.call(this,null,Expression_update,e),this.modified(!0)}function Expression_update(e){var t=e.expr;return this.value&&!e.modified("expr")?this.value:Object(V.f)((function(r){return t(r,e)}),Object(V.g)(t),Object(V.h)(t))}function Extent(e){Transform.call(this,[void 0,void 0],e)}function Subflow(e,t){Operator.call(this,e),this.parent=t}Density.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:nr.concat(ar)},{name:"as",type:"string",array:!0,default:["value","density"]}]},Object(V.y)(Density,Transform).transform=function(e,t){var r=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){var n=function Distributions_parse(e,t){var r=e[tr];Object(V.v)(Zt,r)||Object(V.n)("Unknown distribution function: "+r);var n=Zt[r]();for(var i in e)i===rr?n.data((e.from||t()).map(e[i])):i===er?n[i](e[i].map((function(e){return Distributions_parse(e,t)}))):typeof n[i]===tr&&n[i](e[i]);return n}(e.distribution,function Density_source(e){return function(){return e.materialize(e.SOURCE).source}}(t)),i=e.steps||e.minsteps||25,a=e.steps||e.maxsteps||200,o=e.method||"pdf";"pdf"!==o&&"cdf"!==o&&Object(V.n)("Invalid density method: "+o),e.extent||n.data||Object(V.n)("Missing density extent parameter."),o=n[o];var s=e.as||["value","density"],u=e.extent||Object(V.p)(n.data()),l=Yt(o,u,i,a).map((function(e){var t={};return t[s[0]]=e[0],t[s[1]]=e[1],ingest(t)}));this.value&&(r.rem=this.value),this.value=r.add=r.source=l}return r},Object(V.y)(Expression,Operator),Extent.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},Object(V.y)(Extent,Transform).transform=function(e,t){var r,n=this.value,i=e.field,a=n[0],o=n[1];if(((r=t.changed()||t.modified(i.fields)||e.modified("field"))||null==a)&&(a=1/0,o=-1/0),t.visit(r?t.SOURCE:t.ADD,(function(e){var t=i(e);null!=t&&((t=+t)<a&&(a=t),t>o&&(o=t))})),!Number.isFinite(a)||!Number.isFinite(o)){var s=Object(V.h)(i);s&&(s=' for field "'.concat(s,'"')),t.dataflow.warn("Infinite extent".concat(s,": [").concat(a,", ").concat(o,"]")),a=o=void 0}this.value=[a,o]};var or=Object(V.y)(Subflow,Operator);function Facet(e){Transform.call(this,{},e),this._keys=Object(V.s)();var t=this._targets=[];t.active=0,t.forEach=function(e){for(var r=0,n=t.active;r<n;++r)e(t[r],r,t)}}or.connect=function(e){return this.targets().add(e),e.source=this},or.add=function(e){this.value.add.push(e)},or.rem=function(e){this.value.rem.push(e)},or.mod=function(e){this.value.mod.push(e)},or.init=function(e){this.value.init(e,e.NO_SOURCE)},or.evaluate=function(){return this.value};var sr=Object(V.y)(Facet,Transform);function Field(e){Operator.call(this,null,Field_update,e)}function Field_update(e){return this.value&&!e.modified()?this.value:Object(V.A)(e.name)?Object(V.i)(e.name).map((function(e){return Object(V.t)(e)})):Object(V.t)(e.name,e.as)}function Filter(e){Transform.call(this,Object(V.s)(),e)}function fieldNames(e,t){return e?e.map((function(e,r){return t[r]||Object(V.h)(e)})):null}function Flatten(e){Transform.call(this,[],e)}function Fold(e){Transform.call(this,[],e)}function Formula(e){Transform.call(this,null,e)}function Generate(e){Transform.call(this,[],e)}sr.activate=function(e){this._targets[this._targets.active++]=e},sr.subflow=function(e,t,r,n){var i,a,o=this.value,s=Object(V.v)(o,e)&&o[e];return s?s.value.stamp<r.stamp&&(s.init(r),this.activate(s)):(a=n||(a=this._group[e])&&a.tuple,s=(i=r.dataflow).add(new Subflow(r.fork(r.NO_SOURCE),this)).connect(t(i,e,a)),o[e]=s,this.activate(s)),s},sr.transform=function(e,t){var r=t.dataflow,n=this,i=e.key,a=e.subflow,o=this._keys,s=e.modified("key");function subflow(e){return n.subflow(e,a,t)}return this._group=e.group||{},this._targets.active=0,t.visit(t.REM,(function(e){var t=tupleid(e),r=o.get(t);void 0!==r&&(o.delete(t),subflow(r).rem(e))})),t.visit(t.ADD,(function(e){var t=i(e);o.set(tupleid(e),t),subflow(t).add(e)})),s||t.modified(i.fields)?t.visit(t.MOD,(function(e){var t=tupleid(e),r=o.get(t),n=i(e);r===n?subflow(n).mod(e):(o.set(t,n),subflow(r).rem(e),subflow(n).add(e))})):t.changed(t.MOD)&&t.visit(t.MOD,(function(e){subflow(o.get(tupleid(e))).mod(e)})),s&&t.visit(t.REFLOW,(function(e){var t=tupleid(e),r=o.get(t),n=i(e);r!==n&&(o.set(t,n),subflow(r).rem(e),subflow(n).add(e))})),o.empty>r.cleanThreshold&&r.runAfter(o.clean),t},Object(V.y)(Field,Operator),Filter.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},Object(V.y)(Filter,Transform).transform=function(e,t){var r=t.dataflow,n=this.value,i=t.fork(),a=i.add,o=i.rem,s=i.mod,u=e.expr,l=!0;function revisit(t){var r=tupleid(t),i=u(t,e),c=n.get(r);i&&c?(n.delete(r),a.push(t)):i||c?l&&i&&!c&&s.push(t):(n.set(r,1),o.push(t))}return t.visit(t.REM,(function(e){var t=tupleid(e);n.has(t)?n.delete(t):o.push(e)})),t.visit(t.ADD,(function(t){u(t,e)?a.push(t):n.set(tupleid(t),1)})),t.visit(t.MOD,revisit),e.modified()&&(l=!1,t.visit(t.REFLOW,revisit)),n.empty>r.cleanThreshold&&r.runAfter(n.clean),i},Flatten.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0}]},Object(V.y)(Flatten,Transform).transform=function(e,t){var r=t.fork(t.NO_SOURCE),n=e.fields,i=fieldNames(n,e.as||[]),a=i.length;return r.rem=this.value,t.visit(t.SOURCE,(function(e){for(var t,o,s,u=n.map((function(t){return t(e)})),l=u.reduce((function(e,t){return Math.max(e,t.length)}),0),c=0;c<l;++c){for(o=Tuple_derive(e),t=0;t<a;++t)o[i[t]]=null==(s=u[t][c])?null:s;r.add.push(o)}})),this.value=r.source=r.add,r.modifies(i)},Fold.Definition={type:"Fold",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0,length:2,default:["key","value"]}]},Object(V.y)(Fold,Transform).transform=function(e,t){var r=t.fork(t.NO_SOURCE),n=e.fields,i=n.map(V.h),a=e.as||["key","value"],o=a[0],s=a[1],u=n.length;return r.rem=this.value,t.visit(t.SOURCE,(function(e){for(var t,a=0;a<u;++a)(t=Tuple_derive(e))[o]=i[a],t[s]=n[a](e),r.add.push(t)})),this.value=r.source=r.add,r.modifies(a)},Formula.Definition={type:"Formula",metadata:{modifies:!0},params:[{name:"expr",type:"expr",required:!0},{name:"as",type:"string",required:!0},{name:"initonly",type:"boolean"}]},Object(V.y)(Formula,Transform).transform=function(e,t){var r=e.expr,n=e.as,i=e.modified(),a=e.initonly?t.ADD:i?t.SOURCE:t.modified(r.fields)?t.ADD_MOD:t.ADD;return i&&(t=t.materialize().reflow(!0)),e.initonly||t.modifies(n),t.visit(a,(function set(t){t[n]=r(t,e)}))},Object(V.y)(Generate,Transform).transform=function(e,t){var r,n,i,a=this.value,o=t.fork(t.ALL),s=e.size-a.length,u=e.generator;if(s>0){for(r=[];--s>=0;)r.push(i=ingest(u(e))),a.push(i);o.add=o.add.length?o.materialize(o.ADD).add.concat(r):r}else n=a.slice(0,-s),o.rem=o.rem.length?o.materialize(o.REM).rem.concat(n):n,a=a.slice(-s);return o.source=this.value=a,o};var ur={value:"value",median:Gt,mean:function mean_mean(e,t){var r=0,n=0;if(void 0===t){var i=!0,a=!1,o=void 0;try{for(var s,u=e[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var l=s.value;null!=l&&(l=+l)>=l&&(++r,n+=l)}}catch(v){a=!0,o=v}finally{try{i||null==u.return||u.return()}finally{if(a)throw o}}}else{var c=-1,f=!0,d=!1,h=void 0;try{for(var p,g=e[Symbol.iterator]();!(f=(p=g.next()).done);f=!0){var m=p.value;null!=(m=t(m,++c,e))&&(m=+m)>=m&&(++r,n+=m)}}catch(v){d=!0,h=v}finally{try{f||null==g.return||g.return()}finally{if(d)throw h}}}if(r)return n/r},min:function min_min(e,t){var r;if(void 0===t){var n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var u=o.value;null!=u&&(r>u||void 0===r&&u>=u)&&(r=u)}}catch(m){i=!0,a=m}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}}else{var l=-1,c=!0,f=!1,d=void 0;try{for(var h,p=e[Symbol.iterator]();!(c=(h=p.next()).done);c=!0){var g=h.value;null!=(g=t(g,++l,e))&&(r>g||void 0===r&&g>=g)&&(r=g)}}catch(m){f=!0,d=m}finally{try{c||null==p.return||p.return()}finally{if(f)throw d}}}return r},max:function max_max(e,t){var r;if(void 0===t){var n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var u=o.value;null!=u&&(r<u||void 0===r&&u>=u)&&(r=u)}}catch(m){i=!0,a=m}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}}else{var l=-1,c=!0,f=!1,d=void 0;try{for(var h,p=e[Symbol.iterator]();!(c=(h=p.next()).done);c=!0){var g=h.value;null!=(g=t(g,++l,e))&&(r<g||void 0===r&&g>=g)&&(r=g)}}catch(m){f=!0,d=m}finally{try{c||null==p.return||p.return()}finally{if(f)throw d}}}return r}},lr=[];function Impute(e){Transform.call(this,[],e)}function JoinAggregate(e){Aggregate.call(this,e)}Impute.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]},Object(V.y)(Impute,Transform).transform=function(e,t){var r,n,i,a,o,s,u,l,c,f,d=t.fork(t.ALL),h=function getValue(e){var t,r=e.method||ur.value;if(null!=ur[r])return r===ur.value?(t=void 0!==e.value?e.value:0,function(){return t}):ur[r];Object(V.n)("Unrecognized imputation method: "+r)}(e),p=function getField(e){var t=e.field;return function(e){return e?t(e):NaN}}(e),g=Object(V.h)(e.field),m=Object(V.h)(e.key),v=(e.groupby||[]).map(V.h),y=function Impute_partition(e,t,r,n){var i,a,o,s,u,l,c,f,d=function get(e){return e(f)},h=[],p=n?n.slice():[],g={},m={};for(p.forEach((function(e,t){g[e]=t+1})),s=0,c=e.length;s<c;++s)f=e[s],l=r(f),u=g[l]||(g[l]=p.push(l)),a=(i=t?t.map(d):lr)+"",(o=m[a])||(o=m[a]=[],h.push(o),o.values=i),o[u-1]=f;return h.domain=p,h}(t.source,e.groupby,e.key,e.keyvals),_=[],b=this.value,x=y.domain.length;for(o=0,l=y.length;o<l;++o)for(i=(r=y[o]).values,n=NaN,u=0;u<x;++u)if(null==r[u]){for(a=y.domain[u],f={_impute:!0},s=0,c=i.length;s<c;++s)f[v[s]]=i[s];f[m]=a,f[g]=isNaN(n)?n=h(r,p):n,_.push(ingest(f))}return _.length&&(d.add=d.materialize(d.ADD).add.concat(_)),b.length&&(d.rem=d.materialize(d.REM).rem.concat(b)),this.value=_,d},JoinAggregate.Definition={type:"JoinAggregate",metadata:{modifies:!0},params:[{name:"groupby",type:"field",array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"ops",type:"enum",array:!0,values:bt},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]};var cr=Object(V.y)(JoinAggregate,Aggregate);function KDE(e){Transform.call(this,null,e)}function Key(e){Operator.call(this,null,Key_update,e)}function Key_update(e){return this.value&&!e.modified()?this.value:Object(V.I)(e.fields,e.flat)}function Load(e){Transform.call(this,[],e)}function Load_output(e,t,r){r.forEach(ingest);var n=t.fork(t.NO_FIELDS&t.NO_SOURCE);return n.rem=e.value,e.value=n.add=n.source=r,n}function Lookup(e){Transform.call(this,{},e)}function MultiExtent(e){Operator.call(this,null,MultiExtent_update,e)}function MultiExtent_update(e){if(this.value&&!e.modified())return this.value;var t,r,n,i=1/0,a=-1/0,o=e.extents;for(t=0,r=o.length;t<r;++t)(n=o[t])[0]<i&&(i=n[0]),n[1]>a&&(a=n[1]);return[i,a]}function MultiValues(e){Operator.call(this,null,MultiValues_update,e)}function MultiValues_update(e){return this.value&&!e.modified()?this.value:e.values.reduce((function(e,t){return e.concat(t)}),[])}function Params(e){Transform.call(this,null,e)}function Pivot(e){Aggregate.call(this,e)}cr.transform=function(e,t){var r,n=this,i=e.modified();return n.value&&(i||t.modified(n._inputs,!0))?(r=n.value=i?n.init(e):{},t.visit(t.SOURCE,(function(e){n.add(e)}))):(r=n.value=n.value||this.init(e),t.visit(t.REM,(function(e){n.rem(e)})),t.visit(t.ADD,(function(e){n.add(e)}))),n.changes(),t.visit(t.SOURCE,(function(e){Object(V.o)(e,r[n.cellkey(e)].tuple)})),t.reflow(i).modifies(this._outputs)},cr.changes=function(){var e,t,r=this._adds,n=this._mods;for(e=0,t=this._alen;e<t;++e)this.celltuple(r[e]),r[e]=null;for(e=0,t=this._mlen;e<t;++e)this.celltuple(n[e]),n[e]=null;this._alen=this._mlen=0},KDE.Definition={type:"KDE",metadata:{generates:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"cumulative",type:"boolean",default:!1},{name:"counts",type:"boolean",default:!1},{name:"bandwidth",type:"number",default:0},{name:"extent",type:"number",array:!0,length:2},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"as",type:"string",array:!0,default:["value","density"]}]},Object(V.y)(KDE,Transform).transform=function(e,t){var r=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){var n=t.materialize(t.SOURCE).source,i=function KDE_partition(e,t,r){var n,i,a,o,s,u,l=[],c=function get(e){return e(o)};if(null==t)l.push(e.map(r));else for(n={},i=0,a=e.length;i<a;++i)o=e[i],s=t.map(c),(u=n[s])||(n[s]=u=[],u.dims=s,l.push(u)),u.push(r(o));return l}(n,e.groupby,e.field),a=(e.groupby||[]).map(V.h),o=e.bandwidth,s=e.cumulative?"cdf":"pdf",u=e.as||["value","density"],l=[],c=e.extent,f=e.steps||e.minsteps||25,d=e.steps||e.maxsteps||200;"pdf"!==s&&"cdf"!==s&&Object(V.n)("Invalid density method: "+s),"shared"===e.resolve&&(c||(c=Object(V.p)(n,e.field)),f=d=e.steps||d),i.forEach((function(t){var r=Pt(t,o)[s],n=e.counts?t.length:1,i=c||Object(V.p)(t);Yt(r,i,f,d).forEach((function(e){for(var r={},i=0;i<a.length;++i)r[a[i]]=t.dims[i];r[u[0]]=e[0],r[u[1]]=e[1]*n,l.push(ingest(r))}))})),this.value&&(r.rem=this.value),this.value=r.add=r.source=l}return r},Object(V.y)(Key,Operator),Object(V.y)(Load,Transform).transform=function(e,t){var r=this,n=t.dataflow;return e.values?Load_output(this,t,n.parse(e.values,e.format)):n.request(e.url,e.format).then((function(e){return Load_output(r,t,e.data||[])}))},Lookup.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]},Object(V.y)(Lookup,Transform).transform=function(e,t){var r,n,i=t,a=e.as,o=e.fields,s=e.index,u=e.values,l=null==e.default?null:e.default,c=e.modified(),f=c?t.SOURCE:t.ADD,d=o.length;return u?(n=u.length,d>1&&!a&&Object(V.n)('Multi-field lookup requires explicit "as" parameter.'),a&&a.length!==d*n&&Object(V.n)('The "as" parameter has too few output field names.'),a=a||u.map(V.h),r=function set(e){for(var t,r,i=0,c=0;i<d;++i)if(null==(r=s.get(o[i](e))))for(t=0;t<n;++t,++c)e[a[c]]=l;else for(t=0;t<n;++t,++c)e[a[c]]=u[t](r)}):(a||Object(V.n)("Missing output field names."),r=function set(e){for(var t,r=0;r<d;++r)t=s.get(o[r](e)),e[a[r]]=null==t?l:t}),c?i=t.reflow(!0):f|=o.some((function(e){return t.modified(e.fields)}))?t.MOD:0,t.visit(f,r),i.modifies(a)},Object(V.y)(MultiExtent,Operator),Object(V.y)(MultiValues,Operator),Object(V.y)(Params,Transform),Params.prototype.transform=function(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)},Pivot.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:bt,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]};var fr=Object(V.y)(Pivot,Aggregate);function PreFacet(e){Facet.call(this,e)}function Project(e){Transform.call(this,null,e)}function Proxy(e){Transform.call(this,null,e)}function Relay(e){Transform.call(this,null,e)}function Sample(e){Transform.call(this,[],e),this.count=0}fr._transform=fr.transform,fr.transform=function(e,t){return this._transform(function aggregateParams(e,t){var r=e.field,n=e.value,i=("count"===e.op?"__count__":e.op)||"sum",a=Object(V.g)(r).concat(Object(V.g)(n)),o=function pivotKeys(e,t,r){var n={},i=[];return r.visit(r.SOURCE,(function(t){var r=e(t);n[r]||(n[r]=1,i.push(r))})),i.sort((function(e,t){return(e<t||null==e)&&null!=t?-1:(e>t||null==t)&&null!=e?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t===t?-1:t!==t&&e===e?1:0)})),t?i.slice(0,t):i}(r,e.limit||0,t);t.changed()&&e.set("__pivot__",null,null,!0);return{key:e.key,groupby:e.groupby,ops:o.map((function(){return i})),fields:o.map((function(e){return function Pivot_get(e,t,r,n){return Object(V.f)((function(n){return t(n)===e?r(n):NaN}),n,e+"")}(e,r,n,a)})),as:o.map((function(e){return e+""})),modified:e.modified.bind(e)}}(e,t),t)},Object(V.y)(PreFacet,Facet).transform=function(e,t){var r=this,n=e.subflow,i=e.field;return(e.modified("field")||i&&t.modified(Object(V.g)(i)))&&Object(V.n)("PreFacet does not support field modification."),this._targets.active=0,t.visit(t.MOD,(function(e){var a=r.subflow(tupleid(e),n,t,e);i?i(e).forEach((function(e){a.mod(e)})):a.mod(e)})),t.visit(t.ADD,(function(e){var a=r.subflow(tupleid(e),n,t,e);i?i(e).forEach((function(e){a.add(ingest(e))})):a.add(e)})),t.visit(t.REM,(function(e){var a=r.subflow(tupleid(e),n,t,e);i?i(e).forEach((function(e){a.rem(e)})):a.rem(e)})),t},Project.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},Object(V.y)(Project,Transform).transform=function(e,t){var r,n,i=e.fields,a=fieldNames(e.fields,e.as||[]),o=i?function(e,t){return function Project_project(e,t,r,n){for(var i=0,a=r.length;i<a;++i)t[n[i]]=r[i](e);return t}(e,t,i,a)}:rederive;return this.value?n=this.value:(t=t.addAll(),n=this.value={}),r=t.fork(t.NO_SOURCE),t.visit(t.REM,(function(e){var t=tupleid(e);r.rem.push(n[t]),n[t]=null})),t.visit(t.ADD,(function(e){var t=o(e,ingest({}));n[tupleid(e)]=t,r.add.push(t)})),t.visit(t.MOD,(function(e){r.mod.push(o(e,n[tupleid(e)]))})),r},Object(V.y)(Proxy,Transform).transform=function(e,t){return this.value=e.value,e.modified("value")?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation},Object(V.y)(Relay,Transform).transform=function(e,t){var r,n;return this.value?n=this.value:(r=t=t.addAll(),n=this.value={}),e.derive&&(r=t.fork(t.NO_SOURCE),t.visit(t.REM,(function(e){var t=tupleid(e);r.rem.push(n[t]),n[t]=null})),t.visit(t.ADD,(function(e){var t=Tuple_derive(e);n[tupleid(e)]=t,r.add.push(t)})),t.visit(t.MOD,(function(e){r.mod.push(rederive(e,n[tupleid(e)]))}))),r},Sample.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},Object(V.y)(Sample,Transform).transform=function(e,t){var r=t.fork(t.NO_SOURCE),n=e.modified("size"),i=e.size,a=this.value,o=this.count,s=0,u=a.reduce((function(e,t){return e[tupleid(t)]=1,e}),{});function update(e){var t,n;a.length<i?a.push(e):(n=~~((o+1)*kt()))<a.length&&n>=s&&(t=a[n],u[tupleid(t)]&&r.rem.push(t),a[n]=e),++o}if(t.rem.length&&(t.visit(t.REM,(function(e){var t=tupleid(e);u[t]&&(u[t]=-1,r.rem.push(e)),--o})),a=a.filter((function(e){return-1!==u[tupleid(e)]}))),(t.rem.length||n)&&a.length<i&&t.source&&(s=o=a.length,t.visit(t.SOURCE,(function(e){u[tupleid(e)]||update(e)})),s=-1),n&&a.length>i){for(var l=0,c=a.length-i;l<c;++l)u[tupleid(a[l])]=-1,r.rem.push(a[l]);a=a.slice(c)}return t.mod.length&&t.visit(t.MOD,(function(e){u[tupleid(e)]&&r.mod.push(e)})),t.add.length&&t.visit(t.ADD,update),(t.add.length||s<0)&&(r.add=a.filter((function(e){return!u[tupleid(e)]}))),this.count=o,this.value=r.source=a,r};var dr=function(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=0|Math.max(0,Math.ceil((t-e)/r)),a=new Array(i);++n<i;)a[n]=e+n*r;return a};function Sequence(e){Transform.call(this,null,e)}function Sieve(e){Transform.call(this,null,e),this.modified(!0)}function TupleIndex(e){Transform.call(this,Object(V.s)(),e)}function Values(e){Transform.call(this,null,e)}Sequence.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]},Object(V.y)(Sequence,Transform).transform=function(e,t){if(!this.value||e.modified()){var r=t.materialize().fork(t.MOD),n=e.as||"data";return r.rem=this.value?t.rem.concat(this.value):t.rem,this.value=dr(e.start,e.stop,e.step||1).map((function(e){var t={};return t[n]=e,ingest(t)})),r.add=t.add.concat(this.value),r}},Object(V.y)(Sieve,Transform).transform=function(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation},Object(V.y)(TupleIndex,Transform).transform=function(e,t){var r=t.dataflow,n=e.field,i=this.value,a=!0;function set(e){i.set(n(e),e)}return e.modified("field")||t.modified(n.fields)?(i.clear(),t.visit(t.SOURCE,set)):t.changed()?(t.visit(t.REM,(function(e){i.delete(n(e))})),t.visit(t.ADD,set)):a=!1,this.modified(a),i.empty>r.cleanThreshold&&r.runAfter(i.clean),t.fork()},Object(V.y)(Values,Transform).transform=function(e,t){(!this.value||e.modified("field")||e.modified("sort")||t.changed()||e.sort&&t.modified(e.sort.fields))&&(this.value=(e.sort?t.source.slice().sort(stableCompare(e.sort)):t.source).map(e.field))};var hr={row_number:function row_number(){return{next:function next(e){return e.index+1}}},rank:function rank(){var rank;return{init:function init(){return rank=1},next:function next(e){var t=e.index,r=e.data;return t&&e.compare(r[t-1],r[t])?rank=t+1:rank}}},dense_rank:function dense_rank(){var e;return{init:function init(){return e=1},next:function next(t){var r=t.index,n=t.data;return r&&t.compare(n[r-1],n[r])?++e:e}}},percent_rank:function percent_rank(){var e=hr.rank(),t=e.next;return{init:e.init,next:function next(e){return(t(e)-1)/(e.data.length-1)}}},cume_dist:function cume_dist(){var e;return{init:function init(){return e=0},next:function next(t){var r=t.index,n=t.data,i=t.compare;if(e<r){for(;r+1<n.length&&!i(n[r],n[r+1]);)++r;e=r}return(1+e)/n.length}}},ntile:function ntile(e,t){(t=+t)>0||Object(V.n)("ntile num must be greater than zero.");var r=hr.cume_dist(),n=r.next;return{init:r.init,next:function next(e){return Math.ceil(t*n(e))}}},lag:function lag(e,t){return t=+t||1,{next:function next(r){var n=r.index-t;return n>=0?e(r.data[n]):null}}},lead:function lead(e,t){return t=+t||1,{next:function next(r){var n=r.index+t,i=r.data;return n<i.length?e(i[n]):null}}},first_value:function first_value(e){return{next:function next(t){return e(t.data[t.i0])}}},last_value:function last_value(e){return{next:function next(t){return e(t.data[t.i1-1])}}},nth_value:function nth_value(e,t){return(t=+t)>0||Object(V.n)("nth_value nth must be greater than zero."),{next:function next(r){var n=r.i0+(t-1);return n<r.i1?e(r.data[n]):null}}},prev_value:function prev_value(e){var t=null;return{next:function next(r){var n=e(r.data[r.index]);return null!=n?t=n:t}}},next_value:function next_value(e){var t=null,r=-1;return{next:function next(n){var i=n.data;return n.index<=r?t:(r=function find(e,t,r){for(var n=t.length;r<n;++r){if(null!=e(t[r]))return r}return-1}(e,i,n.index))<0?(r=i.length,t=null):t=e(i[r])}}}};var pr=Object.keys(hr);function WindowState(e){var t=Object(V.i)(e.ops),r=Object(V.i)(e.fields),n=Object(V.i)(e.params),i=Object(V.i)(e.as),a=this.outputs=[],o=this.windows=[],s={},u={},l=!0,c=[],f=[];function visitInputs(e){Object(V.i)(Object(V.g)(e)).forEach((function(e){return s[e]=1}))}visitInputs(e.sort),t.forEach((function(e,t){var s=r[t],d=Object(V.h)(s),h=measureName(e,d,i[t]);if(visitInputs(s),a.push(h),Object(V.v)(hr,e))o.push(function WindowOp(e,t,r,n){var i=hr[e](t,r);return{init:i.init||V.hb,update:function update(e,t){t[n]=i.next(e)}}}(e,r[t],n[t],h));else{if(null==s&&"count"!==e&&Object(V.n)("Null aggregate field specified."),"count"===e)return void c.push(h);l=!1;var p=u[d];p||((p=u[d]=[]).field=s,f.push(p)),p.push(createMeasure(e,h))}})),(c.length||f.length)&&(this.cell=function WindowState_cell(e,t,r){e=e.map((function(e){return compileMeasures(e,e.field)}));var n={num:0,agg:null,store:!1,count:t};if(!r)for(var i=e.length,a=n.agg=Array(i),o=0;o<i;++o)a[o]=new e[o](n);if(n.store)var s=n.data=new TupleStore;return n.add=function(e){if(n.num+=1,!r){s&&s.add(e);for(var t=0;t<i;++t)a[t].add(a[t].get(e),e)}},n.rem=function(e){if(n.num-=1,!r){s&&s.rem(e);for(var t=0;t<i;++t)a[t].rem(a[t].get(e),e)}},n.set=function(e){var i,o;for(s&&s.values(),i=0,o=t.length;i<o;++i)e[t[i]]=n.num;if(!r)for(i=0,o=a.length;i<o;++i)a[i].set(e)},n.init=function(){n.num=0,s&&s.reset();for(var e=0;e<i;++e)a[e].init()},n}(f,c,l)),this.inputs=Object.keys(s)}var gr=WindowState.prototype;gr.init=function(){this.windows.forEach((function(e){return e.init()})),this.cell&&this.cell.init()},gr.update=function(e,t){var r,n=this.cell,i=this.windows,a=e.data,o=i&&i.length;if(n){for(r=e.p0;r<e.i0;++r)n.rem(a[r]);for(r=e.p1;r<e.i1;++r)n.add(a[r]);n.set(t)}for(r=0;r<o;++r)i[r].update(e,t)};var mr=function(e){return 1===e.length&&(e=function ascendingComparator(e){return function(t,r){return St(e(t),r)}}(e)),{left:function left(t,r,n,i){for(null==n&&(n=0),null==i&&(i=t.length);n<i;){var a=n+i>>>1;e(t[a],r)<0?n=a+1:i=a}return n},right:function right(t,r,n,i){for(null==n&&(n=0),null==i&&(i=t.length);n<i;){var a=n+i>>>1;e(t[a],r)>0?i=a:n=a+1}return n}}};function Window(e){Transform.call(this,{},e),this._mlen=0,this._mods=[]}Window.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:pr.concat(bt)},{name:"params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"frame",type:"number",null:!0,array:!0,length:2,default:[null,0]},{name:"ignorePeers",type:"boolean",default:!1}]};var vr=Object(V.y)(Window,Transform);function processPartition(e,t,r,n){var i=n.sort,a=i&&!n.ignorePeers,o=n.frame||[null,0],s=e.data(r),u=s.length,l=0,c=a?mr(i):null,f={i0:0,i1:0,p0:0,p1:0,index:0,data:s,compare:i||Object(V.l)(-1)};for(t.init();l<u;++l)setWindow(f,o,l,u),a&&adjustRange(f,c),t.update(f,s[l])}function setWindow(e,t,r,n){e.p0=e.i0,e.p1=e.i1,e.i0=null==t[0]?0:Math.max(0,r-Math.abs(t[0])),e.i1=null==t[1]?n:Math.min(n,r+Math.abs(t[1])+1),e.index=r}function adjustRange(e,t){var r=e.i0,n=e.i1-1,i=e.compare,a=e.data,o=a.length-1;r>0&&!i(a[r],a[r-1])&&(e.i0=t.left(a,a[r])),n<o&&!i(a[n],a[n+1])&&(e.i1=t.right(a,a[n]))}vr.transform=function(e,t){var r,n,i=this,a=i.state,o=e.modified(),s=stableCompare(e.sort);this.stamp=t.stamp,a&&!o||(a=i.state=new WindowState(e));var u=groupkey(e.groupby);function group(e){return i.group(u(e))}for(o||t.modified(a.inputs)?(i.value={},t.visit(t.SOURCE,(function(e){group(e).add(e)}))):(t.visit(t.REM,(function(e){group(e).remove(e)})),t.visit(t.ADD,(function(e){group(e).add(e)}))),r=0,n=i._mlen;r<n;++r)processPartition(i._mods[r],a,s,e);return i._mlen=0,i._mods=[],t.reflow(o).modifies(a.outputs)},vr.group=function(e){var t=this.value[e];return t||((t=this.value[e]=Jt(tupleid)).stamp=-1),t.stamp<this.stamp&&(t.stamp=this.stamp,this._mods[this._mlen++]=t),t};var yr="top",_r="left",br="right",xr="bottom",wr="top-left",kr="top-right",Sr="bottom-left",Er="bottom-right",Cr="start",Tr="middle",Or="end",Ar="x",Rr="y",Dr="group",Pr="axis",jr="title",Mr="frame",Fr="scope",Ir="legend",Lr="row-header",Nr="row-footer",Br="row-title",Ur="column-header",zr="column-footer",qr="column-title",Wr="padding",Gr="symbol",Hr="fit",Vr="fit-x",Yr="fit-y",$r="pad",Xr="none",Kr="all",Jr="each",Qr="flush",Zr="column",en="row";function Bounds(e){this.clear(),e&&this.union(e)}var tn=Bounds.prototype;tn.clone=function(){return new Bounds(this)},tn.clear=function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},tn.empty=function(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},tn.equals=function(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},tn.set=function(e,t,r,n){return r<e?(this.x2=e,this.x1=r):(this.x1=e,this.x2=r),n<t?(this.y2=t,this.y1=n):(this.y1=t,this.y2=n),this},tn.add=function(e,t){return e<this.x1&&(this.x1=e),t<this.y1&&(this.y1=t),e>this.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},tn.expand=function(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},tn.round=function(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},tn.translate=function(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},tn.rotate=function(e,t,r){var n=this.rotatedPoints(e,t,r);return this.clear().add(n[0],n[1]).add(n[2],n[3]).add(n[4],n[5]).add(n[6],n[7])},tn.rotatedPoints=function(e,t,r){var n=this.x1,i=this.y1,a=this.x2,o=this.y2,s=Math.cos(e),u=Math.sin(e),l=t-t*s+r*u,c=r-t*u-r*s;return[s*n-u*i+l,u*n+s*i+c,s*n-u*o+l,u*n+s*o+c,s*a-u*i+l,u*a+s*i+c,s*a-u*o+l,u*a+s*o+c]},tn.union=function(e){return e.x1<this.x1&&(this.x1=e.x1),e.y1<this.y1&&(this.y1=e.y1),e.x2>this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},tn.intersect=function(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2<this.x2&&(this.x2=e.x2),e.y2<this.y2&&(this.y2=e.y2),this},tn.encloses=function(e){return e&&this.x1<=e.x1&&this.x2>=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},tn.alignsWith=function(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},tn.intersects=function(e){return e&&!(this.x2<e.x1||this.x1>e.x2||this.y2<e.y1||this.y1>e.y2)},tn.contains=function(e,t){return!(e<this.x1||e>this.x2||t<this.y1||t>this.y2)},tn.width=function(){return this.x2-this.x1},tn.height=function(){return this.y2-this.y1};var rn=0,nn="p_";function isGradient(e){return e&&e.gradient}function gradientRef(e,t,r){var n=e.id,i=e.gradient,a="radial"===i?nn:"";return n||(n=e.id="gradient_"+rn++,"radial"===i?(e.x1=Gradient_get(e.x1,.5),e.y1=Gradient_get(e.y1,.5),e.r1=Gradient_get(e.r1,0),e.x2=Gradient_get(e.x2,.5),e.y2=Gradient_get(e.y2,.5),e.r2=Gradient_get(e.r2,.5),a=nn):(e.x1=Gradient_get(e.x1,0),e.y1=Gradient_get(e.y1,0),e.x2=Gradient_get(e.x2,1),e.y2=Gradient_get(e.y2,0))),t[n]=e,"url("+(r||"")+"#"+a+n+")"}function Gradient_get(e,t){return null!=e?e:t}function Item(e){this.mark=e,this.bounds=this.bounds||new Bounds}function GroupItem(e){Item.call(this,e),this.items=this.items||[]}function domCanvas(e,t){if("undefined"!==typeof document&&document.createElement){var r=document.createElement("canvas");if(r&&r.getContext)return r.width=e,r.height=t,r}return null}function domImage(){return"undefined"!==typeof Image?Image:null}Object(V.y)(GroupItem,Item);var an=/^([A-Za-z]+:)?\/\//,sn=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,un=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,ln="file://";function loader_load(e,t){return src_loader_load.apply(this,arguments)}function src_loader_load(){return(src_loader_load=Object(Y.a)(A.a.mark((function _callee2(e,t){var r,n;return A.a.wrap((function _callee2$(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,this.sanitize(e,t);case 2:return r=i.sent,n=r.href,i.abrupt("return",r.localFile?this.file(n):this.http(n,t));case 5:case"end":return i.stop()}}),_callee2,this)})))).apply(this,arguments)}function loader_sanitize(e,t){return src_loader_sanitize.apply(this,arguments)}function src_loader_sanitize(){return(src_loader_sanitize=Object(Y.a)(A.a.mark((function _callee3(e,t){var r,n,i,a,o,s,u;return A.a.wrap((function _callee3$(l){for(;;)switch(l.prev=l.next){case 0:return t=Object(V.o)({},this.options,t),r=this.fileAccess,n={href:null},s=sn.test(e.replace(un,"")),null!=e&&"string"===typeof e&&s||Object(V.n)("Sanitize failure, invalid URI: "+Object(V.X)(e)),u=an.test(e),(o=t.baseURL)&&!u&&(e.startsWith("/")||"/"===o[o.length-1]||(e="/"+e),e=o+e),a=(i=e.startsWith(ln))||"file"===t.mode||"http"!==t.mode&&!u&&r,i?e=e.slice(ln.length):e.startsWith("//")&&("file"===t.defaultProtocol?(e=e.slice(2),a=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(n,"localFile",{value:!!a}),n.href=e,t.target&&(n.target=t.target+""),t.rel&&(n.rel=t.rel+""),l.abrupt("return",n);case 13:case"end":return l.stop()}}),_callee3,this)})))).apply(this,arguments)}function loader_fileLoader(e){return e?function(t){return new Promise((function(r,n){e.readFile(t,(function(e,t){e?n(e):r(t)}))}))}:loader_fileReject}function loader_fileReject(){return src_loader_fileReject.apply(this,arguments)}function src_loader_fileReject(){return(src_loader_fileReject=Object(Y.a)(A.a.mark((function _callee4(){return A.a.wrap((function _callee4$(e){for(;;)switch(e.prev=e.next){case 0:Object(V.n)("No file system access.");case 1:case"end":return e.stop()}}),_callee4)})))).apply(this,arguments)}function loader_httpLoader(e){return e?function(){var t=Object(Y.a)(A.a.mark((function _callee(t,r){var n,i,a;return A.a.wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:return n=Object(V.o)({},this.options.http,r),i=r&&r.response,o.next=4,e(t,n);case 4:return a=o.sent,o.abrupt("return",a.ok?Object(V.D)(a[i])?a[i]():a.text():Object(V.n)(a.status+""+a.statusText));case 6:case"end":return o.stop()}}),_callee,this)})));return function(e,r){return t.apply(this,arguments)}}():loader_httpReject}function loader_httpReject(){return src_loader_httpReject.apply(this,arguments)}function src_loader_httpReject(){return(src_loader_httpReject=Object(Y.a)(A.a.mark((function _callee5(){return A.a.wrap((function _callee5$(e){for(;;)switch(e.prev=e.next){case 0:Object(V.n)("No HTTP fetch method available.");case 1:case"end":return e.stop()}}),_callee5)})))).apply(this,arguments)}V.Y,V.ab,V.ab,V.Z,V.cb,V.x;function dsv_delimitedFormat(e){var t=function parse(t,r){var n={delimiter:e};return formats_dsv_dsv(t,r?Object(V.o)(r,n):n)};return t.responseType="text",t}function formats_dsv_dsv(e,t){return t.header&&(e=t.header.map(V.X).join(t.delimiter)+"\n"+e),me(t.delimiter).parse(e+"")}formats_dsv_dsv.responseType="text";var cn=r(88),dn={interior:function interior(e,t){return e!==t},exterior:function exterior(e,t){return e===t}};function topojson_topojson(e,t){var r,n,i,a;return e=Object(cn.a)(e,t),t&&t.feature?(r=ke,i=t.feature):t&&t.mesh?(r=Ee,i=t.mesh,a=dn[t.filter]):Object(V.n)("Missing TopoJSON feature or mesh parameter."),(n=(n=e.objects[i])?r(e,n,a):Object(V.n)("Invalid TopoJSON object: "+i))&&n.features||[n]}topojson_topojson.responseType="json";dsv_delimitedFormat(","),dsv_delimitedFormat("\t"),cn.a;var hn=function(e,t){return function(r){return{options:r||{},sanitize:loader_sanitize,load:loader_load,fileAccess:!!t,file:loader_fileLoader(t),http:loader_httpLoader(e)}}}("undefined"!==typeof fetch&&fetch,null);function ResourceLoader(e){this._pending=0,this._loader=e||hn()}var pn=ResourceLoader.prototype;function increment(e){e._pending+=1}function decrement(e){e._pending-=1}pn.pending=function(){return this._pending},pn.sanitizeURL=function(e){var t=this;return increment(t),t._loader.sanitize(e,{context:"href"}).then((function(e){return decrement(t),e})).catch((function(){return decrement(t),null}))},pn.loadImage=function(e){var t=this,r=domImage();return increment(t),t._loader.sanitize(e,{context:"image"}).then((function(e){var n=e.href;if(!n||!r)throw{url:n};var i=new r;return i.onload=function(){decrement(t),i.loaded=!0},i.onerror=function(){decrement(t),i.loaded=!1},i.src=n,i})).catch((function(e){return decrement(t),{loaded:!1,width:0,height:0,src:e&&e.url||""}}))},pn.ready=function(){var e=this;return new Promise((function(t){!function poll(r){e.pending()?setTimeout((function(){poll(!0)}),10):t(r)}(!1)}))};var gn=Math.PI,mn=2*gn,vn=mn-1e-6;function path_Path(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function path_path(){return new path_Path}path_Path.prototype=path_path.prototype={constructor:path_Path,moveTo:function moveTo(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function lineTo(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function quadraticCurveTo(e,t,r,n){this._+="Q"+ +e+","+ +t+","+(this._x1=+r)+","+(this._y1=+n)},bezierCurveTo:function bezierCurveTo(e,t,r,n,i,a){this._+="C"+ +e+","+ +t+","+ +r+","+ +n+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function arcTo(e,t,r,n,i){e=+e,t=+t,r=+r,n=+n,i=+i;var a=this._x1,o=this._y1,s=r-e,u=n-t,l=a-e,c=o-t,f=l*l+c*c;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(f>1e-6)if(Math.abs(c*s-u*l)>1e-6&&i){var d=r-a,h=n-o,p=s*s+u*u,g=d*d+h*h,m=Math.sqrt(p),v=Math.sqrt(f),y=i*Math.tan((gn-Math.acos((p+f-g)/(2*m*v)))/2),_=y/v,b=y/m;Math.abs(_-1)>1e-6&&(this._+="L"+(e+_*l)+","+(t+_*c)),this._+="A"+i+","+i+",0,0,"+ +(c*d>l*h)+","+(this._x1=e+b*s)+","+(this._y1=t+b*u)}else this._+="L"+(this._x1=e)+","+(this._y1=t);else;},arc:function arc(e,t,r,n,i,a){e=+e,t=+t,a=!!a;var o=(r=+r)*Math.cos(n),s=r*Math.sin(n),u=e+o,l=t+s,c=1^a,f=a?n-i:i-n;if(r<0)throw new Error("negative radius: "+r);null===this._x1?this._+="M"+u+","+l:(Math.abs(this._x1-u)>1e-6||Math.abs(this._y1-l)>1e-6)&&(this._+="L"+u+","+l),r&&(f<0&&(f=f%mn+mn),f>vn?this._+="A"+r+","+r+",0,1,"+c+","+(e-o)+","+(t-s)+"A"+r+","+r+",0,1,"+c+","+(this._x1=u)+","+(this._y1=l):f>1e-6&&(this._+="A"+r+","+r+",0,"+ +(f>=gn)+","+c+","+(this._x1=e+r*Math.cos(i))+","+(this._y1=t+r*Math.sin(i))))},rect:function rect(e,t,r,n){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function toString(){return this._}};var yn=path_path,_n=function(e){return function constant(){return e}},bn=Math.abs,xn=Math.atan2,wn=Math.cos,kn=Math.max,Sn=Math.min,En=Math.sin,Cn=Math.sqrt,Tn=1e-12,On=Math.PI,An=On/2,Rn=2*On;function asin(e){return e>=1?An:e<=-1?-An:Math.asin(e)}function arcInnerRadius(e){return e.innerRadius}function arcOuterRadius(e){return e.outerRadius}function arcStartAngle(e){return e.startAngle}function arcEndAngle(e){return e.endAngle}function arcPadAngle(e){return e&&e.padAngle}function cornerTangents(e,t,r,n,i,a,o){var s=e-r,u=t-n,l=(o?a:-a)/Cn(s*s+u*u),c=l*u,f=-l*s,d=e+c,h=t+f,p=r+c,g=n+f,m=(d+p)/2,v=(h+g)/2,y=p-d,_=g-h,b=y*y+_*_,x=i-a,w=d*g-p*h,k=(_<0?-1:1)*Cn(kn(0,x*x*b-w*w)),S=(w*_-y*k)/b,E=(-w*y-_*k)/b,C=(w*_+y*k)/b,T=(-w*y+_*k)/b,O=S-m,A=E-v,R=C-m,D=T-v;return O*O+A*A>R*R+D*D&&(S=C,E=T),{cx:S,cy:E,x01:-c,y01:-f,x11:S*(i/x-1),y11:E*(i/x-1)}}var Dn=function(){var e=arcInnerRadius,t=arcOuterRadius,r=_n(0),n=null,i=arcStartAngle,a=arcEndAngle,o=arcPadAngle,s=null;function arc(){var u,l,c=+e.apply(this,arguments),f=+t.apply(this,arguments),d=i.apply(this,arguments)-An,h=a.apply(this,arguments)-An,p=bn(h-d),g=h>d;if(s||(s=u=yn()),f<c&&(l=f,f=c,c=l),f>Tn)if(p>Rn-Tn)s.moveTo(f*wn(d),f*En(d)),s.arc(0,0,f,d,h,!g),c>Tn&&(s.moveTo(c*wn(h),c*En(h)),s.arc(0,0,c,h,d,g));else{var m,v,y=d,_=h,b=d,x=h,w=p,k=p,S=o.apply(this,arguments)/2,E=S>Tn&&(n?+n.apply(this,arguments):Cn(c*c+f*f)),C=Sn(bn(f-c)/2,+r.apply(this,arguments)),T=C,O=C;if(E>Tn){var A=asin(E/c*En(S)),R=asin(E/f*En(S));(w-=2*A)>Tn?(b+=A*=g?1:-1,x-=A):(w=0,b=x=(d+h)/2),(k-=2*R)>Tn?(y+=R*=g?1:-1,_-=R):(k=0,y=_=(d+h)/2)}var D=f*wn(y),P=f*En(y),j=c*wn(x),M=c*En(x);if(C>Tn){var F,I=f*wn(_),L=f*En(_),N=c*wn(b),B=c*En(b);if(p<On&&(F=function arc_intersect(e,t,r,n,i,a,o,s){var u=r-e,l=n-t,c=o-i,f=s-a,d=f*u-c*l;if(!(d*d<Tn))return[e+(d=(c*(t-a)-f*(e-i))/d)*u,t+d*l]}(D,P,N,B,I,L,j,M))){var U=D-F[0],z=P-F[1],q=I-F[0],W=L-F[1],G=1/En(function acos(e){return e>1?0:e<-1?On:Math.acos(e)}((U*q+z*W)/(Cn(U*U+z*z)*Cn(q*q+W*W)))/2),H=Cn(F[0]*F[0]+F[1]*F[1]);T=Sn(C,(c-H)/(G-1)),O=Sn(C,(f-H)/(G+1))}}k>Tn?O>Tn?(m=cornerTangents(N,B,D,P,f,O,g),v=cornerTangents(I,L,j,M,f,O,g),s.moveTo(m.cx+m.x01,m.cy+m.y01),O<C?s.arc(m.cx,m.cy,O,xn(m.y01,m.x01),xn(v.y01,v.x01),!g):(s.arc(m.cx,m.cy,O,xn(m.y01,m.x01),xn(m.y11,m.x11),!g),s.arc(0,0,f,xn(m.cy+m.y11,m.cx+m.x11),xn(v.cy+v.y11,v.cx+v.x11),!g),s.arc(v.cx,v.cy,O,xn(v.y11,v.x11),xn(v.y01,v.x01),!g))):(s.moveTo(D,P),s.arc(0,0,f,y,_,!g)):s.moveTo(D,P),c>Tn&&w>Tn?T>Tn?(m=cornerTangents(j,M,I,L,c,-T,g),v=cornerTangents(D,P,N,B,c,-T,g),s.lineTo(m.cx+m.x01,m.cy+m.y01),T<C?s.arc(m.cx,m.cy,T,xn(m.y01,m.x01),xn(v.y01,v.x01),!g):(s.arc(m.cx,m.cy,T,xn(m.y01,m.x01),xn(m.y11,m.x11),!g),s.arc(0,0,c,xn(m.cy+m.y11,m.cx+m.x11),xn(v.cy+v.y11,v.cx+v.x11),g),s.arc(v.cx,v.cy,T,xn(v.y11,v.x11),xn(v.y01,v.x01),!g))):s.arc(0,0,c,x,b,g):s.lineTo(j,M)}else s.moveTo(0,0);if(s.closePath(),u)return s=null,u+""||null}return arc.centroid=function(){var r=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,n=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-On/2;return[wn(n)*r,En(n)*r]},arc.innerRadius=function(t){return arguments.length?(e="function"===typeof t?t:_n(+t),arc):e},arc.outerRadius=function(e){return arguments.length?(t="function"===typeof e?e:_n(+e),arc):t},arc.cornerRadius=function(e){return arguments.length?(r="function"===typeof e?e:_n(+e),arc):r},arc.padRadius=function(e){return arguments.length?(n=null==e?null:"function"===typeof e?e:_n(+e),arc):n},arc.startAngle=function(e){return arguments.length?(i="function"===typeof e?e:_n(+e),arc):i},arc.endAngle=function(e){return arguments.length?(a="function"===typeof e?e:_n(+e),arc):a},arc.padAngle=function(e){return arguments.length?(o="function"===typeof e?e:_n(+e),arc):o},arc.context=function(e){return arguments.length?(s=null==e?null:e,arc):s},arc};function Linear(e){this._context=e}Linear.prototype={areaStart:function areaStart(){this._line=0},areaEnd:function areaEnd(){this._line=NaN},lineStart:function lineStart(){this._point=0},lineEnd:function lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};var Pn=function(e){return new Linear(e)};function point_x(e){return e[0]}function point_y(e){return e[1]}var jn=function(){var e=point_x,t=point_y,r=_n(!0),n=null,i=Pn,a=null;function line(o){var s,u,l,c=o.length,f=!1;for(null==n&&(a=i(l=yn())),s=0;s<=c;++s)!(s<c&&r(u=o[s],s,o))===f&&((f=!f)?a.lineStart():a.lineEnd()),f&&a.point(+e(u,s,o),+t(u,s,o));if(l)return a=null,l+""||null}return line.x=function(t){return arguments.length?(e="function"===typeof t?t:_n(+t),line):e},line.y=function(e){return arguments.length?(t="function"===typeof e?e:_n(+e),line):t},line.defined=function(e){return arguments.length?(r="function"===typeof e?e:_n(!!e),line):r},line.curve=function(e){return arguments.length?(i=e,null!=n&&(a=i(n)),line):i},line.context=function(e){return arguments.length?(null==e?n=a=null:a=i(n=e),line):n},line},Mn=function(){var e=point_x,t=null,r=_n(0),n=point_y,i=_n(!0),a=null,o=Pn,s=null;function area(u){var l,c,f,d,h,p=u.length,g=!1,m=new Array(p),v=new Array(p);for(null==a&&(s=o(h=yn())),l=0;l<=p;++l){if(!(l<p&&i(d=u[l],l,u))===g)if(g=!g)c=l,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=l-1;f>=c;--f)s.point(m[f],v[f]);s.lineEnd(),s.areaEnd()}g&&(m[l]=+e(d,l,u),v[l]=+r(d,l,u),s.point(t?+t(d,l,u):m[l],n?+n(d,l,u):v[l]))}if(h)return s=null,h+""||null}function arealine(){return jn().defined(i).curve(o).context(a)}return area.x=function(r){return arguments.length?(e="function"===typeof r?r:_n(+r),t=null,area):e},area.x0=function(t){return arguments.length?(e="function"===typeof t?t:_n(+t),area):e},area.x1=function(e){return arguments.length?(t=null==e?null:"function"===typeof e?e:_n(+e),area):t},area.y=function(e){return arguments.length?(r="function"===typeof e?e:_n(+e),n=null,area):r},area.y0=function(e){return arguments.length?(r="function"===typeof e?e:_n(+e),area):r},area.y1=function(e){return arguments.length?(n=null==e?null:"function"===typeof e?e:_n(+e),area):n},area.lineX0=area.lineY0=function(){return arealine().x(e).y(r)},area.lineY1=function(){return arealine().x(e).y(n)},area.lineX1=function(){return arealine().x(t).y(r)},area.defined=function(e){return arguments.length?(i="function"===typeof e?e:_n(!!e),area):i},area.curve=function(e){return arguments.length?(o=e,null!=a&&(s=o(a)),area):o},area.context=function(e){return arguments.length?(null==e?a=s=null:s=o(a=e),area):a},area};curveRadial(Pn);function Radial(e){this._curve=e}function curveRadial(e){function radial(t){return new Radial(e(t))}return radial._curve=e,radial}Radial.prototype={areaStart:function areaStart(){this._curve.areaStart()},areaEnd:function areaEnd(){this._curve.areaEnd()},lineStart:function lineStart(){this._curve.lineStart()},lineEnd:function lineEnd(){this._curve.lineEnd()},point:function point(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};Array.prototype.slice;var Fn={draw:function draw(e,t){var r=Math.sqrt(t/On);e.moveTo(r,0),e.arc(0,0,r,0,Rn)}},In=(Math.sqrt(1/3),Math.sin(On/10)/Math.sin(7*On/10)),Ln=(Math.sin(Rn/10),Math.cos(Rn/10),Math.sqrt(3),Math.sqrt(3),Math.sqrt(12),function(){var e=_n(Fn),t=_n(64),r=null;function symbol(){var n;if(r||(r=n=yn()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),n)return r=null,n+""||null}return symbol.type=function(t){return arguments.length?(e="function"===typeof t?t:_n(t),symbol):e},symbol.size=function(e){return arguments.length?(t="function"===typeof e?e:_n(+e),symbol):t},symbol.context=function(e){return arguments.length?(r=null==e?null:e,symbol):r},symbol}),Nn=function(){};function basis_point(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function Basis(e){this._context=e}Basis.prototype={areaStart:function areaStart(){this._line=0},areaEnd:function areaEnd(){this._line=NaN},lineStart:function lineStart(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function lineEnd(){switch(this._point){case 3:basis_point(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:basis_point(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};var Bn=function(e){return new Basis(e)};function BasisClosed(e){this._context=e}BasisClosed.prototype={areaStart:Nn,areaEnd:Nn,lineStart:function lineStart(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function lineEnd(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:basis_point(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};var Un=function(e){return new BasisClosed(e)};function BasisOpen(e){this._context=e}BasisOpen.prototype={areaStart:function areaStart(){this._line=0},areaEnd:function areaEnd(){this._line=NaN},lineStart:function lineStart(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function lineEnd(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:basis_point(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};var zn=function(e){return new BasisOpen(e)};function Bundle(e,t){this._basis=new Basis(e),this._beta=t}Bundle.prototype={lineStart:function lineStart(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function lineEnd(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var n,i=e[0],a=t[0],o=e[r]-i,s=t[r]-a,u=-1;++u<=r;)n=u/r,this._basis.point(this._beta*e[u]+(1-this._beta)*(i+n*o),this._beta*t[u]+(1-this._beta)*(a+n*s));this._x=this._y=null,this._basis.lineEnd()},point:function point(e,t){this._x.push(+e),this._y.push(+t)}};var qn=function custom(e){function bundle(t){return 1===e?new Basis(t):new Bundle(t,e)}return bundle.beta=function(e){return custom(+e)},bundle}(.85);function cardinal_point(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function Cardinal(e,t){this._context=e,this._k=(1-t)/6}Cardinal.prototype={areaStart:function areaStart(){this._line=0},areaEnd:function areaEnd(){this._line=NaN},lineStart:function lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function lineEnd(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:cardinal_point(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:cardinal_point(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Wn=function custom(e){function cardinal(t){return new Cardinal(t,e)}return cardinal.tension=function(e){return custom(+e)},cardinal}(0);function CardinalClosed(e,t){this._context=e,this._k=(1-t)/6}CardinalClosed.prototype={areaStart:Nn,areaEnd:Nn,lineStart:function lineStart(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function lineEnd(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:cardinal_point(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Gn=function custom(e){function cardinal(t){return new CardinalClosed(t,e)}return cardinal.tension=function(e){return custom(+e)},cardinal}(0);function CardinalOpen(e,t){this._context=e,this._k=(1-t)/6}CardinalOpen.prototype={areaStart:function areaStart(){this._line=0},areaEnd:function areaEnd(){this._line=NaN},lineStart:function lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function lineEnd(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:cardinal_point(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Hn=function custom(e){function cardinal(t){return new CardinalOpen(t,e)}return cardinal.tension=function(e){return custom(+e)},cardinal}(0);function catmullRom_point(e,t,r){var n=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>Tn){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);n=(n*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>Tn){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*l+e._x1*e._l23_2a-t*e._l12_2a)/c,o=(o*l+e._y1*e._l23_2a-r*e._l12_2a)/c}e._context.bezierCurveTo(n,i,a,o,e._x2,e._y2)}function CatmullRom(e,t){this._context=e,this._alpha=t}CatmullRom.prototype={areaStart:function areaStart(){this._line=0},areaEnd:function areaEnd(){this._line=NaN},lineStart:function lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function lineEnd(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function point(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:catmullRom_point(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Vn=function custom(e){function catmullRom(t){return e?new CatmullRom(t,e):new Cardinal(t,0)}return catmullRom.alpha=function(e){return custom(+e)},catmullRom}(.5);function CatmullRomClosed(e,t){this._context=e,this._alpha=t}CatmullRomClosed.prototype={areaStart:Nn,areaEnd:Nn,lineStart:function lineStart(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function lineEnd(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function point(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:catmullRom_point(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Yn=function custom(e){function catmullRom(t){return e?new CatmullRomClosed(t,e):new CardinalClosed(t,0)}return catmullRom.alpha=function(e){return custom(+e)},catmullRom}(.5);function CatmullRomOpen(e,t){this._context=e,this._alpha=t}CatmullRomOpen.prototype={areaStart:function areaStart(){this._line=0},areaEnd:function areaEnd(){this._line=NaN},lineStart:function lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function lineEnd(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function point(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:catmullRom_point(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var $n=function custom(e){function catmullRom(t){return e?new CatmullRomOpen(t,e):new CardinalOpen(t,0)}return catmullRom.alpha=function(e){return custom(+e)},catmullRom}(.5);function LinearClosed(e){this._context=e}LinearClosed.prototype={areaStart:Nn,areaEnd:Nn,lineStart:function lineStart(){this._point=0},lineEnd:function lineEnd(){this._point&&this._context.closePath()},point:function point(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};var Xn=function(e){return new LinearClosed(e)};function monotone_sign(e){return e<0?-1:1}function slope3(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(monotone_sign(a)+monotone_sign(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function slope2(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function monotone_point(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-n)/3;e._context.bezierCurveTo(n+s,i+s*t,a-s,o-s*r,a,o)}function MonotoneX(e){this._context=e}function MonotoneY(e){this._context=new ReflectContext(e)}function ReflectContext(e){this._context=e}function monotoneX(e){return new MonotoneX(e)}function monotoneY(e){return new MonotoneY(e)}function Natural(e){this._context=e}function controlPoints(e){var t,r,n=e.length-1,i=new Array(n),a=new Array(n),o=new Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}MonotoneX.prototype={areaStart:function areaStart(){this._line=0},areaEnd:function areaEnd(){this._line=NaN},lineStart:function lineStart(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function lineEnd(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:monotone_point(this,this._t0,slope2(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function point(e,t){var r=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,monotone_point(this,slope2(this,r=slope3(this,e,t)),r);break;default:monotone_point(this,this._t0,r=slope3(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}},(MonotoneY.prototype=Object.create(MonotoneX.prototype)).point=function(e,t){MonotoneX.prototype.point.call(this,t,e)},ReflectContext.prototype={moveTo:function moveTo(e,t){this._context.moveTo(t,e)},closePath:function closePath(){this._context.closePath()},lineTo:function lineTo(e,t){this._context.lineTo(t,e)},bezierCurveTo:function bezierCurveTo(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}},Natural.prototype={areaStart:function areaStart(){this._line=0},areaEnd:function areaEnd(){this._line=NaN},lineStart:function lineStart(){this._x=[],this._y=[]},lineEnd:function lineEnd(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===r)this._context.lineTo(e[1],t[1]);else for(var n=controlPoints(e),i=controlPoints(t),a=0,o=1;o<r;++a,++o)this._context.bezierCurveTo(n[0][a],i[0][a],n[1][a],i[1][a],e[o],t[o]);(this._line||0!==this._line&&1===r)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function point(e,t){this._x.push(+e),this._y.push(+t)}};var Kn=function(e){return new Natural(e)};function Step(e,t){this._context=e,this._t=t}Step.prototype={areaStart:function areaStart(){this._line=0},areaEnd:function areaEnd(){this._line=NaN},lineStart:function lineStart(){this._x=this._y=NaN,this._point=0},lineEnd:function lineEnd(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}}this._x=e,this._y=t}};var Jn=function(e){return new Step(e,.5)};function stepBefore(e){return new Step(e,0)}function stepAfter(e){return new Step(e,1)}var Qn={basis:{curve:Bn},"basis-closed":{curve:Un},"basis-open":{curve:zn},bundle:{curve:qn,tension:"beta",value:.85},cardinal:{curve:Wn,tension:"tension",value:0},"cardinal-open":{curve:Hn,tension:"tension",value:0},"cardinal-closed":{curve:Gn,tension:"tension",value:0},"catmull-rom":{curve:Vn,tension:"alpha",value:.5},"catmull-rom-closed":{curve:Yn,tension:"alpha",value:.5},"catmull-rom-open":{curve:$n,tension:"alpha",value:.5},linear:{curve:Pn},"linear-closed":{curve:Xn},monotone:{horizontal:monotoneY,vertical:monotoneX},natural:{curve:Kn},step:{curve:Jn},"step-after":{curve:stepAfter},"step-before":{curve:stepBefore}};function curves(e,t,r){var n=Object(V.v)(Qn,e)&&Qn[e],i=null;return n&&(i=n.curve||n[t||"vertical"],n.tension&&null!=r&&(i=i[n.tension](r))),i}var Zn={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},ei=[/([MLHVCSQTAZmlhvcsqtaz])/g,/###/,/(\d)([-+])/g,/\s|,|###/],ti=function(e){var t,r,n,i,a,o,s,u,l,c,f,d=[];for(u=0,c=(t=e.slice().replace(ei[0],"###$1").split(ei[1]).slice(1)).length;u<c;++u){for(n=(r=t[u]).slice(1).trim().replace(ei[2],"$1###$2").split(ei[3]),i=[o=r.charAt(0)],l=0,f=n.length;l<f;++l)(a=+n[l])===a&&i.push(a);if(s=Zn[o.toLowerCase()],i.length-1>s)for(l=1,f=i.length;l<f;l+=s)d.push([o].concat(i.slice(l,l+s)));else d.push(i)}return d},ri=Math.PI/180,ni=Math.PI/2,ii=2*Math.PI,ai=Math.sqrt(3)/2,oi={},si={},ui=[].join;function bezier(e){var t=ui.call(e);if(si[t])return si[t];var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],c=l*o,f=-u*s,d=u*o,h=l*s,p=Math.cos(i),g=Math.sin(i),m=Math.cos(a),v=Math.sin(a),y=.5*(a-i),_=Math.sin(.5*y),b=8/3*_*_/Math.sin(y),x=r+p-b*g,w=n+g+b*p,k=r+m,S=n+v,E=k+b*v,C=S-b*m;return si[t]=[c*x+f*w,d*x+h*w,c*E+f*C,d*E+h*C,c*k+f*S,d*k+h*S]}var li=["l",0,0,0,0,0,0,0];function render_scale(e,t){var r=li[0]=e[0];if("a"===r||"A"===r)li[1]=t*e[1],li[2]=t*e[2],li[3]=e[3],li[4]=e[4],li[5]=e[5],li[6]=t*e[6],li[7]=t*e[7];else for(var n=1,i=e.length;n<i;++n)li[n]=t*e[n];return li}var ci=function(e,t,r,n,i){var a,o,s,u,l,c=null,f=0,d=0,h=0,p=0;null==r&&(r=0),null==n&&(n=0),null==i&&(i=1),e.beginPath&&e.beginPath();for(var g=0,m=t.length;g<m;++g){switch(a=t[g],1!==i&&(a=render_scale(a,i)),a[0]){case"l":f+=a[1],d+=a[2],e.lineTo(f+r,d+n);break;case"L":f=a[1],d=a[2],e.lineTo(f+r,d+n);break;case"h":f+=a[1],e.lineTo(f+r,d+n);break;case"H":f=a[1],e.lineTo(f+r,d+n);break;case"v":d+=a[1],e.lineTo(f+r,d+n);break;case"V":d=a[1],e.lineTo(f+r,d+n);break;case"m":f+=a[1],d+=a[2],e.moveTo(f+r,d+n);break;case"M":f=a[1],d=a[2],e.moveTo(f+r,d+n);break;case"c":o=f+a[5],s=d+a[6],h=f+a[3],p=d+a[4],e.bezierCurveTo(f+a[1]+r,d+a[2]+n,h+r,p+n,o+r,s+n),f=o,d=s;break;case"C":f=a[5],d=a[6],h=a[3],p=a[4],e.bezierCurveTo(a[1]+r,a[2]+n,h+r,p+n,f+r,d+n);break;case"s":o=f+a[3],s=d+a[4],h=2*f-h,p=2*d-p,e.bezierCurveTo(h+r,p+n,f+a[1]+r,d+a[2]+n,o+r,s+n),h=f+a[1],p=d+a[2],f=o,d=s;break;case"S":o=a[3],s=a[4],h=2*f-h,p=2*d-p,e.bezierCurveTo(h+r,p+n,a[1]+r,a[2]+n,o+r,s+n),f=o,d=s,h=a[1],p=a[2];break;case"q":o=f+a[3],s=d+a[4],h=f+a[1],p=d+a[2],e.quadraticCurveTo(h+r,p+n,o+r,s+n),f=o,d=s;break;case"Q":o=a[3],s=a[4],e.quadraticCurveTo(a[1]+r,a[2]+n,o+r,s+n),f=o,d=s,h=a[1],p=a[2];break;case"t":o=f+a[1],s=d+a[2],null===c[0].match(/[QqTt]/)?(h=f,p=d):"t"===c[0]?(h=2*f-u,p=2*d-l):"q"===c[0]&&(h=2*f-h,p=2*d-p),u=h,l=p,e.quadraticCurveTo(h+r,p+n,o+r,s+n),d=s,h=(f=o)+a[1],p=d+a[2];break;case"T":o=a[1],s=a[2],h=2*f-h,p=2*d-p,e.quadraticCurveTo(h+r,p+n,o+r,s+n),f=o,d=s;break;case"a":drawArc(e,f+r,d+n,[a[1],a[2],a[3],a[4],a[5],a[6]+f+r,a[7]+d+n]),f+=a[6],d+=a[7];break;case"A":drawArc(e,f+r,d+n,[a[1],a[2],a[3],a[4],a[5],a[6]+r,a[7]+n]),f=a[6],d=a[7];break;case"z":case"Z":e.closePath()}c=a}};function drawArc(e,t,r,n){for(var i=function arc_segments(e,t,r,n,i,a,o,s,u){var l=ui.call(arguments);if(oi[l])return oi[l];var c=o*ri,f=Math.sin(c),d=Math.cos(c),h=d*(s-e)*.5+f*(u-t)*.5,p=d*(u-t)*.5-f*(s-e)*.5,g=h*h/((r=Math.abs(r))*r)+p*p/((n=Math.abs(n))*n);g>1&&(r*=g=Math.sqrt(g),n*=g);var m=d/r,v=f/r,y=-f/n,_=d/n,b=m*s+v*u,x=y*s+_*u,w=m*e+v*t,k=y*e+_*t,S=1/((w-b)*(w-b)+(k-x)*(k-x))-.25;S<0&&(S=0);var E=Math.sqrt(S);a==i&&(E=-E);var C=.5*(b+w)-E*(k-x),T=.5*(x+k)+E*(w-b),O=Math.atan2(x-T,b-C),A=Math.atan2(k-T,w-C)-O;A<0&&1===a?A+=ii:A>0&&0===a&&(A-=ii);for(var R=Math.ceil(Math.abs(A/(ni+.001))),D=[],P=0;P<R;++P){var j=O+P*A/R,M=O+(P+1)*A/R;D[P]=[C,T,j,M,r,n,f,d]}return oi[l]=D}(n[5],n[6],n[0],n[1],n[3],n[4],n[2],t,r),a=0;a<i.length;++a){var o=bezier(i[a]);e.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5])}}var fi={circle:{draw:function draw(e,t){var r=Math.sqrt(t)/2;e.moveTo(r,0),e.arc(0,0,r,0,ii)}},cross:{draw:function draw(e,t){var r=Math.sqrt(t)/2,n=r/2.5;e.moveTo(-r,-n),e.lineTo(-r,n),e.lineTo(-n,n),e.lineTo(-n,r),e.lineTo(n,r),e.lineTo(n,n),e.lineTo(r,n),e.lineTo(r,-n),e.lineTo(n,-n),e.lineTo(n,-r),e.lineTo(-n,-r),e.lineTo(-n,-n),e.closePath()}},diamond:{draw:function draw(e,t){var r=Math.sqrt(t)/2;e.moveTo(-r,0),e.lineTo(0,-r),e.lineTo(r,0),e.lineTo(0,r),e.closePath()}},square:{draw:function draw(e,t){var r=Math.sqrt(t),n=-r/2;e.rect(n,n,r,r)}},arrow:{draw:function draw(e,t){var r=Math.sqrt(t)/2,n=r/7,i=r/2.5,a=r/8;e.moveTo(-n,r),e.lineTo(n,r),e.lineTo(n,-a),e.lineTo(i,-a),e.lineTo(0,-r),e.lineTo(-i,-a),e.lineTo(-n,-a),e.closePath()}},wedge:{draw:function draw(e,t){var r=Math.sqrt(t)/2,n=ai*r,i=n-.5773502691896257*r,a=r/4;e.moveTo(0,-n-i),e.lineTo(-a,n-i),e.lineTo(a,n-i),e.closePath()}},triangle:{draw:function draw(e,t){var r=Math.sqrt(t)/2,n=ai*r,i=n-.5773502691896257*r;e.moveTo(0,-n-i),e.lineTo(-r,n-i),e.lineTo(r,n-i),e.closePath()}},"triangle-up":{draw:function draw(e,t){var r=Math.sqrt(t)/2,n=ai*r;e.moveTo(0,-n),e.lineTo(-r,n),e.lineTo(r,n),e.closePath()}},"triangle-down":{draw:function draw(e,t){var r=Math.sqrt(t)/2,n=ai*r;e.moveTo(0,n),e.lineTo(-r,-n),e.lineTo(r,-n),e.closePath()}},"triangle-right":{draw:function draw(e,t){var r=Math.sqrt(t)/2,n=ai*r;e.moveTo(n,0),e.lineTo(-n,-r),e.lineTo(-n,r),e.closePath()}},"triangle-left":{draw:function draw(e,t){var r=Math.sqrt(t)/2,n=ai*r;e.moveTo(-n,0),e.lineTo(n,-r),e.lineTo(n,r),e.closePath()}},stroke:{draw:function draw(e,t){var r=Math.sqrt(t)/2;e.moveTo(-r,0),e.lineTo(r,0)}}};function symbols_symbols(e){return Object(V.v)(fi,e)?fi[e]:function customSymbol(e){if(!Object(V.v)(di,e)){var t=ti(e);di[e]={draw:function draw(e,r){ci(e,t,0,0,Math.sqrt(r)/2)}}}return di[e]}(e)}var di={};function rectangleX(e){return e.x}function rectangleY(e){return e.y}function rectangleWidth(e){return e.width}function rectangleHeight(e){return e.height}function rectangle_constant(e){return function(){return e}}function shapes_x(e){return e.x||0}function shapes_y(e){return e.y||0}function shapes_cr(e){return e.cornerRadius||0}function shapes_def(e){return!(!1===e.defined)}var hi=Dn().startAngle((function shapes_sa(e){return e.startAngle||0})).endAngle((function shapes_ea(e){return e.endAngle||0})).padAngle((function shapes_pa(e){return e.padAngle||0})).innerRadius((function ir(e){return e.innerRadius||0})).outerRadius((function shapes_or(e){return e.outerRadius||0})).cornerRadius(shapes_cr),pi=Mn().x(shapes_x).y1(shapes_y).y0((function yh(e){return(e.y||0)+(e.height||0)})).defined(shapes_def),gi=Mn().y(shapes_y).x1(shapes_x).x0((function xw(e){return(e.x||0)+(e.width||0)})).defined(shapes_def),mi=jn().x(shapes_x).y(shapes_y).defined(shapes_def),vi=function(){var e=rectangleX,t=rectangleY,r=rectangleWidth,n=rectangleHeight,i=rectangle_constant(0),a=null;function rectangle(o,s,u){var l,c=null!=s?s:+e.call(this,o),f=null!=u?u:+t.call(this,o),d=+r.call(this,o),h=+n.call(this,o),p=+i.call(this,o);if(a||(a=l=yn()),p<=0)a.rect(c,f,d,h);else{var g=c+d,m=f+h;a.moveTo(c+p,f),a.lineTo(g-p,f),a.quadraticCurveTo(g,f,g,f+p),a.lineTo(g,m-p),a.quadraticCurveTo(g,m,g-p,m),a.lineTo(c+p,m),a.quadraticCurveTo(c,m,c,m-p),a.lineTo(c,f+p),a.quadraticCurveTo(c,f,c+p,f),a.closePath()}if(l)return a=null,l+""||null}return rectangle.x=function(t){return arguments.length?(e="function"===typeof t?t:rectangle_constant(+t),rectangle):e},rectangle.y=function(e){return arguments.length?(t="function"===typeof e?e:rectangle_constant(+e),rectangle):t},rectangle.width=function(e){return arguments.length?(r="function"===typeof e?e:rectangle_constant(+e),rectangle):r},rectangle.height=function(e){return arguments.length?(n="function"===typeof e?e:rectangle_constant(+e),rectangle):n},rectangle.cornerRadius=function(e){return arguments.length?(i="function"===typeof e?e:rectangle_constant(+e),rectangle):i},rectangle.context=function(e){return arguments.length?(a=null==e?null:e,rectangle):a},rectangle}().x(shapes_x).y(shapes_y).width((function shapes_w(e){return e.width||0})).height((function shapes_h(e){return e.height||0})).cornerRadius(shapes_cr),yi=Ln().type((function shapes_type(e){return symbols_symbols(e.shape||"circle")})).size((function shapes_size(e){return null==e.size?64:e.size})),_i=function(){var e,t,r,n,i,a,o,s,u=null;function point(e,t,r){var n=r/2;if(i){var l=o-t,c=e-a;if(l||c){var f=Math.sqrt(l*l+c*c),d=(l/=f)*s,h=(c/=f)*s,p=Math.atan2(c,l);u.moveTo(a-d,o-h),u.lineTo(e-l*n,t-c*n),u.arc(e,t,n,p-Math.PI,p),u.lineTo(a+d,o+h),u.arc(a,o,s,p,p+Math.PI)}else u.arc(e,t,n,0,ii);u.closePath()}else i=1;a=e,o=t,s=n}function trail(a){var o,s,l,c=a.length,f=!1;for(null==u&&(u=l=yn()),o=0;o<=c;++o)!(o<c&&n(s=a[o],o,a))===f&&(f=!f)&&(i=0),f&&point(+e(s,o,a),+t(s,o,a),+r(s,o,a));if(l)return u=null,l+""||null}return trail.x=function(t){return arguments.length?(e=t,trail):e},trail.y=function(e){return arguments.length?(t=e,trail):t},trail.size=function(e){return arguments.length?(r=e,trail):r},trail.defined=function(e){return arguments.length?(n=e,trail):n},trail.context=function(e){return arguments.length?(u=null==e?null:e,trail):u},trail}().x(shapes_x).y(shapes_y).defined(shapes_def).size((function ts(e){return e.size||1}));function shapes_rectangle(e,t,r,n){return vi.context(e)(t,r,n)}var bi,xi=function(e,t){return t.stroke&&0!==t.opacity&&0!==t.strokeOpacity&&e.expand(null!=t.strokeWidth?+t.strokeWidth:1),e},wi=ii-1e-8;function boundContext_context(e){return bi=e,boundContext_context}function boundContext_noop(){}function boundContext_add(e,t){bi.add(e,t)}boundContext_context.beginPath=boundContext_noop,boundContext_context.closePath=boundContext_noop,boundContext_context.moveTo=boundContext_add,boundContext_context.lineTo=boundContext_add,boundContext_context.rect=function(e,t,r,n){boundContext_add(e,t),boundContext_add(e+r,t+n)},boundContext_context.quadraticCurveTo=function(e,t,r,n){boundContext_add(e,t),boundContext_add(r,n)},boundContext_context.bezierCurveTo=function(e,t,r,n,i,a){boundContext_add(e,t),boundContext_add(r,n),boundContext_add(i,a)},boundContext_context.arc=function(e,t,r,n,i,a){if(Math.abs(i-n)>wi)return boundContext_add(e-r,t-r),void boundContext_add(e+r,t+r);var o,s,u,l,c=1/0,f=-1/0,d=1/0,h=-1/0;function update(e){u=r*Math.cos(e),l=r*Math.sin(e),u<c&&(c=u),u>f&&(f=u),l<d&&(d=l),l>h&&(h=l)}if(update(n),update(i),i!==n)if((n%=ii)<0&&(n+=ii),(i%=ii)<0&&(i+=ii),i<n&&(a=!a,o=n,n=i,i=o),a)for(i-=ii,o=n-n%ni,s=0;s<4&&o>i;++s,o-=ni)update(o);else for(o=n-n%ni+ni,s=0;s<4&&o<i;++s,o+=ni)update(o);boundContext_add(e+c,t+d),boundContext_add(e+f,t+h)};var ki=(ki=domCanvas(1,1))?ki.getContext("2d"):null,Si=new Bounds;function intersectPath(e){return function(t,r){if(!ki)return!0;e(ki,t),Si.clear().union(t.bounds).intersect(r).round();for(var n=Si.x1,i=Si.y1,a=Si.x2,o=Si.y2,s=i;s<=o;++s)for(var u=n;u<=a;++u)if(ki.isPointInPath(u,s))return!0;return!1}}function intersectPoint(e,t){return t.contains(e.x||0,e.y||0)}function intersectRect(e,t){var r=e.x||0,n=e.y||0,i=e.width||0,a=e.height||0;return t.intersects(Si.set(r,n,r+i,n+a))}function intersectBoxLine(e,t,r,n,i){var a,o,s,u,l=e.x1,c=e.y1,f=e.x2,d=e.y2,h=n-t,p=i-r,g=0,m=1;for(u=0;u<4;++u){if(0===u&&(a=-h,o=-(l-t)),1===u&&(a=h,o=f-t),2===u&&(a=-p,o=-(c-r)),3===u&&(a=p,o=d-r),Math.abs(a)<1e-10&&o<0)return!1;if(s=o/a,a<0){if(s>m)return!1;s>g&&(g=s)}else if(a>0){if(s<g)return!1;s<m&&(m=s)}}return!0}var Ei=function(e,t,r){return isGradient(r)?function(e,t,r){for(var n=r.width(),i=r.height(),a=t.stops,o=a.length,s="radial"===t.gradient?e.createRadialGradient(r.x1+(t.x1||.5)*n,r.y1+(t.y1||.5)*i,Math.max(n,i)*(t.r1||0),r.x1+(t.x2||.5)*n,r.y1+(t.y2||.5)*i,Math.max(n,i)*(t.r2||.5)):e.createLinearGradient(r.x1+(t.x1||0)*n,r.y1+(t.y1||0)*i,r.x1+(t.x2||1)*n,r.y1+(t.y2||0)*i),u=0;u<o;++u)s.addColorStop(a[u].offset,a[u].color);return s}(e,r,t.bounds):r},Ci=function(e,t,r){return(r*=null==t.fillOpacity?1:t.fillOpacity)>0&&(e.globalAlpha=r,e.fillStyle=Ei(e,t,t.fill),!0)},Ti=[],Oi=function(e,t,r){var n=null!=(n=t.strokeWidth)?n:1;return!(n<=0)&&((r*=null==t.strokeOpacity?1:t.strokeOpacity)>0&&(e.globalAlpha=r,e.strokeStyle=Ei(e,t,t.stroke),e.lineWidth=n,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||Ti),e.lineDashOffset=t.strokeDashOffset||0),!0))};function visit_compare(e,t){return e.zindex-t.zindex||e.index-t.index}function zorder(e){if(!e.zdirty)return e.zitems;var t,r,n,i=e.items,a=[];for(r=0,n=i.length;r<n;++r)(t=i[r]).index=r,t.zindex&&a.push(t);return e.zdirty=!1,e.zitems=a.sort(visit_compare)}function visit_visit(e,t){var r,n,i=e.items;if(i&&i.length){var a=zorder(e);if(a&&a.length){for(r=0,n=i.length;r<n;++r)i[r].zindex||t(i[r]);i=a}for(r=0,n=i.length;r<n;++r)t(i[r])}}function pickVisit(e,t){var r,n,i=e.items;if(!i||!i.length)return null;var a=zorder(e);for(a&&a.length&&(i=a),n=i.length;--n>=0;)if(r=t(i[n]))return r;if(i===a)for(n=(i=e.items).length;--n>=0;)if(!i[n].zindex&&(r=t(i[n])))return r;return null}function drawAll(e){return function(t,r,n){visit_visit(r,(function(r){n&&!n.intersects(r.bounds)||drawPath(e,t,r,r)}))}}function drawPath(e,t,r,n){var i=null==r.opacity?1:r.opacity;0!==i&&(e(t,n)||(r.fill&&Ci(t,r,i)&&t.fill(),r.stroke&&Oi(t,r,i)&&t.stroke()))}function pick_pick(e){return e=e||V.eb,function(t,r,n,i,a,o){return n*=t.pixelRatio,i*=t.pixelRatio,pickVisit(r,(function(r){var s=r.bounds;if((!s||s.contains(a,o))&&s)return e(t,r,n,i,a,o)?r:void 0}))}}function hitPath(e,t){return function(r,n,i,a){var o,s,u=Array.isArray(n)?n[0]:n,l=null==t?u.fill:t,c=u.stroke&&r.isPointInStroke;return c&&(o=u.strokeWidth,s=u.strokeCap,r.lineWidth=null!=o?o:1,r.lineCap=null!=s?s:"butt"),!e(r,n)&&(l&&r.isPointInPath(i,a)||c&&r.isPointInStroke(i,a))}}function pickPath(e){return pick_pick(hitPath(e))}function transform_translate(e,t){return"translate("+e+","+t+")"}function transform_rotate(e){return"rotate("+e+")"}function translateItem(e){return transform_translate(e.x||0,e.y||0)}var Ai=function(e,t,r){function draw(e,r){var n=r.x||0,i=r.y||0,a=r.angle||0;e.translate(n,i),a&&e.rotate(a*=ri),e.beginPath(),t(e,r),a&&e.rotate(-a),e.translate(-n,-i)}return{type:e,tag:"path",nested:!1,attr:function attr(e,r){e("transform",function transformItem(e){return transform_translate(e.x||0,e.y||0)+(e.angle?" "+transform_rotate(e.angle):"")}(r)),e("d",t(null,r))},bound:function bound(e,r){var n=r.x||0,i=r.y||0;return t(boundContext_context(e),r),xi(e,r).translate(n,i),r.angle&&e.rotate(r.angle*ri,n,i),e},draw:drawAll(draw),pick:pickPath(draw),isect:r||intersectPath(draw)}},Ri=Ai("arc",(function shapes_arc(e,t){return hi.context(e)(t)}));var Di=function(e,t,r){function draw(e,r){e.beginPath(),t(e,r)}var n,i=hitPath(draw);return{type:e,tag:"path",nested:!0,attr:function attr(e,r){var n=r.mark.items;n.length&&e("d",t(null,n))},bound:function bound(e,r){var n=r.items;return 0===n.length?e:(t(boundContext_context(e),n),xi(e,n[0]))},draw:(n=draw,function(e,t,r){!t.items.length||r&&!r.intersects(t.bounds)||drawPath(n,e,t.items[0],t.items)}),pick:function pick(e,t,r,n,a,o){var s=t.items,u=t.bounds;return!s||!s.length||u&&!u.contains(a,o)?null:(r*=e.pixelRatio,n*=e.pixelRatio,i(e,s,r,n)?s[0]:null)},isect:intersectPoint,tip:r}},Pi=Di("area",(function shapes_area(e,t){var r=t[0],n=r.interpolate||"linear";return("horizontal"===r.orient?gi:pi).curve(curves(n,r.orient,r.tension)).context(e)(t)}),(function pickArea(e,t){for(var r,n,i="horizontal"===e[0].orient?t[1]:t[0],a="horizontal"===e[0].orient?"y":"x",o=e.length,s=1/0;--o>=0;)!1!==e[o].defined&&(n=Math.abs(e[o][a]-i))<s&&(s=n,r=e[o]);return r})),ji=1;var Mi=function(e,t,r){var n=t.clip,i=e._defs,a=t.clip_id||(t.clip_id="clip"+ji++),o=i.clipping[a]||(i.clipping[a]={id:a});return Object(V.D)(n)?o.path=n(null):(o.width=r.width||0,o.height=r.height||0),"url(#"+a+")"},Fi=.5;function backgroundPath(e,t){var r=t.stroke?Fi:0;e.beginPath(),shapes_rectangle(e,t,r,r)}var Ii=hitPath(backgroundPath);var Li={type:"group",tag:"g",nested:!1,attr:function group_attr(e,t){e("transform",translateItem(t))},bound:function group_bound(e,t){if(!t.clip&&t.items)for(var r=t.items,n=0,i=r.length;n<i;++n)e.union(r[n].bounds);return(t.clip||t.width||t.height)&&!t.noBound&&e.add(0,0).add(t.width||0,t.height||0),xi(e,t),e.translate(t.x||0,t.y||0)},draw:function group_draw(e,t,r){var n=this;visit_visit(t,(function(t){var i,a=t.x||0,o=t.y||0,s=t.width||0,u=t.height||0;e.save(),e.translate(a,o),(t.stroke||t.fill)&&(i=null==t.opacity?1:t.opacity)>0&&(backgroundPath(e,t),t.fill&&Ci(e,t,i)&&e.fill(),t.stroke&&Oi(e,t,i)&&e.stroke()),t.clip&&(e.beginPath(),e.rect(0,0,s,u),e.clip()),r&&r.translate(-a,-o),visit_visit(t,(function(t){n.draw(e,t,r)})),r&&r.translate(a,o),e.restore()}))},pick:function group_pick(e,t,r,n,i,a){if(t.bounds&&!t.bounds.contains(i,a)||!t.items)return null;var o=this,s=r*e.pixelRatio,u=n*e.pixelRatio;return pickVisit(t,(function(l){var c,f,d,h;if(!(h=l.bounds)||h.contains(i,a))return f=l.x||0,d=l.y||0,e.save(),e.translate(f,d),f=i-f,d=a-d,!(c=pickVisit(l,(function(e){return function pickMark(e,t,r){return(!1!==e.interactive||"group"===e.marktype)&&e.bounds&&e.bounds.contains(t,r)}(e,f,d)?o.pick(e,r,n,f,d):null})))&&!1!==t.interactive&&(l.fill||l.stroke)&&Ii(e,l,s,u)&&(c=l),e.restore(),c||null}))},isect:intersectRect,background:function background(e,t){var r=t.stroke?Fi:0;e("class","background"),e("d",shapes_rectangle(null,t,r,r))},foreground:function foreground(e,t,r){e("clip-path",t.clip?Mi(r,t,t):null)}};function getImage(e,t){var r=e.image;return r&&r.url===e.url||(r={loaded:!1,width:0,height:0},t.loadImage(e.url).then((function(t){e.image=t,e.image.url=e.url}))),r}function imageXOffset(e,t){return"center"===e?t/2:"right"===e?t:0}function imageYOffset(e,t){return"middle"===e?t/2:"bottom"===e?t:0}var Ni={type:"image",tag:"image",nested:!1,attr:function image_attr(e,t,r){var n=getImage(t,r),i=t.x||0,a=t.y||0,o=(null!=t.width?t.width:n.width)||0,s=(null!=t.height?t.height:n.height)||0,u=!1===t.aspect?"none":"xMidYMid";i-=imageXOffset(t.align,o),a-=imageYOffset(t.baseline,s),e("href",n.src||"","http://www.w3.org/1999/xlink","xlink:href"),e("transform",transform_translate(i,a)),e("width",o),e("height",s),e("preserveAspectRatio",u)},bound:function image_bound(e,t){var r=t.image,n=t.x||0,i=t.y||0,a=(null!=t.width?t.width:r&&r.width)||0,o=(null!=t.height?t.height:r&&r.height)||0;return n-=imageXOffset(t.align,a),i-=imageYOffset(t.baseline,o),e.set(n,i,n+a,i+o)},draw:function image_draw(e,t,r){var n=this;visit_visit(t,(function(t){if(!r||r.intersects(t.bounds)){var i,a,o,s,u=getImage(t,n),l=t.x||0,c=t.y||0,f=(null!=t.width?t.width:u.width)||0,d=(null!=t.height?t.height:u.height)||0;l-=imageXOffset(t.align,f),c-=imageYOffset(t.baseline,d),!1!==t.aspect&&(a=u.width/u.height,o=t.width/t.height,a===a&&o===o&&a!==o&&(o<a?(c+=(d-(s=f/a))/2,d=s):(l+=(f-(s=d*a))/2,f=s))),u.loaded&&(e.globalAlpha=null!=(i=t.opacity)?i:1,e.drawImage(u,l,c,f,d))}}))},pick:pick_pick(),isect:V.eb,get:getImage,xOffset:imageXOffset,yOffset:imageYOffset},Bi=Di("line",(function shapes_line(e,t){var r=t[0],n=r.interpolate||"linear";return mi.curve(curves(n,r.orient,r.tension)).context(e)(t)}),(function pickLine(e,t){for(var r,n,i=Math.pow(e[0].strokeWidth||1,2),a=e.length;--a>=0;)if(!1!==e[a].defined&&(r=e[a].x-t[0])*r+(n=e[a].y-t[1])*n<i)return e[a];return null}));function marks_path_path(e,t){var r=t.path;if(null==r)return!0;var n=t.pathCache;n&&n.path===r||((t.pathCache=n=ti(r)).path=r),ci(e,n,t.x,t.y)}var Ui={type:"path",tag:"path",nested:!1,attr:function path_attr(e,t){e("transform",translateItem(t)),e("d",t.path)},bound:function path_bound(e,t){return marks_path_path(boundContext_context(e),t)?e.set(0,0,0,0):xi(e,t)},draw:drawAll(marks_path_path),pick:pickPath(marks_path_path),isect:intersectPath(marks_path_path)};function rect_draw(e,t){e.beginPath(),shapes_rectangle(e,t)}var zi={type:"rect",tag:"path",nested:!1,attr:function rect_attr(e,t){e("d",shapes_rectangle(null,t))},bound:function rect_bound(e,t){var r,n;return xi(e.set(r=t.x||0,n=t.y||0,r+t.width||0,n+t.height||0),t)},draw:drawAll(rect_draw),pick:pickPath(rect_draw),isect:intersectRect};function rule_path(e,t,r){var n,i,a,o;return!(!t.stroke||!Oi(e,t,r))&&(n=t.x||0,i=t.y||0,a=null!=t.x2?t.x2:n,o=null!=t.y2?t.y2:i,e.beginPath(),e.moveTo(n,i),e.lineTo(a,o),!0)}var qi,Wi={type:"rule",tag:"line",nested:!1,attr:function rule_attr(e,t){e("transform",translateItem(t)),e("x2",null!=t.x2?t.x2-(t.x||0):0),e("y2",null!=t.y2?t.y2-(t.y||0):0)},bound:function rule_bound(e,t){var r,n;return xi(e.set(r=t.x||0,n=t.y||0,null!=t.x2?t.x2:r,null!=t.y2?t.y2:n),t)},draw:function rule_draw(e,t,r){visit_visit(t,(function(t){if(!r||r.intersects(t.bounds)){var n=null==t.opacity?1:t.opacity;n&&rule_path(e,t,n)&&e.stroke()}}))},pick:pick_pick((function rule_hit(e,t,r,n){return!!e.isPointInStroke&&(rule_path(e,t,1)&&e.isPointInStroke(r,n))})),isect:function intersectRule(e,t){var r=e.x||0,n=e.y||0;return intersectBoxLine(t,r,n,null!=e.x2?e.x2:r,null!=e.y2?e.y2:n)}},Gi=Ai("shape",(function shapes_shape(e,t){return(t.mark.shape||t.shape).context(e)(t)})),Hi=Ai("symbol",(function shapes_symbol(e,t){return yi.context(e)(t)}),intersectPoint),Vi={height:text_fontSize,measureWidth:measureWidth,estimateWidth:estimateWidth,width:estimateWidth,canvas:useCanvas};function estimateWidth(e){return qi=text_fontSize(e),estimate(textValue(e))}function estimate(e){return~~(.8*e.length*qi)}function measureWidth(e){return text_fontSize(e)<=0?0:(ki.font=text_font(e),text_measure(textValue(e)))}function text_measure(e){return ki.measureText(e).width}function text_fontSize(e){return null!=e.fontSize?e.fontSize:11}function useCanvas(e){Vi.width=e&&ki?measureWidth:estimateWidth}function textValue(e){var t=e.text;return null==t?"":e.limit>0?function truncate(e){var t,r=+e.limit,n=e.text+"";Vi.width===measureWidth?(ki.font=text_font(e),t=text_measure):(qi=text_fontSize(e),t=estimate);if(t(n)<r)return n;var i,a=e.ellipsis||"\u2026",o="rtl"===e.dir,s=0,u=n.length;if(r-=t(a),o){for(;s<u;)i=s+u>>>1,t(n.slice(i))>r?s=i+1:u=i;return a+n.slice(s)}for(;s<u;)i=1+(s+u>>>1),t(n.slice(0,i))<r?s=i:u=i-1;return n.slice(0,s)+a}(e):t+""}function fontFamily(e,t){var r=e.font;return(t&&r?String(r).replace(/"/g,"'"):r)||"sans-serif"}function text_font(e,t){return(e.fontStyle?e.fontStyle+" ":"")+(e.fontVariant?e.fontVariant+" ":"")+(e.fontWeight?e.fontWeight+" ":"")+text_fontSize(e)+"px "+fontFamily(e,t)}function text_offset(e){var t=e.baseline,r=text_fontSize(e);return Math.round("top"===t?.79*r:"middle"===t?.3*r:"bottom"===t?-.21*r:0)}useCanvas(!0);var Yi={left:"start",center:"middle",right:"end"},$i=new Bounds;function anchorPoint(e){var t,r=e.x||0,n=e.y||0,i=e.radius||0;return i&&(t=(e.theta||0)-ni,r+=i*Math.cos(t),n+=i*Math.sin(t)),$i.x1=r,$i.y1=n,$i}function text_bound(e,t,r){var n,i=Vi.height(t),a=t.align,o=anchorPoint(t),s=o.x1,u=o.y1,l=t.dx||0,c=(t.dy||0)+text_offset(t)-Math.round(.8*i);if(n=Vi.width(t),"center"===a?l-=n/2:"right"===a&&(l-=n),e.set(l+=s,c+=u,l+n,c+i),t.angle&&!r)e.rotate(t.angle*ri,s,u);else if(2===r)return e.rotatedPoints(t.angle*ri,s,u);return e}var Xi={arc:Ri,area:Pi,group:Li,image:Ni,line:Bi,path:Ui,rect:zi,rule:Wi,shape:Gi,symbol:Hi,text:{type:"text",tag:"text",nested:!1,attr:function text_attr(e,t){var r,n=t.dx||0,i=(t.dy||0)+text_offset(t),a=anchorPoint(t),o=a.x1,s=a.y1,u=t.angle||0;e("text-anchor",Yi[t.align]||"start"),u?(r=transform_translate(o,s)+" "+transform_rotate(u),(n||i)&&(r+=" "+transform_translate(n,i))):r=transform_translate(o+n,s+i),e("transform",r)},bound:text_bound,draw:function text_draw(e,t,r){visit_visit(t,(function(t){var n,i,a,o,s;r&&!r.intersects(t.bounds)||(s=textValue(t))&&(0===(n=null==t.opacity?1:t.opacity)||t.fontSize<=0||(e.font=text_font(t),e.textAlign=t.align||"left",a=(i=anchorPoint(t)).x1,o=i.y1,t.angle&&(e.save(),e.translate(a,o),e.rotate(t.angle*ri),a=o=0),a+=t.dx||0,o+=(t.dy||0)+text_offset(t),t.fill&&Ci(e,t,n)&&e.fillText(s,a,o),t.stroke&&Oi(e,t,n)&&e.strokeText(s,a,o),t.angle&&e.restore()))}))},pick:pick_pick((function text_hit(e,t,r,n,i,a){if(t.fontSize<=0)return!1;if(!t.angle)return!0;var o=anchorPoint(t),s=o.x1,u=o.y1,l=text_bound($i,t,1),c=-t.angle*ri,f=Math.cos(c),d=Math.sin(c),h=f*i-d*a+(s-f*s+d*u),p=d*i+f*a+(u-d*s-f*u);return l.contains(h,p)})),isect:function intersectText(e,t){var r=text_bound($i,e,2);return intersectBoxLine(t,r[0],r[1],r[2],r[3])||intersectBoxLine(t,r[0],r[1],r[4],r[5])||intersectBoxLine(t,r[4],r[5],r[6],r[7])||intersectBoxLine(t,r[2],r[3],r[6],r[7])}},trail:Di("trail",(function shapes_trail(e,t){return _i.context(e)(t)}),(function pickTrail(e,t){for(var r,n,i=e.length;--i>=0;)if(!1!==e[i].defined&&(r=e[i].x-t[0])*r+(n=e[i].y-t[1])*n<(r=e[i].size||1)*r)return e[i];return null}))},Ki=function(e,t,r){var n=Xi[e.mark.marktype],i=t||n.bound;return n.nested&&(e=e.mark),i(e.bounds||(e.bounds=new Bounds),e,r)},Ji={mark:null},Qi=function(e,t,r){var n,i,a,o,s=Xi[e.marktype],u=s.bound,l=e.items,c=l&&l.length;if(s.nested)return c?a=l[0]:(Ji.mark=e,a=Ji),o=Ki(a,u,r),t=t&&t.union(o)||o;if(t=t||e.bounds&&e.bounds.clear()||new Bounds,c)for(n=0,i=l.length;n<i;++n)t.union(Ki(l[n],u,r));return e.bounds=t},Zi=["marktype","name","role","interactive","clip","items","zindex","x","y","width","height","align","baseline","fill","fillOpacity","opacity","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","startAngle","endAngle","innerRadius","outerRadius","cornerRadius","padAngle","interpolate","tension","orient","defined","url","path","x2","y2","size","shape","text","angle","theta","radius","dx","dy","font","fontSize","fontWeight","fontStyle","fontVariant"];function sceneFromJSON(e){return function serialize_initialize(e){var t,r,n,i=e.marktype,a=e.items;if(a)for(r=0,n=a.length;r<n;++r)t=i?"mark":"group",a[r][t]=e,a[r].zindex&&(a[r][t].zdirty=!0),"group"===(i||t)&&serialize_initialize(a[r]);i&&Qi(e);return e}("string"===typeof e?JSON.parse(e):e)}var ea=function Scenegraph(e){arguments.length?this.root=sceneFromJSON(e):(this.root=createMark({marktype:"group",name:"root",role:"frame"}),this.root.items=[new GroupItem(this.root)])}.prototype;function createMark(e,t){return{bounds:new Bounds,clip:!!e.clip,group:t,interactive:!1!==e.interactive,items:[],marktype:e.marktype,name:e.name||void 0,role:e.role||void 0,zindex:e.zindex||0}}function domCreate(e,t,r){return!e&&"undefined"!==typeof document&&document.createElement&&(e=document),e?r?e.createElementNS(r,t):e.createElement(t):null}function domFind(e,t){t=t.toLowerCase();for(var r=e.childNodes,n=0,i=r.length;n<i;++n)if(r[n].tagName.toLowerCase()===t)return r[n]}function domChild(e,t,r,n){var i,a=e.childNodes[t];return a&&a.tagName.toLowerCase()===r.toLowerCase()||(i=a||null,a=domCreate(e.ownerDocument,r,n),e.insertBefore(a,i)),a}function domClear(e,t){for(var r=e.childNodes,n=r.length;n>t;)e.removeChild(r[--n]);return e}function cssClass(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}ea.toJSON=function(e){return function sceneToJSON(e,t){return JSON.stringify(e,Zi,t)}(this.root,e||0)},ea.mark=function(e,t,r){var n=createMark(e,t=t||this.root.items[0]);return t.items[r]=n,n.zindex&&(n.group.zdirty=!0),n};var ta=function(e,t){var r=t.getBoundingClientRect();return[e.clientX-r.left-(t.clientLeft||0),e.clientY-r.top-(t.clientTop||0)]};function Handler_Handler(e,t){this._active=null,this._handlers={},this._loader=e||hn(),this._tooltip=t||defaultTooltip}function defaultTooltip(e,t,r,n){e.element().setAttribute("title",n||"")}var ra=Handler_Handler.prototype;function Renderer_Renderer(e){this._el=null,this._bgcolor=null,this._loader=new ResourceLoader(e)}ra.initialize=function(e,t,r){return this._el=e,this._obj=r||null,this.origin(t)},ra.element=function(){return this._el},ra.canvas=function(){return this._el&&this._el.firstChild},ra.origin=function(e){return arguments.length?(this._origin=e||[0,0],this):this._origin.slice()},ra.scene=function(e){return arguments.length?(this._scene=e,this):this._scene},ra.on=function(){},ra.off=function(){},ra._handlerIndex=function(e,t,r){for(var n=e?e.length:0;--n>=0;)if(e[n].type===t&&(!r||e[n].handler===r))return n;return-1},ra.handlers=function(e){var t,r=this._handlers,n=[];if(e)n.push.apply(n,r[this.eventName(e)]);else for(t in r)n.push.apply(n,r[t]);return n},ra.eventName=function(e){var t=e.indexOf(".");return t<0?e:e.slice(0,t)},ra.handleHref=function(e,t,r){this._loader.sanitize(r,{context:"href"}).then((function(t){var r=new MouseEvent(e.type,e),n=domCreate(null,"a");for(var i in t)n.setAttribute(i,t[i]);n.dispatchEvent(r)})).catch((function(){}))},ra.handleTooltip=function(e,t,r){if(t&&null!=t.tooltip){t=function(e,t,r,n){var i,a,o=e&&e.mark;if(o&&(i=Xi[o.marktype]).tip){for((a=ta(t,r))[0]-=n[0],a[1]-=n[1];e=e.mark.group;)a[0]-=e.x||0,a[1]-=e.y||0;e=i.tip(o.items,a)}return e}(t,e,this.canvas(),this._origin);var n=r&&t&&t.tooltip||null;this._tooltip.call(this._obj,this,e,t,n)}},ra.getItemBoundingClientRect=function(e){if(t=this.canvas()){for(var t,r=t.getBoundingClientRect(),n=this._origin,i=e.bounds,a=i.x1+n[0]+r.left,o=i.y1+n[1]+r.top,s=i.width(),u=i.height();e.mark&&(e=e.mark.group);)a+=e.x||0,o+=e.y||0;return{x:a,y:o,width:s,height:u,left:a,top:o,right:a+s,bottom:o+u}}};var na=Renderer_Renderer.prototype;na.initialize=function(e,t,r,n,i){return this._el=e,this.resize(t,r,n,i)},na.element=function(){return this._el},na.canvas=function(){return this._el&&this._el.firstChild},na.background=function(e){return 0===arguments.length?this._bgcolor:(this._bgcolor=e,this)},na.resize=function(e,t,r,n){return this._width=e,this._height=t,this._origin=r||[0,0],this._scale=n||1,this},na.dirty=function(){},na.render=function(e){var t=this;return t._call=function(){t._render(e)},t._call(),t._call=null,t},na._render=function(){},na.renderAsync=function(e){var t=this.render(e);return this._ready?this._ready.then((function(){return t})):Promise.resolve(t)},na._load=function(e,t){var r=this,n=r._loader[e](t);if(!r._ready){var i=r._call;r._ready=r._loader.ready().then((function(e){e&&i(),r._ready=null}))}return n},na.sanitizeURL=function(e){return this._load("sanitizeURL",e)},na.loadImage=function(e){return this._load("loadImage",e)};var ia="mouseout";function CanvasHandler(e,t){Handler_Handler.call(this,e,t),this._down=null,this._touch=null,this._first=!0}var aa=Object(V.y)(CanvasHandler,Handler_Handler);function move(e,t,r){return function(n){var i=this._active,a=this.pickEvent(n);a===i?this.fire(e,n):(i&&i.exit||this.fire(r,n),this._active=a,this.fire(t,n),this.fire(e,n))}}function inactive(e){return function(t){this.fire(e,t),this._active=null}}aa.initialize=function(e,t,r){var n=this._canvas=e&&domFind(e,"canvas");if(n){var i=this;this.events.forEach((function(e){n.addEventListener(e,(function(t){aa[e]?aa[e].call(i,t):i.fire(e,t)}))}))}return Handler_Handler.prototype.initialize.call(this,e,t,r)},aa.canvas=function(){return this._canvas},aa.context=function(){return this._canvas.getContext("2d")},aa.events=["keydown","keypress","keyup","dragenter","dragleave","dragover","mousedown","mouseup","mousemove","mouseout","mouseover","click","dblclick","wheel","mousewheel","touchstart","touchmove","touchend"],aa.DOMMouseScroll=function(e){this.fire("mousewheel",e)},aa.mousemove=move("mousemove","mouseover","mouseout"),aa.dragover=move("dragover","dragenter","dragleave"),aa.mouseout=inactive("mouseout"),aa.dragleave=inactive("dragleave"),aa.mousedown=function(e){this._down=this._active,this.fire("mousedown",e)},aa.click=function(e){this._down===this._active&&(this.fire("click",e),this._down=null)},aa.touchstart=function(e){this._touch=this.pickEvent(e.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire("touchstart",e,!0)},aa.touchmove=function(e){this.fire("touchmove",e,!0)},aa.touchend=function(e){this.fire("touchend",e,!0),this._touch=null},aa.fire=function(e,t,r){var n,i,a=r?this._touch:this._active,o=this._handlers[e];if(t.vegaType=e,"click"===e&&a&&a.href?this.handleHref(t,a,a.href):"mousemove"!==e&&e!==ia||this.handleTooltip(t,a,e!==ia),o)for(n=0,i=o.length;n<i;++n)o[n].handler.call(this._obj,t,a)},aa.on=function(e,t){var r=this.eventName(e),n=this._handlers;return this._handlerIndex(n[r],e,t)<0&&(n[r]||(n[r]=[])).push({type:e,handler:t}),this},aa.off=function(e,t){var r=this.eventName(e),n=this._handlers[r],i=this._handlerIndex(n,e,t);return i>=0&&n.splice(i,1),this},aa.pickEvent=function(e){var t=ta(e,this._canvas),r=this._origin;return this.pick(this._scene,t[0],t[1],t[0]-r[0],t[1]-r[1])},aa.pick=function(e,t,r,n,i){var a=this.context();return Xi[e.marktype].pick.call(this,a,e,t,r,n,i)};var oa=function devicePixelRatio(){return"undefined"!==typeof window&&window.devicePixelRatio||1}();function CanvasRenderer(e){Renderer_Renderer.call(this,e),this._redraw=!1,this._dirty=new Bounds}var sa=Object(V.y)(CanvasRenderer,Renderer_Renderer),ua=Renderer_Renderer.prototype,la=new Bounds;function SVGHandler(e,t){Handler_Handler.call(this,e,t);var r=this;r._hrefHandler=listener(r,(function(e,t){t&&t.href&&r.handleHref(e,t,t.href)})),r._tooltipHandler=listener(r,(function(e,t){r.handleTooltip(e,t,e.type!==ia)}))}sa.initialize=function(e,t,r,n,i,a){return this._options=a,this._canvas=domCanvas(1,1,a&&a.type),e&&(domClear(e,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),ua.initialize.call(this,e,t,r,n,i)},sa.resize=function(e,t,r,n){return ua.resize.call(this,e,t,r,n),function(e,t,r,n,i,a){var o,s="undefined"!==typeof HTMLElement&&e instanceof HTMLElement&&null!=e.parentNode,u=e.getContext("2d"),l=s?oa:i;for(o in e.width=t*l,e.height=r*l,a)u[o]=a[o];s&&1!==l&&(e.style.width=t+"px",e.style.height=r+"px"),u.pixelRatio=l,u.setTransform(l,0,0,l,l*n[0],l*n[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options&&this._options.context),this._redraw=!0,this},sa.canvas=function(){return this._canvas},sa.context=function(){return this._canvas?this._canvas.getContext("2d"):null},sa.dirty=function(e){var t=function CanvasRenderer_translate(e,t){if(null==t)return e;for(var r=la.clear().union(e);null!=t;t=t.mark.group)r.translate(t.x||0,t.y||0);return r}(e.bounds,e.mark.group);this._dirty.union(t)},sa._render=function(e){var t=this.context(),r=this._origin,n=this._width,i=this._height,a=this._dirty;return t.save(),this._redraw||a.empty()?(this._redraw=!1,a=null):a=function clipToBounds(e,t,r){return t.expand(1).round(),t.translate(-r[0]%1,-r[1]%1),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}(t,a,r),this.clear(-r[0],-r[1],n,i),this.draw(t,e,a),t.restore(),this._dirty.clear(),this},sa.draw=function(e,t,r){var n=Xi[t.marktype];t.clip&&function(e,t){var r=t.clip;if(e.save(),e.beginPath(),Object(V.D)(r))r(e);else{var n=t.group;e.rect(0,0,n.width||0,n.height||0)}e.clip()}(e,t),n.draw.call(this,e,t,r),t.clip&&e.restore()},sa.clear=function(e,t,r,n){var i=this.context();i.clearRect(e,t,r,n),null!=this._bgcolor&&(i.fillStyle=this._bgcolor,i.fillRect(e,t,r,n))};var ca=Object(V.y)(SVGHandler,Handler_Handler);function listener(e,t){return function(r){var n=r.target.__data__;r.vegaType=r.type,n=Array.isArray(n)?n[0]:n,t.call(e._obj,r,n)}}function openTag(e,t,r){var n,i,a="<"+e;if(t)for(n in t)null!=(i=t[n])&&(a+=" "+n+'="'+i+'"');return r&&(a+=" "+r),a+">"}function closeTag(e){return"</"+e+">"}ca.initialize=function(e,t,r){var n=this._svg;return n&&(n.removeEventListener("click",this._hrefHandler),n.removeEventListener("mousemove",this._tooltipHandler),n.removeEventListener(ia,this._tooltipHandler)),this._svg=n=e&&domFind(e,"svg"),n&&(n.addEventListener("click",this._hrefHandler),n.addEventListener("mousemove",this._tooltipHandler),n.addEventListener(ia,this._tooltipHandler)),Handler_Handler.prototype.initialize.call(this,e,t,r)},ca.canvas=function(){return this._svg},ca.on=function(e,t){var r=this.eventName(e),n=this._handlers;if(this._handlerIndex(n[r],e,t)<0){var i={type:e,handler:t,listener:listener(this,t)};(n[r]||(n[r]=[])).push(i),this._svg&&this._svg.addEventListener(r,i.listener)}return this},ca.off=function(e,t){var r=this.eventName(e),n=this._handlers[r],i=this._handlerIndex(n,e,t);return i>=0&&(this._svg&&this._svg.removeEventListener(r,n[i].listener),n.splice(i,1)),this};var fa={version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},da={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",strokeCap:"stroke-linecap",strokeJoin:"stroke-linejoin",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeMiterLimit:"stroke-miterlimit",opacity:"opacity"},ha=Object.keys(da),pa=fa.xmlns;function SVGRenderer(e){Renderer_Renderer.call(this,e),this._dirtyID=1,this._dirty=[],this._svg=null,this._root=null,this._defs=null}var ga=Object(V.y)(SVGRenderer,Renderer_Renderer),ma=Renderer_Renderer.prototype;function updateGradient(e,t,r){var n,i,a;if("radial"===t.gradient){var o=domChild(e,r++,"pattern",pa);o.setAttribute("id",nn+t.id),o.setAttribute("viewBox","0,0,1,1"),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("preserveAspectRatio","xMidYMid slice"),(o=domChild(o,0,"rect",pa)).setAttribute("width","1"),o.setAttribute("height","1"),o.setAttribute("fill","url("+SVGRenderer_href()+"#"+t.id+")"),(e=domChild(e,r++,"radialGradient",pa)).setAttribute("id",t.id),e.setAttribute("fx",t.x1),e.setAttribute("fy",t.y1),e.setAttribute("fr",t.r1),e.setAttribute("cx",t.x2),e.setAttribute("cy",t.y2),e.setAttribute("r",t.r2)}else(e=domChild(e,r++,"linearGradient",pa)).setAttribute("id",t.id),e.setAttribute("x1",t.x1),e.setAttribute("x2",t.x2),e.setAttribute("y1",t.y1),e.setAttribute("y2",t.y2);for(n=0,i=t.stops.length;n<i;++n)(a=domChild(e,n,"stop",pa)).setAttribute("offset",t.stops[n].offset),a.setAttribute("stop-color",t.stops[n].color);return domClear(e,n),r}function updateClipping(e,t,r){var n;return(e=domChild(e,r,"clipPath",pa)).setAttribute("id",t.id),t.path?(n=domChild(e,0,"path",pa)).setAttribute("d",t.path):((n=domChild(e,0,"rect",pa)).setAttribute("x",0),n.setAttribute("y",0),n.setAttribute("width",t.width),n.setAttribute("height",t.height)),r+1}function dirtyParents(e,t){for(;e&&e.dirty!==t;e=e.mark.group){if(e.dirty=t,!e.mark||e.mark.dirty===t)return;e.mark.dirty=t}}function SVGRenderer_bind(e,t,r,n,i){var a,o=e._svg;if(!o&&(o=domCreate(a=t.ownerDocument,n,pa),e._svg=o,e.mark&&(o.__data__=e,o.__values__={fill:"default"},"g"===n))){var s=domCreate(a,"path",pa);s.setAttribute("class","background"),o.appendChild(s),s.__data__=e;var u=domCreate(a,"g",pa);o.appendChild(u),u.__data__=e}return(o.ownerSVGElement!==i||function hasSiblings(e){var t=e.mark||e.group;return t&&t.items.length>1}(e)&&o.previousSibling!==r)&&t.insertBefore(o,r?r.nextSibling:t.firstChild),o}ga.initialize=function(e,t,r,n){return e&&(this._svg=domChild(e,0,"svg",pa),this._svg.setAttribute("class","marks"),domClear(e,1),this._root=domChild(this._svg,0,"g",pa),domClear(this._svg,1)),this._defs={gradient:{},clipping:{}},this.background(this._bgcolor),ma.initialize.call(this,e,t,r,n)},ga.background=function(e){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",e),ma.background.apply(this,arguments)},ga.resize=function(e,t,r,n){return ma.resize.call(this,e,t,r,n),this._svg&&(this._svg.setAttribute("width",this._width*this._scale),this._svg.setAttribute("height",this._height*this._scale),this._svg.setAttribute("viewBox","0 0 "+this._width+" "+this._height),this._root.setAttribute("transform","translate("+this._origin+")")),this._dirty=[],this},ga.canvas=function(){return this._svg},ga.svg=function(){if(!this._svg)return null;var e={class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 "+this._width+" "+this._height};for(var t in fa)e[t]=fa[t];var r=this._bgcolor?openTag("rect",{width:this._width,height:this._height,style:"fill: "+this._bgcolor+";"})+closeTag("rect"):"";return openTag("svg",e)+r+this._svg.innerHTML+closeTag("svg")},ga._render=function(e){return this._dirtyCheck()&&(this._dirtyAll&&this._resetDefs(),this.draw(this._root,e),domClear(this._root,1)),this.updateDefs(),this._dirty=[],++this._dirtyID,this},ga.updateDefs=function(){var e,t=this._svg,r=this._defs,n=r.el,i=0;for(e in r.gradient)n||(r.el=n=domChild(t,0,"defs",pa)),i=updateGradient(n,r.gradient[e],i);for(e in r.clipping)n||(r.el=n=domChild(t,0,"defs",pa)),i=updateClipping(n,r.clipping[e],i);n&&(0===i?(t.removeChild(n),r.el=null):domClear(n,i))},ga._resetDefs=function(){var e=this._defs;e.gradient={},e.clipping={}},ga.dirty=function(e){e.dirty!==this._dirtyID&&(e.dirty=this._dirtyID,this._dirty.push(e))},ga.isDirty=function(e){return this._dirtyAll||!e._svg||e.dirty===this._dirtyID},ga._dirtyCheck=function(){this._dirtyAll=!0;var e=this._dirty;if(!e.length)return!0;var t,r,n,i,a,o,s,u=++this._dirtyID;for(a=0,o=e.length;a<o;++a)(r=(t=e[a]).mark).marktype!==n&&(n=r.marktype,i=Xi[n]),r.zdirty&&r.dirty!==u&&(this._dirtyAll=!1,dirtyParents(t,u),r.items.forEach((function(e){e.dirty=u}))),r.zdirty||(t.exit?(i.nested&&r.items.length?(s=r.items[0])._svg&&this._update(i,s._svg,s):t._svg&&(s=t._svg.parentNode)&&s.removeChild(t._svg),t._svg=null):(t=i.nested?r.items[0]:t)._update!==u&&(t._svg&&t._svg.ownerSVGElement?this._update(i,t._svg,t):(this._dirtyAll=!1,dirtyParents(t,u)),t._update=u));return!this._dirtyAll},ga.draw=function(e,t,r){if(!this.isDirty(t))return t._svg;var n,i=this,a=this._svg,o=Xi[t.marktype],s=!1===t.interactive?"none":null,u="g"===o.tag,l=null,c=0;function process(e){var t=i.isDirty(e),r=SVGRenderer_bind(e,n,l,o.tag,a);t&&(i._update(o,r,e),u&&function SVGRenderer_recurse(e,t,r){t=t.lastChild;var n,i=0;visit_visit(r,(function(r){n=e.draw(t,r,n),++i})),domClear(t,1+i)}(i,r,e)),l=r,++c}return(n=SVGRenderer_bind(t,e,r,"g",a)).setAttribute("class",cssClass(t)),u||n.style.setProperty("pointer-events",s),t.clip?n.setAttribute("clip-path",Mi(i,t,t.group)):n.removeAttribute("clip-path"),o.nested?t.items.length&&process(t.items[0]):visit_visit(t,process),domClear(n,c),n};var va=null,ya=null,_a={group:function group(e,t,r){ya=t.__values__,va=t.childNodes[1],e.foreground(SVGRenderer_emit,r,this),va=t.childNodes[0],e.background(SVGRenderer_emit,r,this);var n=!1===r.mark.interactive?"none":null;n!==ya.events&&(va.style.setProperty("pointer-events",n),ya.events=n)},text:function text(e,t,r){var n;(n=textValue(r))!==ya.text&&(t.textContent=n,ya.text=n),setStyle(t,"font-family",fontFamily(r)),setStyle(t,"font-size",text_fontSize(r)+"px"),setStyle(t,"font-style",r.fontStyle),setStyle(t,"font-variant",r.fontVariant),setStyle(t,"font-weight",r.fontWeight)}};function setStyle(e,t,r){r!==ya[t]&&(null==r?e.style.removeProperty(t):e.style.setProperty(t,r+""),ya[t]=r)}function SVGRenderer_emit(e,t,r){t!==ya[e]&&(null!=t?r?va.setAttributeNS(r,e,t):va.setAttribute(e,t):r?va.removeAttributeNS(r,e):va.removeAttribute(e),ya[e]=t)}function SVGRenderer_href(){var e;return"undefined"===typeof window?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}function SVGStringRenderer(e){Renderer_Renderer.call(this,e),this._text={head:"",bg:"",root:"",foot:"",defs:"",body:""},this._defs={gradient:{},clipping:{}}}ga._update=function(e,t,r){va=t,ya=t.__values__,e.attr(SVGRenderer_emit,r,this);var n=_a[e.type];n&&n.call(this,e,t,r),this.style(va,r)},ga.style=function(e,t){var r,n,i,a,o;if(null!=t)for(r=0,n=ha.length;r<n;++r)o=t[i=ha[r]],"font"===i&&(o=fontFamily(t)),o!==ya[i]&&(a=da[i],null==o?"fill"===a?e.style.setProperty(a,"none"):e.style.removeProperty(a):(isGradient(o)&&(o=gradientRef(o,this._defs.gradient,SVGRenderer_href())),e.style.setProperty(a,o+"")),ya[i]=o)};var ba,xa=Object(V.y)(SVGStringRenderer,Renderer_Renderer),wa=Renderer_Renderer.prototype;function SVGStringRenderer_emit(e,t,r,n){ba[n||e]=t}function applyStyles(e,t,r,n){if(null==e)return"";var i,a,o,s,u,l="";for("bgrect"===r&&!1===t.interactive&&(l+="pointer-events: none; "),"text"===r&&(l+="font-family: "+fontFamily(e)+"; ",l+="font-size: "+text_fontSize(e)+"px; ",e.fontStyle&&(l+="font-style: "+e.fontStyle+"; "),e.fontVariant&&(l+="font-variant: "+e.fontVariant+"; "),e.fontWeight&&(l+="font-weight: "+e.fontWeight+"; ")),i=0,a=ha.length;i<a;++i)o=ha[i],s=da[o],null==(u=e[o])?"fill"===s&&(l+="fill: none; "):"transparent"!==u||"fill"!==s&&"stroke"!==s?(isGradient(u)&&(u=gradientRef(u,n.gradient,"")),l+=s+": "+u+"; "):l+=s+": none; ";return l?'style="'+l.trim()+'"':null}xa.resize=function(e,t,r,n){wa.resize.call(this,e,t,r,n);var i=this._origin,a=this._text,o={class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 "+this._width+" "+this._height};for(var s in fa)o[s]=fa[s];a.head=openTag("svg",o);var u=this._bgcolor;return"transparent"!==u&&"none"!==u||(u=null),a.bg=u?openTag("rect",{width:this._width,height:this._height,style:"fill: "+u+";"})+closeTag("rect"):"",a.root=openTag("g",{transform:"translate("+i+")"}),a.foot=closeTag("g")+closeTag("svg"),this},xa.background=function(){var e=wa.background.apply(this,arguments);return arguments.length&&this._text.head&&this.resize(this._width,this._height,this._origin,this._scale),e},xa.svg=function(){var e=this._text;return e.head+e.bg+e.defs+e.root+e.body+e.foot},xa._render=function(e){return this._text.body=this.mark(e),this._text.defs=this.buildDefs(),this},xa.buildDefs=function(){var e,t,r,n,i,a=this._defs,o="";for(t in a.gradient){for(i=(r=a.gradient[t]).stops,"radial"===r.gradient?(o+=openTag(n="pattern",{id:nn+t,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),o+=openTag("rect",{width:"1",height:"1",fill:"url(#"+t+")"})+closeTag("rect"),o+=closeTag(n),o+=openTag(n="radialGradient",{id:t,fx:r.x1,fy:r.y1,fr:r.r1,cx:r.x2,cy:r.y2,r:r.r2})):o+=openTag(n="linearGradient",{id:t,x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2}),e=0;e<i.length;++e)o+=openTag("stop",{offset:i[e].offset,"stop-color":i[e].color})+closeTag("stop");o+=closeTag(n)}for(t in a.clipping)r=a.clipping[t],o+=openTag("clipPath",{id:t}),r.path?o+=openTag("path",{d:r.path})+closeTag("path"):o+=openTag("rect",{x:0,y:0,width:r.width,height:r.height})+closeTag("rect"),o+=closeTag("clipPath");return o.length>0?openTag("defs")+o+closeTag("defs"):""},xa.attributes=function(e,t){return ba={},e(SVGStringRenderer_emit,t,this),ba},xa.href=function(e){var t,r=this,n=e.href;if(n){if(t=r._hrefs&&r._hrefs[n])return t;r.sanitizeURL(n).then((function(e){e["xlink:href"]=e.href,e.href=null,(r._hrefs||(r._hrefs={}))[n]=e}))}return null},xa.mark=function(e){var t,r=this,n=Xi[e.marktype],i=n.tag,a=this._defs,o="";function process(s){var u=r.href(s);u&&(o+=openTag("a",u)),t="g"!==i?applyStyles(s,e,i,a):null,o+=openTag(i,r.attributes(n.attr,s),t),"text"===i?o+=function escape_text(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}(textValue(s)):"g"===i&&(o+=openTag("path",r.attributes(n.background,s),applyStyles(s,e,"bgrect",a))+closeTag("path"),o+=openTag("g",r.attributes(n.foreground,s))+r.markGroup(s)+closeTag("g")),o+=closeTag(i),u&&(o+=closeTag("a"))}return"g"!==i&&!1===e.interactive&&(t='style="pointer-events: none;"'),o+=openTag("g",{class:cssClass(e),"clip-path":e.clip?Mi(r,e,e.group):null},t),n.nested?e.items&&e.items.length&&process(e.items[0]):visit_visit(e,process),o+closeTag("g")},xa.markGroup=function(e){var t=this,r="";return visit_visit(e,(function(e){r+=t.mark(e)})),r};var ka={};ka.canvas=ka.png={renderer:CanvasRenderer,headless:CanvasRenderer,handler:CanvasHandler},ka.svg={renderer:SVGRenderer,headless:SVGStringRenderer,handler:SVGHandler},ka.none={};var Sa=new Bounds;function Bound(e){Transform.call(this,null,e)}function Bound_boundItem(e,t,r){return t(e.bounds.clear(),e,r)}Object(V.y)(Bound,Transform).transform=function(e,t){var r,n=t.dataflow,i=e.mark,a=i.marktype,o=Xi[a],s=o.bound,u=i.bounds;return o.nested?(i.items.length&&n.dirty(i.items[0]),u=Bound_boundItem(i,s),i.items.forEach((function(e){e.bounds.clear().union(u)}))):a===Dr||e.modified()?(t.visit(t.MOD,(function(e){n.dirty(e)})),u.clear(),i.items.forEach((function(e){u.union(Bound_boundItem(e,s))})),i.role===Ir&&t.reflow()):(r=t.changed(t.REM),t.visit(t.ADD,(function(e){u.union(Bound_boundItem(e,s))})),t.visit(t.MOD,(function(e){r=r||u.alignsWith(e.bounds),n.dirty(e),u.union(Bound_boundItem(e,s))})),r&&(u.clear(),i.items.forEach((function(e){u.union(e.bounds)})))),function(e){var t=e.clip;if(Object(V.D)(t))t(boundContext_context(Sa.clear()));else{if(!t)return;Sa.set(0,0,e.group.width,e.group.height)}e.bounds.intersect(Sa)}(i),t.modifies("bounds")};var Ea=":vega_identifier:";function Identifier_Identifier(e){Transform.call(this,0,e)}function Mark(e){Transform.call(this,null,e)}function Overlap(e){Transform.call(this,null,e)}Identifier_Identifier.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},Object(V.y)(Identifier_Identifier,Transform).transform=function(e,t){var r=function getCounter(e){var t=e._signals[Ea];t||(e._signals[Ea]=t=e.add(0));return t}(t.dataflow),n=r.value,i=e.as;return t.visit(t.ADD,(function(e){e[i]||(e[i]=++n)})),r.set(this.value=n),t},Object(V.y)(Mark,Transform).transform=function(e,t){var r=this.value;r||((r=t.dataflow.scenegraph().mark(e.markdef,function Mark_lookup(e){var t=e.groups,r=e.parent;return t&&1===t.size?t.get(Object.keys(t.object)[0]):t&&r?t.lookup(r):null}(e),e.index)).group.context=e.context,e.context.group||(e.context.group=r.group),r.source=this.source,r.clip=e.clip,r.interactive=e.interactive,this.value=r);var n=r.marktype===Dr?GroupItem:Item;return t.visit(t.ADD,(function(e){n.call(e,r)})),(e.modified("clip")||e.modified("interactive"))&&(r.clip=e.clip,r.interactive=!!e.interactive,r.zdirty=!0,t.reflow()),r.items=t.source,t};var Ca=Object(V.y)(Overlap,Transform),Ta={parity:function parity(e){return e.filter((function(e,t){return t%2?e.opacity=0:1}))},greedy:function greedy(e,t){var r;return e.filter((function(e,n){return n&&Overlap_intersect(r.bounds,e.bounds,t)?e.opacity=0:(r=e,1)}))}};function Overlap_intersect(e,t,r){return r>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2)}function hasOverlap(e,t){for(var r,n=1,i=e.length,a=e[0].bounds;n<i;a=r,++n)if(Overlap_intersect(a,r=e[n].bounds,t))return!0}function hasBounds(e){var t=e.bounds;return t.width()>1&&t.height()>1}function Overlap_reset(e){return e.forEach((function(e){return e.opacity=1})),e}function reflow(e,t){return e.reflow(t.modified()).modifies("opacity")}function Render(e){Transform.call(this,null,e)}Ca.transform=function(e,t){var r,n,i,a=Ta[e.method]||Ta.parity,o=t.materialize(t.SOURCE).source,s=e.separation||0;if(o&&o.length){if(!e.method)return e.modified("method")&&(Overlap_reset(o),t=reflow(t,e)),t;if(e.sort&&(o=o.slice().sort(e.sort)),r=Overlap_reset(o=o.filter(hasBounds)),t=reflow(t,e),r.length>=3&&hasOverlap(r,s)){do{r=a(r,s)}while(r.length>=3&&hasOverlap(r,s));r.length<3&&!Object(V.S)(o).opacity&&(r.length>1&&(Object(V.S)(r).opacity=0),Object(V.S)(o).opacity=1)}return e.boundScale&&e.boundTolerance>=0&&(n=function boundTest(e,t,r){var n=e.range(),i=new Bounds;return t===yr||t===xr?i.set(n[0],-1/0,n[1],1/0):i.set(-1/0,n[0],1/0,n[1]),i.expand(r||1),function(e){return i.encloses(e.bounds)}}(e.boundScale,e.boundOrient,+e.boundTolerance),o.forEach((function(e){n(e)||(e.opacity=0)}))),i=r[0].mark.bounds.clear(),o.forEach((function(e){e.opacity&&i.union(e.bounds)})),t}},Object(V.y)(Render,Transform).transform=function(e,t){var r=t.dataflow;if(t.visit(t.ALL,(function(e){r.dirty(e)})),t.fields&&t.fields.zindex){var n=t.source&&t.source[0];n&&(n.mark.zdirty=!0)}};var Oa=new Bounds;function util_set(e,t,r){return e[t]===r?0:(e[t]=r,1)}var Aa=.5;function isYAxis(e){var t=e.items[0].datum.orient;return t===_r||t===br}function axisLayout(e,t,r,n){var i,a,o=t.items[0],s=o.datum,u=s.orient,l=function axisIndices(e){var t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}(s),c=o.range,f=o.offset,d=o.position,h=o.minExtent,p=o.maxExtent,g=s.title&&o.items[l[2]].items[0],m=o.titlePadding,v=o.bounds,y=0,_=0;switch(Oa.clear().union(v),v.clear(),(i=l[0])>-1&&v.union(o.items[i].bounds),(i=l[1])>-1&&v.union(o.items[i].bounds),u){case yr:y=d||0,_=-f,a=Math.max(h,Math.min(p,-v.y1)),g&&(a=axisTitleLayout(g,a,m,0,-1,v)),v.add(0,-a).add(c,0);break;case _r:y=-f,_=d||0,a=Math.max(h,Math.min(p,-v.x1)),g&&(a=axisTitleLayout(g,a,m,1,-1,v)),v.add(-a,0).add(0,c);break;case br:y=r+f,_=d||0,a=Math.max(h,Math.min(p,v.x2)),g&&(a=axisTitleLayout(g,a,m,1,1,v)),v.add(0,0).add(a,c);break;case xr:y=d||0,_=n+f,a=Math.max(h,Math.min(p,v.y2)),g&&(a=axisTitleLayout(g,a,m,0,1,v)),v.add(0,0).add(c,a);break;default:y=o.x,_=o.y}return xi(v.translate(y,_),o),util_set(o,"x",y+Aa)|util_set(o,"y",_+Aa)&&(o.bounds=Oa,e.dirty(o),o.bounds=v,e.dirty(o)),o.mark.bounds.clear().union(v)}function axisTitleLayout(e,t,r,n,i,a){var o=e.bounds,s=0,u=0;return e.auto?(t+=r,n?s=(e.x||0)-(e.x=i*t):u=(e.y||0)-(e.y=i*t),o.translate(-s,-u),e.mark.bounds.set(o.x1,o.y1,o.x2,o.y2),n?(a.add(0,o.y1).add(0,o.y2),t+=o.width()):(a.add(o.x1,0).add(o.x2,0),t+=o.height())):a.union(o),t}var Ra=r(5);function bboxFlush(e){return(new Bounds).set(0,0,e.width||0,e.height||0)}function bboxFull(e){var t=e.bounds.clone();return t.empty()?t.set(0,0,0,0):t.translate(-(e.x||0),-(e.y||0))}function grid_get(e,t,r){var n=Object(V.F)(e)?e[t]:e;return null!=n?n:void 0!==r?r:0}function offsetValue(e){return e<0?Math.ceil(-e):0}function gridLayout(e,t,r){var n,i,a,o,s,u,l,c,f,d,h,p=!r.nodirty,g=r.bounds===Qr?bboxFlush:bboxFull,m=Oa.set(0,0,0,0),v=grid_get(r.align,Zr),y=grid_get(r.align,en),_=grid_get(r.padding,Zr),b=grid_get(r.padding,en),x=r.columns||t.length,w=x<0?1:Math.ceil(t.length/x),k=t.length,S=Array(k),E=Array(x),C=0,T=Array(k),O=Array(w),A=0,R=Array(k),D=Array(k),P=Array(k);for(i=0;i<x;++i)E[i]=0;for(i=0;i<w;++i)O[i]=0;for(i=0;i<k;++i)u=t[i],s=P[i]=g(u),u.x=u.x||0,R[i]=0,u.y=u.y||0,D[i]=0,a=i%x,o=~~(i/x),C=Math.max(C,l=Math.ceil(s.x2)),A=Math.max(A,c=Math.ceil(s.y2)),E[a]=Math.max(E[a],l),O[o]=Math.max(O[o],c),S[i]=_+offsetValue(s.x1),T[i]=b+offsetValue(s.y1),p&&e.dirty(t[i]);for(i=0;i<k;++i)i%x===0&&(S[i]=0),i<x&&(T[i]=0);if(v===Jr)for(a=1;a<x;++a){for(h=0,i=a;i<k;i+=x)h<S[i]&&(h=S[i]);for(i=a;i<k;i+=x)S[i]=h+E[a-1]}else if(v===Kr){for(h=0,i=0;i<k;++i)i%x&&h<S[i]&&(h=S[i]);for(i=0;i<k;++i)i%x&&(S[i]=h+C)}else for(v=!1,a=1;a<x;++a)for(i=a;i<k;i+=x)S[i]+=E[a-1];if(y===Jr)for(o=1;o<w;++o){for(h=0,n=(i=o*x)+x;i<n;++i)h<T[i]&&(h=T[i]);for(i=o*x;i<n;++i)T[i]=h+O[o-1]}else if(y===Kr){for(h=0,i=x;i<k;++i)h<T[i]&&(h=T[i]);for(i=x;i<k;++i)T[i]=h+A}else for(y=!1,o=1;o<w;++o)for(n=(i=o*x)+x;i<n;++i)T[i]+=O[o-1];for(f=0,i=0;i<k;++i)f=S[i]+(i%x?f:0),R[i]+=f-t[i].x;for(a=0;a<x;++a)for(d=0,i=a;i<k;i+=x)d+=T[i],D[i]+=d-t[i].y;if(v&&grid_get(r.center,Zr)&&w>1)for(i=0;i<k;++i)(f=(s=v===Kr?C:E[i%x])-P[i].x2-t[i].x-R[i])>0&&(R[i]+=f/2);if(y&&grid_get(r.center,en)&&1!==x)for(i=0;i<k;++i)(d=(s=y===Kr?A:O[~~(i/x)])-P[i].y2-t[i].y-D[i])>0&&(D[i]+=d/2);for(i=0;i<k;++i)m.union(P[i].translate(R[i],D[i]));switch(f=grid_get(r.anchor,Ar),d=grid_get(r.anchor,Rr),grid_get(r.anchor,Zr)){case Or:f-=m.width();break;case Tr:f-=m.width()/2}switch(grid_get(r.anchor,en)){case Or:d-=m.height();break;case Tr:d-=m.height()/2}for(f=Math.round(f),d=Math.round(d),m.clear(),i=0;i<k;++i)t[i].mark.bounds.clear();for(i=0;i<k;++i)(u=t[i]).x+=R[i]+=f,u.y+=D[i]+=d,m.union(u.mark.bounds.union(u.bounds.translate(R[i],D[i]))),p&&e.dirty(u);return m}function trellisLayout(e,t,r){var n,i,a,o,s,u,l,c=function gridLayoutGroups(e){for(var t,r,n,i,a,o,s,u=e.items,l=u.length,c=0,f={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};c<l;++c)if(s=(o=u[c]).items,o.marktype===Dr)switch(o.role){case Pr:case Ir:break;case Lr:(t=f.rowheaders).push.apply(t,Object(Ra.a)(s));break;case Nr:(r=f.rowfooters).push.apply(r,Object(Ra.a)(s));break;case Ur:(n=f.colheaders).push.apply(n,Object(Ra.a)(s));break;case zr:(i=f.colfooters).push.apply(i,Object(Ra.a)(s));break;case Br:f.rowtitle=s[0];break;case qr:f.coltitle=s[0];break;default:(a=f.marks).push.apply(a,Object(Ra.a)(s))}return f}(t),f=c.marks,d=r.bounds===Qr?boundFlush:boundFull,h=r.offset,p=r.columns||f.length,g=p<0?1:Math.ceil(f.length/p),m=g*p,v=gridLayout(e,f,r);c.rowheaders&&(u=grid_get(r.headerBand,en,null),n=grid_layoutHeaders(e,c.rowheaders,f,p,g,-grid_get(h,"rowHeader"),grid_min,0,d,"x1",0,p,1,u)),c.colheaders&&(u=grid_get(r.headerBand,Zr,null),i=grid_layoutHeaders(e,c.colheaders,f,p,p,-grid_get(h,"columnHeader"),grid_min,1,d,"y1",0,1,p,u)),c.rowfooters&&(u=grid_get(r.footerBand,en,null),a=grid_layoutHeaders(e,c.rowfooters,f,p,g,grid_get(h,"rowFooter"),grid_max,0,d,"x2",p-1,p,1,u)),c.colfooters&&(u=grid_get(r.footerBand,Zr,null),o=grid_layoutHeaders(e,c.colfooters,f,p,p,grid_get(h,"columnFooter"),grid_max,1,d,"y2",m-p,1,p,u)),c.rowtitle&&(s=grid_get(r.titleAnchor,en),l=grid_get(h,"rowTitle"),l=s===Or?a+l:n-l,u=grid_get(r.titleBand,en,.5),layoutTitle(e,c.rowtitle,l,0,v,u)),c.coltitle&&(s=grid_get(r.titleAnchor,Zr),l=grid_get(h,"columnTitle"),l=s===Or?o+l:i-l,u=grid_get(r.titleBand,Zr,.5),layoutTitle(e,c.coltitle,l,1,v,u))}function boundFlush(e,t){return"x1"===t?e.x||0:"y1"===t?e.y||0:"x2"===t?(e.x||0)+(e.width||0):"y2"===t?(e.y||0)+(e.height||0):void 0}function boundFull(e,t){return e.bounds[t]}function grid_min(e,t){return Math.floor(Math.min(e,t))}function grid_max(e,t){return Math.ceil(Math.max(e,t))}function grid_layoutHeaders(e,t,r,n,i,a,o,s,u,l,c,f,d,h){var p,g,m,v,y,_,b,x,w,k=r.length,S=0,E=0;if(!k)return S;for(p=c;p<k;p+=f)r[p]&&(S=o(S,u(r[p],l)));if(!t.length)return S;for(t.length>i&&(e.warn("Grid headers exceed limit: "+i),t=t.slice(0,i)),S+=a,g=0,v=t.length;g<v;++g)e.dirty(t[g]),t[g].mark.bounds.clear();for(p=c,g=0,v=t.length;g<v;++g,p+=f){for(y=(_=t[g]).mark.bounds,m=p;m>=0&&null==(b=r[m]);m-=d);s?(x=null==h?b.x:Math.round(b.bounds.x1+h*b.bounds.width()),w=S):(x=S,w=null==h?b.y:Math.round(b.bounds.y1+h*b.bounds.height())),y.union(_.bounds.translate(x-(_.x||0),w-(_.y||0))),_.x=x,_.y=w,e.dirty(_),E=o(E,y[l])}return E}function layoutTitle(e,t,r,n,i,a){if(t){e.dirty(t);var o=r,s=r;n?o=Math.round(i.x1+a*i.width()):s=Math.round(i.y1+a*i.height()),t.bounds.translate(o-(t.x||0),s-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=o,t.y=s,e.dirty(t)}}function legendParams(e,t,r,n,i,a,o){var s=function legend_lookup(e,t){var r=e[t]||{};return function(t,n){return null!=r[t]?r[t]:null!=e[t]?e[t]:n}}(r,t),u=function offsets(e,t){var r=-1/0;return e.forEach((function(e){null!=e.offset&&(r=Math.max(r,e.offset))})),r>-1/0?r:t}(e,s("offset",0)),l=s("anchor",Cr),c=l===Or?1:l===Tr?.5:0,f={align:Jr,bounds:s("bounds",Qr),columns:"vertical"===s("direction")?1:e.length,padding:s("margin",8),center:s("center"),nodirty:!0};switch(t){case _r:f.anchor={x:Math.floor(n.x1)-u,column:Or,y:c*(o||n.height()+2*n.y1),row:l};break;case br:f.anchor={x:Math.ceil(n.x2)+u,y:c*(o||n.height()+2*n.y1),row:l};break;case yr:f.anchor={y:Math.floor(i.y1)-u,row:Or,x:c*(a||i.width()+2*i.x1),column:l};break;case xr:f.anchor={y:Math.ceil(i.y2)+u,x:c*(a||i.width()+2*i.x1),column:l};break;case wr:f.anchor={x:u,y:u};break;case kr:f.anchor={x:a-u,y:u,column:Or};break;case Sr:f.anchor={x:u,y:o-u,row:Or};break;case Er:f.anchor={x:a-u,y:o-u,column:Or,row:Or}}return f}function legendLayout(e,t){var r,n,i=t.items[0],a=i.datum,o=i.orient,s=i.bounds,u=i.x,l=i.y;return i._bounds?i._bounds.clear().union(s):i._bounds=s.clone(),s.clear(),function legendGroupLayout(e,t,r){var n=t.padding,i=n-r.x,a=n-r.y;if(t.datum.title){var o=t.items[1].items[0],s=o.anchor,u=t.titlePadding||0,l=n-o.x,c=n-o.y;switch(o.orient){case _r:i+=Math.ceil(o.bounds.width())+u;break;case br:case xr:break;default:a+=o.fontSize+u}switch((i||a)&&legend_translate(e,r,i,a),o.orient){case _r:c+=legendTitleOffset(t,r,o,s,0,1);break;case br:l+=legendTitleOffset(t,r,o,Or,1,0)+u,c+=legendTitleOffset(t,r,o,s,0,1);break;case xr:l+=legendTitleOffset(t,r,o,s,1,0),c+=legendTitleOffset(t,r,o,Or,0,0,1)+u;break;default:l+=legendTitleOffset(t,r,o,s,1,0)}(l||c)&&legend_translate(e,o,l,c),(l=Math.round(o.bounds.x1-n))<0&&(legend_translate(e,r,-l,0),legend_translate(e,o,-l,0))}else(i||a)&&legend_translate(e,r,i,a)}(e,i,i.items[0].items[0]),s=function legendBounds(e,t){return e.items.forEach((function(e){return t.union(e.bounds)})),t.x1=e.padding,t.y1=e.padding,t}(i,s),r=2*i.padding,n=2*i.padding,s.empty()||(r=Math.ceil(s.width()+r),n=Math.ceil(s.height()+n)),a.type===Gr&&function legendEntryLayout(e){var t=e.reduce((function(e,t){return e[t.column]=Math.max(t.bounds.x2-t.x,e[t.column]||0),e}),{});e.forEach((function(e){e.width=t[e.column],e.height=e.bounds.y2-e.y}))}(i.items[0].items[0].items[0].items),o!==Xr&&(i.x=u=0,i.y=l=0),i.width=r,i.height=n,xi(s.set(u,l,u+r,l+n),i),i.mark.bounds.clear().union(s),i}function legendTitleOffset(e,t,r,n,i,a,o){var s="symbol"!==e.datum.type,u=r.datum.vgrad,l=(!s||!a&&u||o?t:t.items[0]).bounds[i?"x2":"y2"]-e.padding,c=u&&a?l:0,f=u&&a?0:l;return Math.round(n===Cr?c:n===Or?f:.5*l)}function legend_translate(e,t,r,n){t.x+=r,t.y+=n,t.bounds.translate(r,n),t.mark.bounds.translate(r,n),e.dirty(t)}function ViewLayout(e){Transform.call(this,null,e)}Object(V.y)(ViewLayout,Transform).transform=function(e,t){var r=t.dataflow;return e.mark.items.forEach((function(t){e.layout&&trellisLayout(r,t,e.layout),function layoutGroup(e,t,r){var n,i,a,o,s,u=t.items,l=Math.max(0,t.width||0),c=Math.max(0,t.height||0),f=(new Bounds).set(0,0,l,c),d=f.clone(),h=f.clone(),p=[];for(o=0,s=u.length;o<s;++o)switch((i=u[o]).role){case Pr:(isYAxis(i)?d:h).union(axisLayout(e,i,l,c));break;case jr:n=i;break;case Ir:p.push(legendLayout(e,i));break;case Mr:case Fr:case Lr:case Nr:case Br:case Ur:case zr:case qr:d.union(i.bounds),h.union(i.bounds);break;default:f.union(i.bounds)}if(p.length){var g={};for(var m in p.forEach((function(e){(a=e.orient||br)!==Xr&&(g[a]||(g[a]=[])).push(e)})),g){var v=g[m];gridLayout(e,v,legendParams(v,m,r.legends,d,h,l,c))}p.forEach((function(t){var n=t.bounds;if(n.equals(t._bounds)||(t.bounds=t._bounds,e.dirty(t),t.bounds=n,e.dirty(t)),r.autosize&&r.autosize.type===Hr)switch(t.orient){case _r:case br:f.add(n.x1,0).add(n.x2,0);break;case yr:case xr:f.add(0,n.y1).add(0,n.y2)}else f.union(n)}))}f.union(d).union(h),n&&f.union(function titleLayout(e,t,r,n,i){var a,o=t.items[0],s=o.frame,u=o.orient,l=o.anchor,c=o.offset,f=o.bounds,d=0,h=u===_r||u===br?n:r,p=0,g=0;switch(s!==Dr?u===_r?(d=i.y2,h=i.y1):u===br?(d=i.y1,h=i.y2):(d=i.x1,h=i.x2):u===_r&&(d=n,h=0),a=l===Cr?d:l===Or?h:(d+h)/2,Oa.clear().union(f),u){case yr:p=a,g=i.y1-c;break;case _r:p=i.x1-c,g=a;break;case br:p=i.x2+c,g=a;break;case xr:p=a,g=i.y2+c;break;default:p=o.x,g=o.y}return f.translate(p-(o.x||0),g-(o.y||0)),util_set(o,"x",p)|util_set(o,"y",g)&&(o.bounds=Oa,e.dirty(o),o.bounds=f,e.dirty(o)),t.bounds.clear().union(f)}(e,n,l,c,f));t.clip&&f.set(0,0,t.width||0,t.height||0);!function viewSizeLayout(e,t,r,n){var i=n.autosize||{},a=i.type,o=e._width,s=e._height,u=e.padding();if(e._autosize<1||!a)return;var l=Math.max(0,t.width||0),c=Math.max(0,Math.ceil(-r.x1)),f=Math.max(0,Math.ceil(r.x2-l)),d=Math.max(0,t.height||0),h=Math.max(0,Math.ceil(-r.y1)),p=Math.max(0,Math.ceil(r.y2-d));i.contains===Wr&&(o-=u.left+u.right,s-=u.top+u.bottom);a===Xr?(c=0,h=0,l=o,d=s):a===Hr?(l=Math.max(0,o-c-f),d=Math.max(0,s-h-p)):a===Vr?(l=Math.max(0,o-c-f),s=d+h+p):a===Yr?(o=l+c+f,d=Math.max(0,s-h-p)):a===$r&&(o=l+c+f,s=d+h+p);e._resizeView(o,s,l,d,[c,h],i.resize)}(e,t,f,r)}(r,t,e)})),e.modified()&&t.reflow(),t};var Da=function(e,t,r){var n=e-t+2*r;return e?n>0?n:1:0},Pa="identity",ja="linear",Ma="log",Fa="pow",Ia="sqrt",La="symlog",Na="time",Ba="utc",Ua="sequential",za="diverging",qa="quantile",Wa="quantize",Ga="threshold",Ha="ordinal",Va="point",Ya="band",$a="bin-ordinal";function isQuantile(e){return e===qa}function isInterpolating(e){return function isSequential(e){return e&&e.startsWith(Ua)}(e)||function isDiverging(e){return e&&e.startsWith(za)}(e)}function isLogarithmic(e){return e===Ma||e.endsWith("-log")}function isContinuous(e){switch(e){case ja:case Ma:case Fa:case Ia:case La:case Na:case Ba:case Ua:return!0}return!1}function isDiscrete(e){return e===$a||e===Ha||e===Ya||e===Va}function isDiscretizing(e){return e===$a||e===qa||e===Wa||e===Ga}var Xa=newInterval((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e}));Xa.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?newInterval((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,r){t.setTime(+t+r*e)}),(function(t,r){return(r-t)/e})):Xa:null};var Ka=Xa,Ja=(Xa.range,newInterval((function(e){e.setTime(e-e.getMilliseconds())}),(function(e,t){e.setTime(+e+1e3*t)}),(function(e,t){return(t-e)/1e3}),(function(e){return e.getUTCSeconds()}))),Qa=Ja,Za=(Ja.range,newInterval((function(e){e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds())}),(function(e,t){e.setTime(+e+t*Re)}),(function(e,t){return(t-e)/Re}),(function(e){return e.getMinutes()}))),eo=Za,to=(Za.range,newInterval((function(e){e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds()-e.getMinutes()*Re)}),(function(e,t){e.setTime(+e+36e5*t)}),(function(e,t){return(t-e)/36e5}),(function(e){return e.getHours()}))),ro=to,no=(to.range,newInterval((function(e){e.setDate(1),e.setHours(0,0,0,0)}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}),(function(e){return e.getMonth()}))),io=no,ao=(no.range,newInterval((function(e){e.setUTCSeconds(0,0)}),(function(e,t){e.setTime(+e+t*Re)}),(function(e,t){return(t-e)/Re}),(function(e){return e.getUTCMinutes()}))),oo=ao,so=(ao.range,newInterval((function(e){e.setUTCMinutes(0,0,0)}),(function(e,t){e.setTime(+e+36e5*t)}),(function(e,t){return(t-e)/36e5}),(function(e){return e.getUTCHours()}))),uo=so,lo=(so.range,newInterval((function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCMonth(e.getUTCMonth()+t)}),(function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())}),(function(e){return e.getUTCMonth()}))),co=lo,fo=(lo.range,{millisecond:Ka,second:Qa,minute:eo,hour:ro,day:Xe,week:ze,month:io,year:Je}),ho={millisecond:Ka,second:Qa,minute:oo,hour:uo,day:Ue,week:Pe,month:co,year:Ze};function timeInterval(e,t){var r=t===Ba?ho:fo;return Object(V.v)(r,e)&&r[e]}var po=r(10),go=function(e){return function(t){var r,n=t[0],i=t[1];return i<n&&(r=n,n=i,i=r),[e.invert(n),e.invert(i)]}},mo=function(e){return function(t){var r,n,i,a,o=e.range(),s=t[0],u=t[1],l=-1;for(u<s&&(n=s,s=u,u=n),i=0,a=o.length;i<a;++i)o[i]>=s&&o[i]<=u&&(l<0&&(l=i),r=i);if(!(l<0))return s=e.invertExtent(o[l]),u=e.invertExtent(o[r]),[void 0===s[0]?s[1]:s[0],void 0===u[1]?u[0]:u[1]]}},vo=mr(St),yo=vo.right,_o=vo.left,bo=yo;function initRange(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function initInterpolator(e,t){switch(arguments.length){case 0:break;case 1:this.interpolator(e);break;default:this.interpolator(t).domain(e)}return this}var xo=Symbol("implicit");function ordinal(){var e=new Map,t=[],r=[],n=xo;function scale(i){var a=i+"",o=e.get(a);if(!o){if(n!==xo)return n;e.set(a,o=t.push(i))}return r[(o-1)%r.length]}return scale.domain=function(r){if(!arguments.length)return t.slice();t=[],e=new Map;var n=!0,i=!1,a=void 0;try{for(var o,s=r[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var u=o.value,l=u+"";e.has(l)||e.set(l,t.push(u))}}catch(c){i=!0,a=c}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return scale},scale.range=function(e){return arguments.length?(r=Array.from(e),scale):r.slice()},scale.unknown=function(e){return arguments.length?(n=e,scale):n},scale.copy=function(){return ordinal(t,r).unknown(n)},initRange.apply(scale,arguments),scale}function scaleBand_band(){var e,t,r=ordinal().unknown(void 0),n=r.domain,i=r.range,a=[0,1],o=!1,s=0,u=0,l=.5;function rescale(){var r=n().length,c=a[1]<a[0],f=a[c-0],d=a[1-c],h=Da(r,s,u);e=(d-f)/(h||1),o&&(e=Math.floor(e)),f+=(d-f-e*(r-s))*l,t=e*(1-s),o&&(f=Math.round(f),t=Math.round(t));var p=dr(r).map((function(t){return f+e*t}));return i(c?p.reverse():p)}return delete r.unknown,r.domain=function(e){return arguments.length?(n(e),rescale()):n()},r.range=function(e){return arguments.length?(a=[+e[0],+e[1]],rescale()):a.slice()},r.rangeRound=function(e){return a=[+e[0],+e[1]],o=!0,rescale()},r.bandwidth=function(){return t},r.step=function(){return e},r.round=function(e){return arguments.length?(o=!!e,rescale()):o},r.padding=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),s=u,rescale()):s},r.paddingInner=function(e){return arguments.length?(s=Math.max(0,Math.min(1,e)),rescale()):s},r.paddingOuter=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),rescale()):u},r.align=function(e){return arguments.length?(l=Math.max(0,Math.min(1,e)),rescale()):l},r.invertRange=function(e){if(null!=e[0]&&null!=e[1]){var r,o,s,u=+e[0],l=+e[1],c=a[1]<a[0],f=c?i().reverse():i(),d=f.length-1;if(u===u&&l===l&&(l<u&&(s=u,u=l,l=s),!(l<f[0]||u>a[1-c])))return r=Math.max(0,yo(f,u)-1),o=u===l?r:yo(f,l)-1,u-f[r]>t+1e-10&&++r,c&&(s=r,r=d-o,o=d-s),r>o?void 0:n().slice(r,o+1)}},r.invert=function(e){var t=r.invertRange([e,e]);return t?t[0]:t},r.copy=function(){return scaleBand_band().domain(n()).range(a).round(o).paddingInner(s).paddingOuter(u).align(l)},rescale()}var wo=Math.sqrt(50),ko=Math.sqrt(10),So=Math.sqrt(2),Eo=function(e,t,r){var n,i,a,o,s=-1;if(r=+r,(e=+e)===(t=+t)&&r>0)return[e];if((n=t<e)&&(i=e,e=t,t=i),0===(o=tickIncrement(e,t,r))||!isFinite(o))return[];if(o>0)for(e=Math.ceil(e/o),t=Math.floor(t/o),a=new Array(i=Math.ceil(t-e+1));++s<i;)a[s]=(e+s)*o;else for(e=Math.floor(e*o),t=Math.ceil(t*o),a=new Array(i=Math.ceil(e-t+1));++s<i;)a[s]=(e-s)/o;return n&&a.reverse(),a};function tickIncrement(e,t,r){var n=(t-e)/Math.max(0,r),i=Math.floor(Math.log(n)/Math.LN10),a=n/Math.pow(10,i);return i>=0?(a>=wo?10:a>=ko?5:a>=So?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=wo?10:a>=ko?5:a>=So?2:1)}function tickStep(e,t,r){var n=Math.abs(t-e)/Math.max(0,r),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),a=n/i;return a>=wo?i*=10:a>=ko?i*=5:a>=So&&(i*=2),t<e?-i:i}var Co=function(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]},To=function(e){return(e=Co(Math.abs(e)))?e[1]:NaN},Oo=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function formatSpecifier(e){if(!(t=Oo.exec(e)))throw new Error("invalid format: "+e);var t;return new FormatSpecifier({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function FormatSpecifier(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}formatSpecifier.prototype=FormatSpecifier.prototype,FormatSpecifier.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Ao,Ro,Do,Po,jo=function(e){e:for(var t,r=e.length,n=1,i=-1;n<r;++n)switch(e[n]){case".":i=t=n;break;case"0":0===i&&(i=n),t=n;break;default:if(i>0){if(!+e[n])break e;i=0}}return i>0?e.slice(0,i)+e.slice(t+1):e},Mo=function(e,t){var r=Co(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")},Fo={"%":function _(e,t){return(100*e).toFixed(t)},b:function b(e){return Math.round(e).toString(2)},c:function c(e){return e+""},d:function d(e){return Math.round(e).toString(10)},e:function e(t,r){return t.toExponential(r)},f:function f(e,t){return e.toFixed(t)},g:function g(e,t){return e.toPrecision(t)},o:function o(e){return Math.round(e).toString(8)},p:function p(e,t){return Mo(100*e,t)},r:Mo,s:function(e,t){var r=Co(e,t);if(!r)return e+"";var n=r[0],i=r[1],a=i-(Ao=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+Co(e,Math.max(0,t+a-1))[0]},X:function X(e){return Math.round(e).toString(16).toUpperCase()},x:function x(e){return Math.round(e).toString(16)}},Io=function(e){return e},Lo=Array.prototype.map,No=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"],Bo=function(e){var t,r,n=void 0===e.grouping||void 0===e.thousands?Io:(t=Lo.call(e.grouping,Number),r=e.thousands+"",function(e,n){for(var i=e.length,a=[],o=0,s=t[0],u=0;i>0&&s>0&&(u+s+1>n&&(s=Math.max(1,n-u)),a.push(e.substring(i-=s,i+s)),!((u+=s+1)>n));)s=t[o=(o+1)%t.length];return a.reverse().join(r)}),i=void 0===e.currency?"":e.currency[0]+"",a=void 0===e.currency?"":e.currency[1]+"",o=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?Io:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(Lo.call(e.numerals,String)),u=void 0===e.percent?"%":e.percent+"",l=void 0===e.minus?"-":e.minus+"",c=void 0===e.nan?"NaN":e.nan+"";function newFormat(e){var t=(e=formatSpecifier(e)).fill,r=e.align,f=e.sign,d=e.symbol,h=e.zero,p=e.width,g=e.comma,m=e.precision,v=e.trim,y=e.type;"n"===y?(g=!0,y="g"):Fo[y]||(void 0===m&&(m=12),v=!0,y="g"),(h||"0"===t&&"="===r)&&(h=!0,t="0",r="=");var _="$"===d?i:"#"===d&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",b="$"===d?a:/[%p]/.test(y)?u:"",x=Fo[y],w=/[defgprs%]/.test(y);function format(e){var i,a,u,d=_,k=b;if("c"===y)k=x(e)+k,e="";else{var S=(e=+e)<0;if(e=isNaN(e)?c:x(Math.abs(e),m),v&&(e=jo(e)),S&&0===+e&&(S=!1),d=(S?"("===f?f:l:"-"===f||"("===f?"":f)+d,k=("s"===y?No[8+Ao/3]:"")+k+(S&&"("===f?")":""),w)for(i=-1,a=e.length;++i<a;)if(48>(u=e.charCodeAt(i))||u>57){k=(46===u?o+e.slice(i+1):e.slice(i))+k,e=e.slice(0,i);break}}g&&!h&&(e=n(e,1/0));var E=d.length+e.length+k.length,C=E<p?new Array(p-E+1).join(t):"";switch(g&&h&&(e=n(C+e,C.length?p-k.length:1/0),C=""),r){case"<":e=d+e+k+C;break;case"=":e=d+C+e+k;break;case"^":e=C.slice(0,E=C.length>>1)+d+e+k+C.slice(E);break;default:e=C+d+e+k}return s(e)}return m=void 0===m?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),format.toString=function(){return e+""},format}return{format:newFormat,formatPrefix:function formatPrefix(e,t){var r=newFormat(((e=formatSpecifier(e)).type="f",e)),n=3*Math.max(-8,Math.min(8,Math.floor(To(t)/3))),i=Math.pow(10,-n),a=No[8+n/3];return function(e){return r(i*e)+a}}}};function defaultLocale_defaultLocale(e){return Ro=Bo(e),Do=Ro.format,Po=Ro.formatPrefix,Ro}defaultLocale_defaultLocale({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});var Uo=function(e,t,r,n){var i,a=tickStep(e,t,r);switch((n=formatSpecifier(null==n?",f":n)).type){case"s":var o=Math.max(Math.abs(e),Math.abs(t));return null!=n.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(To(t)/3)))-To(Math.abs(e)))}(a,o))||(n.precision=i),Po(n,o);case"":case"e":case"g":case"p":case"r":null!=n.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,To(t)-To(e))+1}(a,Math.max(Math.abs(e),Math.abs(t))))||(n.precision=i-("e"===n.type));break;case"f":case"%":null!=n.precision||isNaN(i=function(e){return Math.max(0,-To(Math.abs(e)))}(a))||(n.precision=i-2*("%"===n.type))}return Do(n)},zo=Array.prototype.map;function numbers_numbers(e){return zo.call(e,(function(e){return+e}))}var qo=Array.prototype.slice;var Wo=function(e,t,r){e.prototype=t.prototype=r,r.constructor=e};function extend(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function Color(){}var Go="\\s*([+-]?\\d+)\\s*",Ho="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Vo="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Yo=/^#([0-9a-f]{3,8})$/,$o=new RegExp("^rgb\\("+[Go,Go,Go]+"\\)$"),Xo=new RegExp("^rgb\\("+[Vo,Vo,Vo]+"\\)$"),Ko=new RegExp("^rgba\\("+[Go,Go,Go,Ho]+"\\)$"),Jo=new RegExp("^rgba\\("+[Vo,Vo,Vo,Ho]+"\\)$"),Qo=new RegExp("^hsl\\("+[Ho,Vo,Vo]+"\\)$"),Zo=new RegExp("^hsla\\("+[Ho,Vo,Vo,Ho]+"\\)$"),es={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function color_formatHex(){return this.rgb().formatHex()}function color_formatRgb(){return this.rgb().formatRgb()}function color_color(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=Yo.exec(e))?(r=t[1].length,t=parseInt(t[1],16),6===r?rgbn(t):3===r?new Rgb(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===r?new Rgb(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===r?new Rgb(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=$o.exec(e))?new Rgb(t[1],t[2],t[3],1):(t=Xo.exec(e))?new Rgb(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Ko.exec(e))?rgba(t[1],t[2],t[3],t[4]):(t=Jo.exec(e))?rgba(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Qo.exec(e))?hsla(t[1],t[2]/100,t[3]/100,1):(t=Zo.exec(e))?hsla(t[1],t[2]/100,t[3]/100,t[4]):es.hasOwnProperty(e)?rgbn(es[e]):"transparent"===e?new Rgb(NaN,NaN,NaN,0):null}function rgbn(e){return new Rgb(e>>16&255,e>>8&255,255&e,1)}function rgba(e,t,r,n){return n<=0&&(e=t=r=NaN),new Rgb(e,t,r,n)}function rgbConvert(e){return e instanceof Color||(e=color_color(e)),e?new Rgb((e=e.rgb()).r,e.g,e.b,e.opacity):new Rgb}function color_rgb(e,t,r,n){return 1===arguments.length?rgbConvert(e):new Rgb(e,t,r,null==n?1:n)}function Rgb(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function rgb_formatHex(){return"#"+hex(this.r)+hex(this.g)+hex(this.b)}function rgb_formatRgb(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function hex(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function hsla(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Hsl(e,t,r,n)}function hslConvert(e){if(e instanceof Hsl)return new Hsl(e.h,e.s,e.l,e.opacity);if(e instanceof Color||(e=color_color(e)),!e)return new Hsl;if(e instanceof Hsl)return e;var t=(e=e.rgb()).r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,s=a-i,u=(a+i)/2;return s?(o=t===a?(r-n)/s+6*(r<n):r===a?(n-t)/s+2:(t-r)/s+4,s/=u<.5?a+i:2-a-i,o*=60):s=u>0&&u<1?0:o,new Hsl(o,s,u,e.opacity)}function hsl(e,t,r,n){return 1===arguments.length?hslConvert(e):new Hsl(e,t,r,null==n?1:n)}function Hsl(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function hsl2rgb(e,t,r){return 255*(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)}function basis_basis(e,t,r,n,i){var a=e*e,o=a*e;return((1-3*e+3*a-o)*t+(4-6*a+3*o)*r+(1+3*e+3*a-3*o)*n+o*i)/6}Wo(Color,color_color,{copy:function copy(e){return Object.assign(new this.constructor,this,e)},displayable:function displayable(){return this.rgb().displayable()},hex:color_formatHex,formatHex:color_formatHex,formatHsl:function color_formatHsl(){return hslConvert(this).formatHsl()},formatRgb:color_formatRgb,toString:color_formatRgb}),Wo(Rgb,color_rgb,extend(Color,{brighter:function brighter(e){return e=null==e?1/.7:Math.pow(1/.7,e),new Rgb(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function darker(e){return e=null==e?.7:Math.pow(.7,e),new Rgb(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function rgb(){return this},displayable:function displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:rgb_formatHex,formatHex:rgb_formatHex,formatRgb:rgb_formatRgb,toString:rgb_formatRgb})),Wo(Hsl,hsl,extend(Color,{brighter:function brighter(e){return e=null==e?1/.7:Math.pow(1/.7,e),new Hsl(this.h,this.s,this.l*e,this.opacity)},darker:function darker(e){return e=null==e?.7:Math.pow(.7,e),new Hsl(this.h,this.s,this.l*e,this.opacity)},rgb:function rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Rgb(hsl2rgb(e>=240?e-240:e+120,i,n),hsl2rgb(e,i,n),hsl2rgb(e<120?e+240:e-120,i,n),this.opacity)},displayable:function displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function formatHsl(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var rs=function(e){var t=e.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,t-1):Math.floor(r*t),i=e[n],a=e[n+1],o=n>0?e[n-1]:2*i-a,s=n<t-1?e[n+2]:2*a-i;return basis_basis((r-n/t)*t,o,i,a,s)}},ns=function(e){var t=e.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*t),i=e[(n+t-1)%t],a=e[n%t],o=e[(n+1)%t],s=e[(n+2)%t];return basis_basis((r-n/t)*t,i,a,o,s)}},is=function(e){return function(){return e}};function color_linear(e,t){return function(r){return e+r*t}}function color_hue(e,t){var r=t-e;return r?color_linear(e,r>180||r<-180?r-360*Math.round(r/360):r):is(isNaN(e)?t:e)}function color_gamma(e){return 1===(e=+e)?nogamma:function(t,r){return r-t?function exponential(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}(t,r,e):is(isNaN(t)?r:t)}}function nogamma(e,t){var r=t-e;return r?color_linear(e,r):is(isNaN(e)?t:e)}var as=function rgbGamma(e){var t=color_gamma(e);function rgb(e,r){var n=t((e=color_rgb(e)).r,(r=color_rgb(r)).r),i=t(e.g,r.g),a=t(e.b,r.b),o=nogamma(e.opacity,r.opacity);return function(t){return e.r=n(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+""}}return rgb.gamma=rgbGamma,rgb}(1);function rgbSpline(e){return function(t){var r,n,i=t.length,a=new Array(i),o=new Array(i),s=new Array(i);for(r=0;r<i;++r)n=color_rgb(t[r]),a[r]=n.r||0,o[r]=n.g||0,s[r]=n.b||0;return a=e(a),o=e(o),s=e(s),n.opacity=1,function(e){return n.r=a(e),n.g=o(e),n.b=s(e),n+""}}}var os=rgbSpline(rs),ss=rgbSpline(ns),us=function(e,t){var r,n=t?t.length:0,i=e?Math.min(n,e.length):0,a=new Array(i),o=new Array(n);for(r=0;r<i;++r)a[r]=_s(e[r],t[r]);for(;r<n;++r)o[r]=t[r];return function(e){for(r=0;r<i;++r)o[r]=a[r](e);return o}},ls=function(e,t){var r=new Date;return t-=e=+e,function(n){return r.setTime(e+t*n),r}},cs=function(e,t){return t-=e=+e,function(r){return e+t*r}},fs=function(e,t){var r,n={},i={};for(r in null!==e&&"object"===typeof e||(e={}),null!==t&&"object"===typeof t||(t={}),t)r in e?n[r]=_s(e[r],t[r]):i[r]=t[r];return function(e){for(r in n)i[r]=n[r](e);return i}},ds=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,hs=new RegExp(ds.source,"g");var ps,gs,ms,vs,ys=function(e,t){var r,n,i,a=ds.lastIndex=hs.lastIndex=0,o=-1,s=[],u=[];for(e+="",t+="";(r=ds.exec(e))&&(n=hs.exec(t));)(i=n.index)>a&&(i=t.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,u.push({i:o,x:cs(r,n)})),a=hs.lastIndex;return a<t.length&&(i=t.slice(a),s[o]?s[o]+=i:s[++o]=i),s.length<2?u[0]?function one(e){return function(t){return e(t)+""}}(u[0].x):function string_zero(e){return function(){return e}}(t):(t=u.length,function(e){for(var r,n=0;n<t;++n)s[(r=u[n]).i]=r.x(e);return s.join("")})},_s=function(e,t){var r,n=typeof t;return null==t||"boolean"===n?is(t):("number"===n?cs:"string"===n?(r=color_color(t))?(t=r,as):ys:t instanceof color_color?as:t instanceof Date?ls:Array.isArray(t)?us:"function"!==typeof t.valueOf&&"function"!==typeof t.toString||isNaN(t)?fs:cs)(e,t)},bs=function(e){var t=e.length;return function(r){return e[Math.max(0,Math.min(t-1,Math.floor(r*t)))]}},xs=function(e,t){var r=color_hue(+e,+t);return function(e){var t=r(e);return t-360*Math.floor(t/360)}},ws=function(e,t){return t-=e=+e,function(r){return Math.round(e+t*r)}},ks=180/Math.PI,Ss={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},Es=function(e,t,r,n,i,a){var o,s,u;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(u=e*r+t*n)&&(r-=e*u,n-=t*u),(s=Math.sqrt(r*r+n*n))&&(r/=s,n/=s,u/=s),e*n<t*r&&(e=-e,t=-t,u=-u,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*ks,skewX:Math.atan(u)*ks,scaleX:o,scaleY:s}};function interpolateTransform(e,t,r,n){function pop(e){return e.length?e.pop()+" ":""}return function(i,a){var o=[],s=[];return i=e(i),a=e(a),function translate(e,n,i,a,o,s){if(e!==i||n!==a){var u=o.push("translate(",null,t,null,r);s.push({i:u-4,x:cs(e,i)},{i:u-2,x:cs(n,a)})}else(i||a)&&o.push("translate("+i+t+a+r)}(i.translateX,i.translateY,a.translateX,a.translateY,o,s),function rotate(e,t,r,i){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),i.push({i:r.push(pop(r)+"rotate(",null,n)-2,x:cs(e,t)})):t&&r.push(pop(r)+"rotate("+t+n)}(i.rotate,a.rotate,o,s),function skewX(e,t,r,i){e!==t?i.push({i:r.push(pop(r)+"skewX(",null,n)-2,x:cs(e,t)}):t&&r.push(pop(r)+"skewX("+t+n)}(i.skewX,a.skewX,o,s),function scale(e,t,r,n,i,a){if(e!==r||t!==n){var o=i.push(pop(i)+"scale(",null,",",null,")");a.push({i:o-4,x:cs(e,r)},{i:o-2,x:cs(t,n)})}else 1===r&&1===n||i.push(pop(i)+"scale("+r+","+n+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,o,s),i=a=null,function(e){for(var t,r=-1,n=s.length;++r<n;)o[(t=s[r]).i]=t.x(e);return o.join("")}}}var Cs=interpolateTransform((function parseCss(e){return"none"===e?Ss:(ps||(ps=document.createElement("DIV"),gs=document.documentElement,ms=document.defaultView),ps.style.transform=e,e=ms.getComputedStyle(gs.appendChild(ps),null).getPropertyValue("transform"),gs.removeChild(ps),e=e.slice(7,-1).split(","),Es(+e[0],+e[1],+e[2],+e[3],+e[4],+e[5]))}),"px, ","px)","deg)"),Ts=interpolateTransform((function parseSvg(e){return null==e?Ss:(vs||(vs=document.createElementNS("http://www.w3.org/2000/svg","g")),vs.setAttribute("transform",e),(e=vs.transform.baseVal.consolidate())?(e=e.matrix,Es(e.a,e.b,e.c,e.d,e.e,e.f)):Ss)}),", ",")",")"),Os=Math.SQRT2;function zoom_cosh(e){return((e=Math.exp(e))+1/e)/2}var As=function(e,t){var r,n,a=e[0],o=e[1],s=e[2],u=t[0],l=t[1],c=t[2],f=u-a,d=l-o,h=f*f+d*d;if(h<1e-12)n=Math.log(c/s)/Os,r=function i(e){return[a+e*f,o+e*d,s*Math.exp(Os*e*n)]};else{var p=Math.sqrt(h),g=(c*c-s*s+4*h)/(2*s*2*p),m=(c*c-s*s-4*h)/(2*c*2*p),v=Math.log(Math.sqrt(g*g+1)-g),y=Math.log(Math.sqrt(m*m+1)-m);n=(y-v)/Os,r=function i(e){var t=e*n,r=zoom_cosh(v),u=s/(2*p)*(r*function tanh(e){return((e=Math.exp(2*e))-1)/(e+1)}(Os*t+v)-function zoom_sinh(e){return((e=Math.exp(e))-1/e)/2}(v));return[a+u*f,o+u*d,s*r/zoom_cosh(Os*t+v)]}}return r.duration=1e3*n,r};function hsl_hsl(e){return function(t,r){var n=e((t=hsl(t)).h,(r=hsl(r)).h),i=nogamma(t.s,r.s),a=nogamma(t.l,r.l),o=nogamma(t.opacity,r.opacity);return function(e){return t.h=n(e),t.s=i(e),t.l=a(e),t.opacity=o(e),t+""}}}var Rs=hsl_hsl(color_hue),Ds=hsl_hsl(nogamma),Ps=Math.PI/180,js=180/Math.PI,Ms=.96422,Fs=1,Is=.82521,Ls=4/29,Ns=6/29,Bs=3*Ns*Ns,Us=Ns*Ns*Ns;function labConvert(e){if(e instanceof Lab)return new Lab(e.l,e.a,e.b,e.opacity);if(e instanceof Hcl)return hcl2lab(e);e instanceof Rgb||(e=rgbConvert(e));var t,r,n=rgb2lrgb(e.r),i=rgb2lrgb(e.g),a=rgb2lrgb(e.b),o=xyz2lab((.2225045*n+.7168786*i+.0606169*a)/Fs);return n===i&&i===a?t=r=o:(t=xyz2lab((.4360747*n+.3850649*i+.1430804*a)/Ms),r=xyz2lab((.0139322*n+.0971045*i+.7141733*a)/Is)),new Lab(116*o-16,500*(t-o),200*(o-r),e.opacity)}function lab(e,t,r,n){return 1===arguments.length?labConvert(e):new Lab(e,t,r,null==n?1:n)}function Lab(e,t,r,n){this.l=+e,this.a=+t,this.b=+r,this.opacity=+n}function xyz2lab(e){return e>Us?Math.pow(e,1/3):e/Bs+Ls}function lab2xyz(e){return e>Ns?e*e*e:Bs*(e-Ls)}function lrgb2rgb(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function rgb2lrgb(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function hclConvert(e){if(e instanceof Hcl)return new Hcl(e.h,e.c,e.l,e.opacity);if(e instanceof Lab||(e=labConvert(e)),0===e.a&&0===e.b)return new Hcl(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*js;return new Hcl(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function hcl(e,t,r,n){return 1===arguments.length?hclConvert(e):new Hcl(e,t,r,null==n?1:n)}function Hcl(e,t,r,n){this.h=+e,this.c=+t,this.l=+r,this.opacity=+n}function hcl2lab(e){if(isNaN(e.h))return new Lab(e.l,0,0,e.opacity);var t=e.h*Ps;return new Lab(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}function lab_lab(e,t){var r=nogamma((e=lab(e)).l,(t=lab(t)).l),n=nogamma(e.a,t.a),i=nogamma(e.b,t.b),a=nogamma(e.opacity,t.opacity);return function(t){return e.l=r(t),e.a=n(t),e.b=i(t),e.opacity=a(t),e+""}}function hcl_hcl(e){return function(t,r){var n=e((t=hcl(t)).h,(r=hcl(r)).h),i=nogamma(t.c,r.c),a=nogamma(t.l,r.l),o=nogamma(t.opacity,r.opacity);return function(e){return t.h=n(e),t.c=i(e),t.l=a(e),t.opacity=o(e),t+""}}}Wo(Lab,lab,extend(Color,{brighter:function brighter(e){return new Lab(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker:function darker(e){return new Lab(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb:function rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,r=isNaN(this.b)?e:e-this.b/200;return new Rgb(lrgb2rgb(3.1338561*(t=Ms*lab2xyz(t))-1.6168667*(e=Fs*lab2xyz(e))-.4906146*(r=Is*lab2xyz(r))),lrgb2rgb(-.9787684*t+1.9161415*e+.033454*r),lrgb2rgb(.0719453*t-.2289914*e+1.4052427*r),this.opacity)}})),Wo(Hcl,hcl,extend(Color,{brighter:function brighter(e){return new Hcl(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker:function darker(e){return new Hcl(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb:function rgb(){return hcl2lab(this).rgb()}}));var zs=hcl_hcl(color_hue),qs=hcl_hcl(nogamma),Ws=-.29227,Gs=-.90649,Hs=1.97294,Vs=Hs*Gs,Ys=1.78277*Hs,$s=1.78277*Ws- -.14861*Gs;function cubehelix_cubehelix(e,t,r,n){return 1===arguments.length?function cubehelixConvert(e){if(e instanceof Cubehelix)return new Cubehelix(e.h,e.s,e.l,e.opacity);e instanceof Rgb||(e=rgbConvert(e));var t=e.r/255,r=e.g/255,n=e.b/255,i=($s*n+Vs*t-Ys*r)/($s+Vs-Ys),a=n-i,o=(Hs*(r-i)-Ws*a)/Gs,s=Math.sqrt(o*o+a*a)/(Hs*i*(1-i)),u=s?Math.atan2(o,a)*js-120:NaN;return new Cubehelix(u<0?u+360:u,s,i,e.opacity)}(e):new Cubehelix(e,t,r,null==n?1:n)}function Cubehelix(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function src_cubehelix_cubehelix(e){return function cubehelixGamma(t){function cubehelix(r,n){var i=e((r=cubehelix_cubehelix(r)).h,(n=cubehelix_cubehelix(n)).h),a=nogamma(r.s,n.s),o=nogamma(r.l,n.l),s=nogamma(r.opacity,n.opacity);return function(e){return r.h=i(e),r.s=a(e),r.l=o(Math.pow(e,t)),r.opacity=s(e),r+""}}return t=+t,cubehelix.gamma=cubehelixGamma,cubehelix}(1)}Wo(Cubehelix,cubehelix_cubehelix,extend(Color,{brighter:function brighter(e){return e=null==e?1/.7:Math.pow(1/.7,e),new Cubehelix(this.h,this.s,this.l*e,this.opacity)},darker:function darker(e){return e=null==e?.7:Math.pow(.7,e),new Cubehelix(this.h,this.s,this.l*e,this.opacity)},rgb:function rgb(){var e=isNaN(this.h)?0:(this.h+120)*Ps,t=+this.l,r=isNaN(this.s)?0:this.s*t*(1-t),n=Math.cos(e),i=Math.sin(e);return new Rgb(255*(t+r*(-.14861*n+1.78277*i)),255*(t+r*(Ws*n+Gs*i)),255*(t+r*(Hs*n)),this.opacity)}}));var Xs=src_cubehelix_cubehelix(color_hue),Ks=src_cubehelix_cubehelix(nogamma);function piecewise_piecewise(e,t){for(var r=0,n=t.length-1,i=t[0],a=new Array(n<0?0:n);r<n;)a[r]=e(i,i=t[++r]);return function(e){var t=Math.max(0,Math.min(n-1,Math.floor(e*=n)));return a[t](e-t)}}var Js=function(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e(n/(t-1));return r},Qs=function(e){return function(){return e}},Zs=function(e){return+e},eu=[0,1];function continuous_identity(e){return e}function continuous_normalize(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:Qs(isNaN(t)?NaN:.5)}function bimap(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i<n?(n=continuous_normalize(i,n),a=r(o,a)):(n=continuous_normalize(n,i),a=r(a,o)),function(e){return a(n(e))}}function polymap(e,t,r){var n=Math.min(e.length,t.length)-1,i=new Array(n),a=new Array(n),o=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<n;)i[o]=continuous_normalize(e[o],e[o+1]),a[o]=r(t[o],t[o+1]);return function(t){var r=bo(e,t,1,n)-1;return a[r](i[r](t))}}function continuous_copy(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function transformer(){var e,t,r,n,i,a,o=eu,s=eu,u=_s,l=continuous_identity;function rescale(){var e=Math.min(o.length,s.length);return l!==continuous_identity&&(l=function clamper(e,t){var r;return e>t&&(r=e,e=t,t=r),function(r){return Math.max(e,Math.min(t,r))}}(o[0],o[e-1])),n=e>2?polymap:bimap,i=a=null,scale}function scale(t){return isNaN(t=+t)?r:(i||(i=n(o.map(e),s,u)))(e(l(t)))}return scale.invert=function(r){return l(t((a||(a=n(s,o.map(e),cs)))(r)))},scale.domain=function(e){return arguments.length?(o=Array.from(e,Zs),rescale()):o.slice()},scale.range=function(e){return arguments.length?(s=Array.from(e),rescale()):s.slice()},scale.rangeRound=function(e){return s=Array.from(e),u=ws,rescale()},scale.clamp=function(e){return arguments.length?(l=!!e||continuous_identity,rescale()):l!==continuous_identity},scale.interpolate=function(e){return arguments.length?(u=e,rescale()):u},scale.unknown=function(e){return arguments.length?(r=e,scale):r},function(r,n){return e=r,t=n,rescale()}}function continuous(){return transformer()(continuous_identity,continuous_identity)}function linearish(e){var t=e.domain;return e.ticks=function(e){var r=t();return Eo(r[0],r[r.length-1],null==e?10:e)},e.tickFormat=function(e,r){var n=t();return Uo(n[0],n[n.length-1],null==e?10:e,r)},e.nice=function(r){null==r&&(r=10);var n,i=t(),a=0,o=i.length-1,s=i[a],u=i[o];return u<s&&(n=s,s=u,u=n,n=a,a=o,o=n),(n=tickIncrement(s,u,r))>0?n=tickIncrement(s=Math.floor(s/n)*n,u=Math.ceil(u/n)*n,r):n<0&&(n=tickIncrement(s=Math.ceil(s*n)/n,u=Math.floor(u*n)/n,r)),n>0?(i[a]=Math.floor(s/n)*n,i[o]=Math.ceil(u/n)*n,t(i)):n<0&&(i[a]=Math.ceil(s*n)/n,i[o]=Math.floor(u*n)/n,t(i)),e},e}var tu=function(e,t){var r,n=0,i=(e=e.slice()).length-1,a=e[n],o=e[i];return o<a&&(r=n,n=i,i=r,r=a,a=o,o=r),e[n]=t.floor(a),e[i]=t.ceil(o),e};function transformLog(e){return Math.log(e)}function transformExp(e){return Math.exp(e)}function transformLogn(e){return-Math.log(-e)}function transformExpn(e){return-Math.exp(-e)}function pow10(e){return isFinite(e)?+("1e"+e):e<0?0:e}function reflect(e){return function(t){return-e(-t)}}function loggish(e){var t,r,n=e(transformLog,transformExp),i=n.domain,a=10;function rescale(){return t=function logp(e){return e===Math.E?Math.log:10===e&&Math.log10||2===e&&Math.log2||(e=Math.log(e),function(t){return Math.log(t)/e})}(a),r=function powp(e){return 10===e?pow10:e===Math.E?Math.exp:function(t){return Math.pow(e,t)}}(a),i()[0]<0?(t=reflect(t),r=reflect(r),e(transformLogn,transformExpn)):e(transformLog,transformExp),n}return n.base=function(e){return arguments.length?(a=+e,rescale()):a},n.domain=function(e){return arguments.length?(i(e),rescale()):i()},n.ticks=function(e){var n,o=i(),s=o[0],u=o[o.length-1];(n=u<s)&&(d=s,s=u,u=d);var l,c,f,d=t(s),h=t(u),p=null==e?10:+e,g=[];if(!(a%1)&&h-d<p){if(d=Math.floor(d),h=Math.ceil(h),s>0){for(;d<=h;++d)for(c=1,l=r(d);c<a;++c)if(!((f=l*c)<s)){if(f>u)break;g.push(f)}}else for(;d<=h;++d)for(c=a-1,l=r(d);c>=1;--c)if(!((f=l*c)<s)){if(f>u)break;g.push(f)}g.length||(g=Eo(s,u,p))}else g=Eo(d,h,Math.min(h-d,p)).map(r);return n?g.reverse():g},n.tickFormat=function(e,i){if(null==i&&(i=10===a?".0e":","),"function"!==typeof i&&(i=Do(i)),e===1/0)return i;null==e&&(e=10);var o=Math.max(1,a*e/n.ticks().length);return function(e){var n=e/r(Math.round(t(e)));return n*a<a-.5&&(n*=a),n<=o?i(e):""}},n.nice=function(){return i(tu(i(),{floor:function floor(e){return r(Math.floor(t(e)))},ceil:function ceil(e){return r(Math.ceil(t(e)))}}))},n}function transformPow(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function transformSqrt(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function transformSquare(e){return e<0?-e*e:e*e}function powish(e){var t=e(continuous_identity,continuous_identity),r=1;function rescale(){return 1===r?e(continuous_identity,continuous_identity):.5===r?e(transformSqrt,transformSquare):e(transformPow(r),transformPow(1/r))}return t.exponent=function(e){return arguments.length?(r=+e,rescale()):r},linearish(t)}function pow_pow(){var e=powish(transformer());return e.copy=function(){return continuous_copy(e,pow_pow()).exponent(e.exponent())},initRange.apply(e,arguments),e}function transformSymlog(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function transformSymexp(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function symlogish(e){var t=1,r=e(transformSymlog(t),transformSymexp(t));return r.constant=function(r){return arguments.length?e(transformSymlog(t=+r),transformSymexp(t)):t},linearish(r)}var ru=1e3,nu=60*ru,iu=60*nu,au=24*iu,ou=7*au,su=30*au,uu=365*au;function time_date(e){return new Date(e)}function time_number(e){return e instanceof Date?+e:+new Date(+e)}function calendar(e,t,r,n,i,a,o,s,u){var l=continuous(),c=l.invert,f=l.domain,d=u(".%L"),h=u(":%S"),p=u("%I:%M"),g=u("%I %p"),m=u("%a %d"),v=u("%b %d"),y=u("%B"),_=u("%Y"),b=[[o,1,ru],[o,5,5*ru],[o,15,15*ru],[o,30,30*ru],[a,1,nu],[a,5,5*nu],[a,15,15*nu],[a,30,30*nu],[i,1,iu],[i,3,3*iu],[i,6,6*iu],[i,12,12*iu],[n,1,au],[n,2,2*au],[r,1,ou],[t,1,su],[t,3,3*su],[e,1,uu]];function tickFormat(s){return(o(s)<s?d:a(s)<s?h:i(s)<s?p:n(s)<s?g:t(s)<s?r(s)<s?m:v:e(s)<s?y:_)(s)}function tickInterval(t,r,n){if(null==t&&(t=10),"number"===typeof t){var i,a=Math.abs(n-r)/t,o=mr((function(e){return e[2]})).right(b,a);return o===b.length?(i=tickStep(r/uu,n/uu,t),t=e):o?(i=(o=b[a/b[o-1][2]<b[o][2]/a?o-1:o])[1],t=o[0]):(i=Math.max(tickStep(r,n,t),1),t=s),t.every(i)}return t}return l.invert=function(e){return new Date(c(e))},l.domain=function(e){return arguments.length?f(Array.from(e,time_number)):f().map(time_date)},l.ticks=function(e){var t,r=f(),n=r[0],i=r[r.length-1],a=i<n;return a&&(t=n,n=i,i=t),t=(t=tickInterval(e,n,i))?t.range(n,i+1):[],a?t.reverse():t},l.tickFormat=function(e,t){return null==t?tickFormat:u(t)},l.nice=function(e){var t=f();return(e=tickInterval(e,t[0],t[t.length-1]))?f(tu(t,e)):l},l.copy=function(){return continuous_copy(l,calendar(e,t,r,n,i,a,o,s,u))},l}var lu;function sequential_transformer(){var e,t,r,n,i,a=0,o=1,s=continuous_identity,u=!1;function scale(t){return isNaN(t=+t)?i:s(0===r?.5:(t=(n(t)-e)*r,u?Math.max(0,Math.min(1,t)):t))}return scale.domain=function(i){var s,u;return arguments.length?(s=i,u=Object(qt.a)(s,2),a=u[0],o=u[1],e=n(a=+a),t=n(o=+o),r=e===t?0:1/(t-e),scale):[a,o]},scale.clamp=function(e){return arguments.length?(u=!!e,scale):u},scale.interpolator=function(e){return arguments.length?(s=e,scale):s},scale.range=function(){return[s(0),s(1)]},scale.unknown=function(e){return arguments.length?(i=e,scale):i},function(i){return n=i,e=i(a),t=i(o),r=e===t?0:1/(t-e),scale}}function sequential_copy(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function sequential(){var e=linearish(sequential_transformer()(continuous_identity));return e.copy=function(){return sequential_copy(e,sequential())},initInterpolator.apply(e,arguments)}function sequentialPow(){var e=powish(sequential_transformer());return e.copy=function(){return sequential_copy(e,sequentialPow()).exponent(e.exponent())},initInterpolator.apply(e,arguments)}function diverging_transformer(){var e,t,r,n,i,a,o,s=0,u=.5,l=1,c=1,f=continuous_identity,d=!1;function scale(e){return isNaN(e=+e)?o:(e=.5+((e=+a(e))-t)*(c*e<c*t?n:i),f(d?Math.max(0,Math.min(1,e)):e))}return scale.domain=function(o){var f,d;return arguments.length?(f=o,d=Object(qt.a)(f,3),s=d[0],u=d[1],l=d[2],e=a(s=+s),t=a(u=+u),r=a(l=+l),n=e===t?0:.5/(t-e),i=t===r?0:.5/(r-t),c=t<e?-1:1,scale):[s,u,l]},scale.clamp=function(e){return arguments.length?(d=!!e,scale):d},scale.interpolator=function(e){return arguments.length?(f=e,scale):f},scale.range=function(){return[f(0),f(.5),f(1)]},scale.unknown=function(e){return arguments.length?(o=e,scale):o},function(o){return a=o,e=o(s),t=o(u),r=o(l),n=e===t?0:.5/(t-e),i=t===r?0:.5/(r-t),c=t<e?-1:1,scale}}function divergingPow(){var e=powish(diverging_transformer());return e.copy=function(){return sequential_copy(e,divergingPow()).exponent(e.exponent())},initInterpolator.apply(e,arguments)}function scales_scale(e,t){return arguments.length>1?(cu[e]=function scales_create(e,t){return function scale(){var r=t();return r.invertRange||(r.invertRange=r.invert?go(r):r.invertExtent?mo(r):void 0),r.type=e,r}}(e,t),this):Object(V.v)(cu,e)?cu[e]:void 0}var cu=(lu={},Object(po.a)(lu,Pa,(function identity_identity(e){var t;function scale(e){return isNaN(e=+e)?t:e}return scale.invert=scale,scale.domain=scale.range=function(t){return arguments.length?(e=Array.from(t,Zs),scale):e.slice()},scale.unknown=function(e){return arguments.length?(t=e,scale):t},scale.copy=function(){return identity_identity(e).unknown(t)},e=arguments.length?Array.from(e,Zs):[0,1],linearish(scale)})),Object(po.a)(lu,ja,(function linear_linear(){var e=continuous();return e.copy=function(){return continuous_copy(e,linear_linear())},initRange.apply(e,arguments),linearish(e)})),Object(po.a)(lu,Ma,(function log_log(){var e=loggish(transformer()).domain([1,10]);return e.copy=function(){return continuous_copy(e,log_log()).base(e.base())},initRange.apply(e,arguments),e})),Object(po.a)(lu,Fa,pow_pow),Object(po.a)(lu,Ia,(function pow_sqrt(){return pow_pow.apply(null,arguments).exponent(.5)})),Object(po.a)(lu,La,(function symlog(){var e=symlogish(transformer());return e.copy=function(){return continuous_copy(e,symlog()).constant(e.constant())},initRange.apply(e,arguments)})),Object(po.a)(lu,Na,(function(){return initRange.apply(calendar(Je,io,ze,Xe,ro,eo,Qa,Ka,tt).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)})),Object(po.a)(lu,Ba,(function(){return initRange.apply(calendar(Ze,co,Pe,Ue,uo,oo,Qa,Ka,nt).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)})),Object(po.a)(lu,Ua,sequential),Object(po.a)(lu,Ua+"-"+ja,sequential),Object(po.a)(lu,Ua+"-"+Ma,(function sequentialLog(){var e=loggish(sequential_transformer()).domain([1,10]);return e.copy=function(){return sequential_copy(e,sequentialLog()).base(e.base())},initInterpolator.apply(e,arguments)})),Object(po.a)(lu,Ua+"-"+Fa,sequentialPow),Object(po.a)(lu,Ua+"-"+Ia,(function sequentialSqrt(){return sequentialPow.apply(null,arguments).exponent(.5)})),Object(po.a)(lu,Ua+"-"+La,(function sequentialSymlog(){var e=symlogish(sequential_transformer());return e.copy=function(){return sequential_copy(e,sequentialSymlog()).constant(e.constant())},initInterpolator.apply(e,arguments)})),Object(po.a)(lu,za+"-"+ja,(function diverging_diverging(){var e=linearish(diverging_transformer()(continuous_identity));return e.copy=function(){return sequential_copy(e,diverging_diverging())},initInterpolator.apply(e,arguments)})),Object(po.a)(lu,za+"-"+Ma,(function divergingLog(){var e=loggish(diverging_transformer()).domain([.1,1,10]);return e.copy=function(){return sequential_copy(e,divergingLog()).base(e.base())},initInterpolator.apply(e,arguments)})),Object(po.a)(lu,za+"-"+Fa,divergingPow),Object(po.a)(lu,za+"-"+Ia,(function divergingSqrt(){return divergingPow.apply(null,arguments).exponent(.5)})),Object(po.a)(lu,za+"-"+La,(function divergingSymlog(){var e=symlogish(diverging_transformer());return e.copy=function(){return sequential_copy(e,divergingSymlog()).constant(e.constant())},initInterpolator.apply(e,arguments)})),Object(po.a)(lu,qa,(function quantile_quantile(){var e,t=[],r=[],n=[];function rescale(){var e=0,i=Math.max(1,r.length);for(n=new Array(i-1);++e<i;)n[e-1]=quantile(t,e/i);return scale}function scale(t){return isNaN(t=+t)?e:r[bo(n,t)]}return scale.invertExtent=function(e){var i=r.indexOf(e);return i<0?[NaN,NaN]:[i>0?n[i-1]:t[0],i<n.length?n[i]:t[t.length-1]]},scale.domain=function(e){if(!arguments.length)return t.slice();t=[];var r=!0,n=!1,i=void 0;try{for(var a,o=e[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;null==s||isNaN(s=+s)||t.push(s)}}catch(u){n=!0,i=u}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}return t.sort(St),rescale()},scale.range=function(e){return arguments.length?(r=Array.from(e),rescale()):r.slice()},scale.unknown=function(t){return arguments.length?(e=t,scale):e},scale.quantiles=function(){return n.slice()},scale.copy=function(){return quantile_quantile().domain(t).range(r).unknown(e)},initRange.apply(scale,arguments)})),Object(po.a)(lu,Wa,(function quantize_quantize(){var e,t=0,r=1,n=1,i=[.5],a=[0,1];function scale(t){return t<=t?a[bo(i,t,0,n)]:e}function rescale(){var e=-1;for(i=new Array(n);++e<n;)i[e]=((e+1)*r-(e-n)*t)/(n+1);return scale}return scale.domain=function(e){var n,i;return arguments.length?(n=e,i=Object(qt.a)(n,2),t=i[0],r=i[1],t=+t,r=+r,rescale()):[t,r]},scale.range=function(e){return arguments.length?(n=(a=Array.from(e)).length-1,rescale()):a.slice()},scale.invertExtent=function(e){var o=a.indexOf(e);return o<0?[NaN,NaN]:o<1?[t,i[0]]:o>=n?[i[n-1],r]:[i[o-1],i[o]]},scale.unknown=function(t){return arguments.length?(e=t,scale):scale},scale.thresholds=function(){return i.slice()},scale.copy=function(){return quantize_quantize().domain([t,r]).range(a).unknown(e)},initRange.apply(linearish(scale),arguments)})),Object(po.a)(lu,Ga,(function threshold_threshold(){var e,t=[.5],r=[0,1],n=1;function scale(i){return i<=i?r[bo(t,i,0,n)]:e}return scale.domain=function(e){return arguments.length?(t=Array.from(e),n=Math.min(t.length,r.length-1),scale):t.slice()},scale.range=function(e){return arguments.length?(r=Array.from(e),n=Math.min(t.length,r.length-1),scale):r.slice()},scale.invertExtent=function(e){var n=r.indexOf(e);return[t[n-1],t[n]]},scale.unknown=function(t){return arguments.length?(e=t,scale):e},scale.copy=function(){return threshold_threshold().domain(t).range(r).unknown(e)},initRange.apply(scale,arguments)})),Object(po.a)(lu,$a,(function scaleBinOrdinal(){var e=[],t=[];function scale(r){return null==r||r!==r?void 0:t[(bo(e,r)-1)%t.length]}return scale.domain=function(t){return arguments.length?(e=numbers_numbers(t),scale):e.slice()},scale.range=function(e){return arguments.length?(t=qo.call(e),scale):t.slice()},scale.tickFormat=function(t,r){return Uo(e[0],Object(V.S)(e),null==t?10:t,r)},scale.copy=function(){return scaleBinOrdinal().domain(scale.domain()).range(scale.range())},scale})),Object(po.a)(lu,Ha,ordinal),Object(po.a)(lu,Ya,scaleBand_band),Object(po.a)(lu,Va,(function scaleBand_point(){return function pointish(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return pointish(t())},e}(scaleBand_band().paddingInner(1))})),lu);for(var fu in cu)scales_scale(fu,cu[fu]);var du=["clamp","base","constant","exponent"];function interpolateRange(e,t){var r=t[0],n=Object(V.S)(t)-r;return function(t){return e(r+t*n)}}function interpolateColors(e,t,r){return piecewise_piecewise(interpolate_interpolate(t||"rgb",r),e)}function quantizeInterpolator(e,t){for(var r=new Array(t),n=t+1,i=0;i<t;)r[i]=e(++i/n);return r}function scaleFraction(e,t,r){var n,i,a,o=r-t;return o&&isFinite(o)?(n=(i=e.type).indexOf("-"),i=n<0?i:i.slice(n+1),a=scales_scale(i)().domain([t,r]).range([0,1]),du.forEach((function(t){return e[t]?a[t](e[t]()):0})),a):Object(V.l)(.5)}function interpolate_interpolate(e,t){var r=o[function interpolate_method(e){return"interpolate"+e.toLowerCase().split("-").map((function(e){return e[0].toUpperCase()+e.slice(1)})).join("")}(e)];return null!=t&&r&&r.gamma?r.gamma(t):r}function schemes_colors(e){for(var t=e.length/6|0,r=new Array(t),n=0;n<t;)r[n]="#"+e.slice(6*n,6*++n);return r}function schemes_apply(e,t){for(var r in e)schemes_scheme(r,t(e[r]))}var hu={};function schemes_scheme(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(hu[e]=t,this):hu[e]}function tickCount(e,t,r){var n;return Object(V.E)(t)&&null!=r&&(t=Math.min(t,~~(Object(V.V)(e.domain())/r)||1)),Object(V.F)(t)&&(n=t.step,t=t.interval),Object(V.H)(t)&&(t=timeInterval(t,e.type)||Object(V.n)("Only time and utc scales accept interval strings."),n&&(t=t.every(n))),t}function validTicks(e,t,r){var n=e.range(),i=Math.floor(n[0]),a=Math.ceil(Object(V.S)(n));if(i>a&&(n=a,a=i,i=n),t=t.filter((function(t){return t=e(t),i<=t&&t<=a})),r>0&&t.length>1){for(var o=[t[0],Object(V.S)(t)];t.length>r&&t.length>=3;)t=t.filter((function(e,t){return!(t%2)}));t.length<3&&(t=o)}return t}function tickValues(e,t){return e.bins?validTicks(e,e.bins):e.ticks?e.ticks(t):e.domain()}function ticks_tickFormat(e,t,r,n){var i=e.tickFormat?e.tickFormat(t,r):r&&n===Na?tt(r):r?Do(r):String;if(isLogarithmic(e.type)){var a=function variablePrecision(e){var t=formatSpecifier(e||",");if(null==t.precision){switch(t.precision=12,t.type){case"%":t.precision-=2;break;case"e":t.precision-=1}return function trimZeroes(e,t){return function(r){var n,i,a=e(r),o=a.indexOf(t);if(o<0)return a;for(i=(n=function rightmostDigit(e,t){var r,n=e.lastIndexOf("e");if(n>0)return n;for(n=e.length;--n>t;)if((r=e.charCodeAt(n))>=48&&r<=57)return n+1}(a,o))<a.length?a.slice(n):"";--n>o;)if("0"!==a[n]){++n;break}return a.slice(0,n)+i}}(Do(t),Do(".1f")(1)[1])}return Do(t)}(r);i=e.bins?a:function ticks_filter(e,t){return function(r){return e(r)?t(r):""}}(i,a)}return i}function AxisTicks(e){Transform.call(this,null,e)}function DataJoin(e){Transform.call(this,null,e)}function defaultItemCreate(){return ingest({})}function isExit(e){return e.exit}function Encode(e){Transform.call(this,null,e)}schemes_apply({category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"},schemes_colors),schemes_apply({blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},(function(e){return interpolateColors(schemes_colors(e))})),Object(V.y)(AxisTicks,Transform).transform=function(e,t){if(this.value&&!e.modified())return t.StopPropagation;var r=t.fork(t.NO_SOURCE|t.NO_FIELDS),n=this.value,i=e.scale,a=tickCount(i,null==e.count?e.values?e.values.length:10:e.count,e.minstep),o=e.format||ticks_tickFormat(i,a,e.formatSpecifier,e.formatType),s=e.values?validTicks(i,e.values,a):tickValues(i,a);return n&&(r.rem=n),n=s.map((function(e,t){return ingest({index:t/(s.length-1||1),value:e,label:o(e)})})),e.extra&&n.length&&n.push(ingest({index:-1,extra:{value:n[0].value},label:""})),r.source=n,r.add=n,this.value=n,r},Object(V.y)(DataJoin,Transform).transform=function(e,t){var r=t.dataflow,n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.item||defaultItemCreate,a=e.key||tupleid,o=this.value;return Object(V.A)(n.encode)&&(n.encode=null),o&&(e.modified("key")||t.modified(a))&&Object(V.n)("DataJoin does not support modified key function or fields."),o||(t=t.addAll(),this.value=o=Object(V.s)().test(isExit),o.lookup=function(e){return o.get(a(e))}),t.visit(t.ADD,(function(e){var t=a(e),r=o.get(t);r?r.exit?(o.empty--,n.add.push(r)):n.mod.push(r):(o.set(t,r=i(e)),n.add.push(r)),r.datum=e,r.exit=!1})),t.visit(t.MOD,(function(e){var t=a(e),r=o.get(t);r&&(r.datum=e,n.mod.push(r))})),t.visit(t.REM,(function(e){var t=a(e),r=o.get(t);e!==r.datum||r.exit||(n.rem.push(r),r.exit=!0,++o.empty)})),t.changed(t.ADD_MOD)&&n.modifies("datum"),e.clean&&o.empty>r.cleanThreshold&&r.runAfter(o.clean),n},Object(V.y)(Encode,Transform).transform=function(e,t){var r=t.fork(t.ADD_REM),n=e.mod||!1,i=e.encoders,a=t.encode;if(Object(V.A)(a)){if(!r.changed()&&!a.every((function(e){return i[e]})))return t.StopPropagation;a=a[0],r.encode=null}var o="enter"===a,s=i.update||V.r,u=i.enter||V.r,l=i.exit||V.r,c=(a&&!o?i[a]:s)||V.r;if(t.changed(t.ADD)&&(t.visit(t.ADD,(function(t){u(t,e),s(t,e)})),r.modifies(u.output),r.modifies(s.output),c!==V.r&&c!==s&&(t.visit(t.ADD,(function(t){c(t,e)})),r.modifies(c.output))),t.changed(t.REM)&&l!==V.r&&(t.visit(t.REM,(function(t){l(t,e)})),r.modifies(l.output)),o||c!==V.r){var f=t.MOD|(e.modified()?t.REFLOW:0);o?(t.visit(f,(function(t){var i=u(t,e)||n;(c(t,e)||i)&&r.mod.push(t)})),r.mod.length&&r.modifies(u.output)):t.visit(f,(function(t){(c(t,e)||n)&&r.mod.push(t)})),r.mod.length&&r.modifies(c.output)}return r.changed()?r:t.StopPropagation};var pu,gu,mu="symbol",vu="discrete",yu=(pu={},Object(po.a)(pu,qa,"quantiles"),Object(po.a)(pu,Wa,"thresholds"),Object(po.a)(pu,Ga,"domain"),pu),_u=(gu={},Object(po.a)(gu,qa,"quantiles"),Object(po.a)(gu,Wa,"domain"),gu);function labelValues(e,t){return e.bins?function binValues(e){var t=e.slice(0,-1);return t.max=Object(V.S)(e),t}(e.bins):yu[e.type]?function thresholdValues(e){var t=[-1/0].concat(e);return t.max=1/0,t}(e[yu[e.type]]()):tickValues(e,t)}function labelFormat(e,t,r,n,i){var a=_u[e.type]&&i!==Na?function thresholdFormat(e,t){var r,n=e[_u[e.type]](),i=n.length,a=i>1?n[1]-n[0]:n[0];for(r=1;r<i;++r)a=Math.min(a,n[r]-n[r-1]);return Uo(0,a,30,t)}(e,n):ticks_tickFormat(e,t,n,i);return r===mu&&function isDiscreteRange(e){return yu[e.type]||e.bins}(e)?function formatRange(e){return function(t,r,n){var i=n[r+1]||n.max||1/0,a=formatValue(t,e),o=formatValue(i,e);return a&&o?a+"\u2013"+o:o?"< "+o:"\u2265 "+a}}(a):r===vu?function formatDiscrete(e){return function(t,r){return r?e(t):null}}(a):function formatPoint(e){return function(t){return e(t)}}(a)}function formatValue(e,t){return isFinite(e)?t(e):null}function LegendEntries(e){Transform.call(this,[],e)}Object(V.y)(LegendEntries,Transform).transform=function(e,t){if(null!=this.value&&!e.modified())return t.StopPropagation;var r,n,i,a,o=t.fork(t.NO_SOURCE|t.NO_FIELDS),s=this.value,u=e.type||mu,l=e.scale,c=tickCount(l,null==e.count?5:e.count,e.minstep),f=e.format||labelFormat(l,c,u,e.formatSpecifier,e.formatType),d=e.values||labelValues(l,c);return s&&(o.rem=s),u===mu?(Object(V.D)(i=e.size)?(e.values||0!==l(d[0])||(d=d.slice(1)),a=d.reduce((function(t,r){return Math.max(t,i(r,e))}),0)):i=Object(V.l)(a=i||8),s=d.map((function(t,r){return ingest({index:r,label:f(t,r,d),value:t,offset:a,size:i(t,e)})}))):"gradient"===u?(r=l.domain(),n=scaleFraction(l,r[0],Object(V.S)(r)),d.length<3&&!e.values&&r[0]!==Object(V.S)(r)&&(d=[r[0],Object(V.S)(r)]),s=d.map((function(e,t){return ingest({index:t,label:f(e,t,d),value:e,perc:n(e)})}))):(i=d.length-1,n=function labelFraction(e){var t=e.domain(),r=t.length-1,n=+t[0],i=+Object(V.S)(t),a=i-n;if(e.type===Ga){var o=r?a/r:.1;a=(i+=o)-(n-=o)}return function(e){return(e-n)/a}}(l),s=d.map((function(e,t){return ingest({index:t,label:f(e,t,d),value:e,perc:t?n(e):0,perc2:t===i?1:n(d[t+1])})}))),o.source=s,o.add=s,this.value=s,o};var bu=Object(V.s)({line:LinkPath_line,"line-radial":function lineR(e,t,r,n){return LinkPath_line(t*Math.cos(e),t*Math.sin(e),n*Math.cos(r),n*Math.sin(r))},arc:LinkPath_arc,"arc-radial":function arcR(e,t,r,n){return LinkPath_arc(t*Math.cos(e),t*Math.sin(e),n*Math.cos(r),n*Math.sin(r))},curve:LinkPath_curve,"curve-radial":function curveR(e,t,r,n){return LinkPath_curve(t*Math.cos(e),t*Math.sin(e),n*Math.cos(r),n*Math.sin(r))},"orthogonal-horizontal":function orthoX(e,t,r,n){return"M"+e+","+t+"V"+n+"H"+r},"orthogonal-vertical":function orthoY(e,t,r,n){return"M"+e+","+t+"H"+r+"V"+n},"orthogonal-radial":function orthoR(e,t,r,n){var i=Math.cos(e),a=Math.sin(e),o=Math.cos(r),s=Math.sin(r),u=Math.abs(r-e)>Math.PI?r<=e:r>e;return"M"+t*i+","+t*a+"A"+t+","+t+" 0 0,"+(u?1:0)+" "+t*o+","+t*s+"L"+n*o+","+n*s},"diagonal-horizontal":function diagonalX(e,t,r,n){var i=(e+r)/2;return"M"+e+","+t+"C"+i+","+t+" "+i+","+n+" "+r+","+n},"diagonal-vertical":function diagonalY(e,t,r,n){var i=(t+n)/2;return"M"+e+","+t+"C"+e+","+i+" "+r+","+i+" "+r+","+n},"diagonal-radial":function diagonalR(e,t,r,n){var i=Math.cos(e),a=Math.sin(e),o=Math.cos(r),s=Math.sin(r),u=(t+n)/2;return"M"+t*i+","+t*a+"C"+u*i+","+u*a+" "+u*o+","+u*s+" "+n*o+","+n*s}});function sourceX(e){return e.source.x}function sourceY(e){return e.source.y}function targetX(e){return e.target.x}function targetY(e){return e.target.y}function LinkPath(e){Transform.call(this,{},e)}function LinkPath_line(e,t,r,n){return"M"+e+","+t+"L"+r+","+n}function LinkPath_arc(e,t,r,n){var i=r-e,a=n-t,o=Math.sqrt(i*i+a*a)/2;return"M"+e+","+t+"A"+o+","+o+" "+180*Math.atan2(a,i)/Math.PI+" 0 1 "+r+","+n}function LinkPath_curve(e,t,r,n){var i=r-e,a=n-t,o=.2*(i+a),s=.2*(a-i);return"M"+e+","+t+"C"+(e+o)+","+(t+s)+" "+(r+s)+","+(n-o)+" "+r+","+n}function Pie(e){Transform.call(this,null,e)}LinkPath.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]},Object(V.y)(LinkPath,Transform).transform=function(e,t){var r=e.sourceX||sourceX,n=e.sourceY||sourceY,i=e.targetX||targetX,a=e.targetY||targetY,o=e.as||"path",s=e.orient||"vertical",u=e.shape||"line",l=bu.get(u+"-"+s)||bu.get(u);return l||Object(V.n)("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,(function(e){e[o]=l(r(e),n(e),i(e),a(e))})),t.reflow(e.modified()).modifies(o)},Pie.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]},Object(V.y)(Pie,Transform).transform=function(e,t){var r,n,i,a=e.as||["startAngle","endAngle"],o=a[0],s=a[1],u=e.field||V.M,l=e.startAngle||0,c=null!=e.endAngle?e.endAngle:2*Math.PI,f=t.source,d=f.map(u),h=d.length,p=l,g=(c-l)/function sum_sum(e,t){var r=0;if(void 0===t){var n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var u=o.value;(u=+u)&&(r+=u)}}catch(m){i=!0,a=m}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}}else{var l=-1,c=!0,f=!1,d=void 0;try{for(var h,p=e[Symbol.iterator]();!(c=(h=p.next()).done);c=!0){var g=h.value;(g=+t(g,++l,e))&&(r+=g)}}catch(m){f=!0,d=m}finally{try{c||null==p.return||p.return()}finally{if(f)throw d}}}return r}(d),m=dr(h);for(e.sort&&m.sort((function(e,t){return d[e]-d[t]})),r=0;r<h;++r)i=d[m[r]],(n=f[m[r]])[o]=p,n[s]=p+=i*g;return this.value=d,t.reflow(e.modified()).modifies(a)};var xu=5;function includePad(e){return isContinuous(e)&&e!==Ua}var wu=Object(V.bb)(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function Scale(e){Transform.call(this,null,e),this.modified(!0)}function domainCheck(e,t,r){isLogarithmic(e)&&(Math.abs(t.reduce((function(e,t){return e+(t<0?-1:t>0?1:0)}),0))!==t.length&&r.warn("Log scale domain includes zero: "+Object(V.X)(t)));return t}function adjustScheme(e,t,r){return Object(V.D)(e)&&(t||r)?interpolateRange(e,flip(t||[0,1],r)):e}function flip(e,t){return t?e.slice().reverse():e}function SortItems(e){Transform.call(this,null,e)}Object(V.y)(Scale,Transform).transform=function(e,t){var r=t.dataflow,n=this.value,i=function scaleKey(e){var t,r=e.type,n="";if(r===Ua)return Ua+"-"+ja;(function isContinuousColor(e){var t=e.type;return isContinuous(t)&&t!==Na&&t!==Ba&&(e.scheme||e.range&&e.range.length&&e.range.every(V.H))})(e)&&(t=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(null!=e.domainMid):0,n=2===t?Ua+"-":3===t?za+"-":"");return(n+r||ja).toLowerCase()}(e);for(i in n&&i===n.type||(this.value=n=scales_scale(i)()),e)if(!wu[i]){if("padding"===i&&includePad(n.type))continue;Object(V.D)(n[i])?n[i](e[i]):r.warn("Unsupported scale property: "+i)}return function configureRange(e,t,r){var n=e.type,i=t.round||!1,a=t.range;if(null!=t.rangeStep)a=function configureRangeStep(e,t,r){e!==Ya&&e!==Va&&Object(V.n)("Only band and point scales support rangeStep.");var n=(null!=t.paddingOuter?t.paddingOuter:t.padding)||0,i=e===Va?1:(null!=t.paddingInner?t.paddingInner:t.padding)||0;return[0,t.rangeStep*Da(r,i,n)]}(n,t,r);else if(t.scheme&&(a=function configureScheme(e,t,r){var n,i,a=t.schemeExtent;Object(V.A)(t.scheme)?i=interpolateColors(t.scheme,t.interpolate,t.interpolateGamma):(n=t.scheme.toLowerCase(),(i=schemes_scheme(n))||Object(V.n)("Unrecognized scheme name: ".concat(t.scheme)));return r=e===Ga?r+1:e===$a?r-1:e===qa||e===Wa?+t.schemeCount||xu:r,isInterpolating(e)?adjustScheme(i,a,t.reverse):Object(V.D)(i)?quantizeInterpolator(adjustScheme(i,a),r):e===Ha?i:i.slice(0,r)}(n,t,r),Object(V.D)(a))){if(e.interpolator)return e.interpolator(a);Object(V.n)("Scale type ".concat(n," does not support interpolating color schemes."))}if(a&&isInterpolating(n))return e.interpolator(interpolateColors(flip(a,t.reverse),t.interpolate,t.interpolateGamma));a&&t.interpolate&&e.interpolate?e.interpolate(interpolate_interpolate(t.interpolate,t.interpolateGamma)):Object(V.D)(e.round)?e.round(i):Object(V.D)(e.rangeRound)&&e.interpolate(i?ws:_s);a&&e.range(flip(a,t.reverse))}(n,e,function configureBins(e,t,r){var n=t.bins;if(n&&!Object(V.A)(n)){var i=e.domain(),a=i[0],o=Object(V.S)(i),s=null==n.start?a:n.start,u=null==n.stop?o:n.stop,l=n.step;l||Object(V.n)("Scale bins parameter missing step property."),s<a&&(s=l*Math.ceil(a/l)),u>o&&(u=l*Math.floor(o/l)),n=dr(s,u+l/2,l)}n?e.bins=n:e.bins&&delete e.bins;e.type===$a&&(n?t.domain||t.domainRaw||(e.domain(n),r=n.length):e.bins=e.domain());return r}(n,e,function configureDomain(e,t,r){var n=function rawDomain(e,t,r){return t?(e.domain(domainCheck(e.type,t,r)),t.length):-1}(e,t.domainRaw,r);if(n>-1)return n;var i,a,o=t.domain,s=e.type,u=t.zero||void 0===t.zero&&function includeZero(e){var t=e.type;return!e.bins&&(t===ja||t===Fa||t===Ia)}(e);if(!o)return 0;includePad(s)&&t.padding&&o[0]!==Object(V.S)(o)&&(o=function padDomain(e,t,r,n,i,a){var o=Math.abs(Object(V.S)(r)-r[0]),s=o/(o-2*n),u=e===Ma?Object(V.jb)(t,null,s):e===Ia?Object(V.kb)(t,null,s,.5):e===Fa?Object(V.kb)(t,null,s,i||1):e===La?Object(V.lb)(t,null,s,a||1):Object(V.ib)(t,null,s);return(t=t.slice())[0]=u[0],t[t.length-1]=u[1],t}(s,o,t.range,t.padding,t.exponent,t.constant));(u||null!=t.domainMin||null!=t.domainMax||null!=t.domainMid)&&(i=(o=o.slice()).length-1||1,u&&(o[0]>0&&(o[0]=0),o[i]<0&&(o[i]=0)),null!=t.domainMin&&(o[0]=t.domainMin),null!=t.domainMax&&(o[i]=t.domainMax),null!=t.domainMid&&(((a=t.domainMid)<o[0]||a>o[i])&&r.warn("Scale domainMid exceeds domain min or max.",a),o.splice(i,0,a)));e.domain(domainCheck(s,o,r)),s===Ha&&e.unknown(t.domainImplicit?xo:void 0);t.nice&&e.nice&&e.nice(!0!==t.nice&&tickCount(e,t.nice)||null);return o.length}(n,e,r))),t.fork(t.NO_SOURCE|t.NO_FIELDS)},Object(V.y)(SortItems,Transform).transform=function(e,t){var r=e.modified("sort")||t.changed(t.ADD)||t.modified(e.sort.fields)||t.modified("datum");return r&&t.source.sort(stableCompare(e.sort)),this.modified(r),t};var ku=["y0","y1"];function Stack(e){Transform.call(this,null,e)}function stackCenter(e,t,r,n,i){for(var a,o=(t-e.sum)/2,s=e.length,u=0;u<s;++u)(a=e[u])[n]=o,a[i]=o+=Math.abs(r(a))}function stackNormalize(e,t,r,n,i){for(var a,o=1/e.sum,s=0,u=e.length,l=0,c=0;l<u;++l)(a=e[l])[n]=s,a[i]=s=o*(c+=Math.abs(r(a)))}function stackZero(e,t,r,n,i){for(var a,o,s=0,u=0,l=e.length,c=0;c<l;++c)(a=+r(o=e[c]))<0?(o[n]=u,o[i]=u+=a):(o[n]=s,o[i]=s+=a)}Stack.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:"zero",values:["zero","center","normalize"]},{name:"as",type:"string",array:!0,length:2,default:ku}]},Object(V.y)(Stack,Transform).transform=function(e,t){var r,n,i,a,o=e.as||ku,s=o[0],u=o[1],l=stableCompare(e.sort),c=e.field||V.M,f="center"===e.offset?stackCenter:"normalize"===e.offset?stackNormalize:stackZero;for(r=function Stack_partition(e,t,r,n){var i,a,o,s,u,l,c,f,d,h=[],p=function get(e){return e(u)};if(null==t)h.push(e.slice());else for(i={},a=0,o=e.length;a<o;++a)u=e[a],l=t.map(p),(c=i[l])||(i[l]=c=[],h.push(c)),c.push(u);for(l=0,d=0,s=h.length;l<s;++l){for(c=h[l],a=0,f=0,o=c.length;a<o;++a)f+=Math.abs(n(c[a]));c.sum=f,f>d&&(d=f),r&&c.sort(r)}return h.max=d,h}(t.source,e.groupby,l,c),n=0,i=r.length,a=r.max;n<i;++n)f(r[n],a,c,s,u);return t.reflow(e.modified()).modifies(o)};var Su=function(e,t){var r,n;if(void 0===t){var i=!0,a=!1,o=void 0;try{for(var s,u=e[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var l=s.value;null!=l&&(void 0===r?l>=l&&(r=n=l):(r>l&&(r=l),n<l&&(n=l)))}}catch(v){a=!0,o=v}finally{try{i||null==u.return||u.return()}finally{if(a)throw o}}}else{var c=-1,f=!0,d=!1,h=void 0;try{for(var p,g=e[Symbol.iterator]();!(f=(p=g.next()).done);f=!0){var m=p.value;null!=(m=t(m,++c,e))&&(void 0===r?m>=m&&(r=n=m):(r>m&&(r=m),n<m&&(n=m)))}}catch(v){d=!0,h=v}finally{try{f||null==g.return||g.return()}finally{if(d)throw h}}}return[r,n]},Eu=function(e,t){return e<t?-1:e>t?1:e>=t?0:NaN};var Cu;1===(Cu=Eu).length&&(Cu=function bisector_ascendingComparator(e){return function(t,r){return Eu(e(t),r)}}(Cu));var Tu=function(e,t){var r,n,i,a=e.length,o=-1;if(null==t){for(;++o<a;)if(null!=(r=e[o])&&r>=r)for(n=i=r;++o<a;)null!=(r=e[o])&&(n>r&&(n=r),i<r&&(i=r))}else for(;++o<a;)if(null!=(r=t(e[o],o,e))&&r>=r)for(n=i=r;++o<a;)null!=(r=t(e[o],o,e))&&(n>r&&(n=r),i<r&&(i=r));return[n,i]},Ou=Array.prototype,Au=(Ou.slice,Ou.map,function(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=0|Math.max(0,Math.ceil((t-e)/r)),a=new Array(i);++n<i;)a[n]=e+n*r;return a}),Ru=Math.sqrt(50),Du=Math.sqrt(10),Pu=Math.sqrt(2);function ticks_tickStep(e,t,r){var n=Math.abs(t-e)/Math.max(0,r),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),a=n/i;return a>=Ru?i*=10:a>=Du?i*=5:a>=Pu&&(i*=2),t<e?-i:i}var ju=function(e){return Math.ceil(Math.log(e.length)/Math.LN2)+1},Mu=function(e,t){var r,n,i=e.length,a=-1;if(null==t){for(;++a<i;)if(null!=(r=e[a])&&r>=r)for(n=r;++a<i;)null!=(r=e[a])&&r>n&&(n=r)}else for(;++a<i;)if(null!=(r=t(e[a],a,e))&&r>=r)for(n=r;++a<i;)null!=(r=t(e[a],a,e))&&r>n&&(n=r);return n};var Fu=Array.prototype.slice,Iu=function(e,t){return e-t},Lu=function(e){for(var t=0,r=e.length,n=e[r-1][1]*e[0][0]-e[r-1][0]*e[0][1];++t<r;)n+=e[t-1][1]*e[t][0]-e[t-1][0]*e[t][1];return n},Nu=function(e){return function(){return e}},Bu=function(e,t){for(var r,n=-1,i=t.length;++n<i;)if(r=ringContains(e,t[n]))return r;return 0};function ringContains(e,t){for(var r=t[0],n=t[1],i=-1,a=0,o=e.length,s=o-1;a<o;s=a++){var u=e[a],l=u[0],c=u[1],f=e[s],d=f[0],h=f[1];if(segmentContains(u,f,t))return 0;c>n!==h>n&&r<(d-l)*(n-c)/(h-c)+l&&(i=-i)}return i}function segmentContains(e,t,r){var n;return function collinear(e,t,r){return(t[0]-e[0])*(r[1]-e[1])===(r[0]-e[0])*(t[1]-e[1])}(e,t,r)&&function within(e,t,r){return e<=t&&t<=r||r<=t&&t<=e}(e[n=+(e[0]===t[0])],r[n],t[n])}var Uu=function(){},zu=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]],qu=function(){var e=1,t=1,r=ju,n=smoothLinear;function contours(e){var t=r(e);if(Array.isArray(t))t=t.slice().sort(Iu);else{var n=Tu(e),i=n[0],a=n[1];t=ticks_tickStep(i,a,t),t=Au(Math.floor(i/t)*t,Math.floor(a/t)*t,t)}return t.map((function(t){return contour(e,t)}))}function contour(r,i){var a=[],o=[];return function isorings(r,n,i){var a,o,s,u,l,c,f=new Array,d=new Array;a=o=-1,u=r[0]>=n,zu[u<<1].forEach(stitch);for(;++a<e-1;)s=u,u=r[a+1]>=n,zu[s|u<<1].forEach(stitch);zu[u<<0].forEach(stitch);for(;++o<t-1;){for(a=-1,u=r[o*e+e]>=n,l=r[o*e]>=n,zu[u<<1|l<<2].forEach(stitch);++a<e-1;)s=u,u=r[o*e+e+a+1]>=n,c=l,l=r[o*e+a+1]>=n,zu[s|u<<1|l<<2|c<<3].forEach(stitch);zu[u|l<<3].forEach(stitch)}a=-1,l=r[o*e]>=n,zu[l<<2].forEach(stitch);for(;++a<e-1;)c=l,l=r[o*e+a+1]>=n,zu[l<<2|c<<3].forEach(stitch);function stitch(e){var t,r,n=[e[0][0]+a,e[0][1]+o],s=[e[1][0]+a,e[1][1]+o],u=index(n),l=index(s);(t=d[u])?(r=f[l])?(delete d[t.end],delete f[r.start],t===r?(t.ring.push(s),i(t.ring)):f[t.start]=d[r.end]={start:t.start,end:r.end,ring:t.ring.concat(r.ring)}):(delete d[t.end],t.ring.push(s),d[t.end=l]=t):(t=f[l])?(r=d[u])?(delete f[t.start],delete d[r.end],t===r?(t.ring.push(s),i(t.ring)):f[r.start]=d[t.end]={start:r.start,end:t.end,ring:r.ring.concat(t.ring)}):(delete f[t.start],t.ring.unshift(n),f[t.start=u]=t):f[u]=d[l]={start:u,end:l,ring:[n,s]}}zu[l<<3].forEach(stitch)}(r,i,(function(e){n(e,r,i),Lu(e)>0?a.push([e]):o.push(e)})),o.forEach((function(e){for(var t,r=0,n=a.length;r<n;++r)if(-1!==Bu((t=a[r])[0],e))return void t.push(e)})),{type:"MultiPolygon",value:i,coordinates:a}}function index(t){return 2*t[0]+t[1]*(e+1)*4}function smoothLinear(r,n,i){r.forEach((function(r){var a,o=r[0],s=r[1],u=0|o,l=0|s,c=n[l*e+u];o>0&&o<e&&u===o&&(a=n[l*e+u-1],r[0]=o+(i-a)/(c-a)-.5),s>0&&s<t&&l===s&&(a=n[(l-1)*e+u],r[1]=s+(i-a)/(c-a)-.5)}))}return contours.contour=contour,contours.size=function(r){if(!arguments.length)return[e,t];var n=Math.ceil(r[0]),i=Math.ceil(r[1]);if(!(n>0)||!(i>0))throw new Error("invalid size");return e=n,t=i,contours},contours.thresholds=function(e){return arguments.length?(r="function"===typeof e?e:Array.isArray(e)?Nu(Fu.call(e)):Nu(e),contours):r},contours.smooth=function(e){return arguments.length?(n=e?smoothLinear:Uu,contours):n===smoothLinear},contours};function blurX(e,t,r){for(var n=e.width,i=e.height,a=1+(r<<1),o=0;o<i;++o)for(var s=0,u=0;s<n+r;++s)s<n&&(u+=e.data[s+o*n]),s>=r&&(s>=a&&(u-=e.data[s-a+o*n]),t.data[s-r+o*n]=u/Math.min(s+1,n-1+a-s,a))}function blurY(e,t,r){for(var n=e.width,i=e.height,a=1+(r<<1),o=0;o<n;++o)for(var s=0,u=0;s<i+r;++s)s<i&&(u+=e.data[o+s*n]),s>=r&&(s>=a&&(u-=e.data[o+(s-a)*n]),t.data[o+(s-r)*n]=u/Math.min(s+1,i-1+a-s,a))}function defaultX(e){return e[0]}function defaultY(e){return e[1]}function defaultWeight(){return 1}var Wu=["size","smooth"],Gu=["x","y","weight","size","cellSize","bandwidth"];function Contour(e){Transform.call(this,null,e)}Contour.Definition={type:"Contour",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"values",type:"number",array:!0},{name:"x",type:"field"},{name:"y",type:"field"},{name:"weight",type:"field"},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number"},{name:"count",type:"number"},{name:"smooth",type:"boolean"},{name:"nice",type:"boolean",default:!1},{name:"thresholds",type:"number",array:!0}]},Object(V.y)(Contour,Transform).transform=function(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var r,n,i,a=t.fork(t.NO_SOURCE|t.NO_FIELDS),o=e.count||10;return e.values?(r=qu(),n=Wu,i=e.values):(r=function(){var e=defaultX,t=defaultY,r=defaultWeight,n=960,i=500,a=20,o=2,s=3*a,u=n+2*s>>o,l=i+2*s>>o,c=Nu(20);function density(n){var i=new Float32Array(u*l),f=new Float32Array(u*l);n.forEach((function(n,a,c){var f=+e(n,a,c)+s>>o,d=+t(n,a,c)+s>>o,h=+r(n,a,c);f>=0&&f<u&&d>=0&&d<l&&(i[f+d*u]+=h)})),blurX({width:u,height:l,data:i},{width:u,height:l,data:f},a>>o),blurY({width:u,height:l,data:f},{width:u,height:l,data:i},a>>o),blurX({width:u,height:l,data:i},{width:u,height:l,data:f},a>>o),blurY({width:u,height:l,data:f},{width:u,height:l,data:i},a>>o),blurX({width:u,height:l,data:i},{width:u,height:l,data:f},a>>o),blurY({width:u,height:l,data:f},{width:u,height:l,data:i},a>>o);var d=c(i);if(!Array.isArray(d)){var h=Mu(i);d=ticks_tickStep(0,h,d),(d=Au(0,Math.floor(h/d)*d,d)).shift()}return qu().thresholds(d).size([u,l])(i).map(transform)}function transform(e){return e.value*=Math.pow(2,-2*o),e.coordinates.forEach(transformPolygon),e}function transformPolygon(e){e.forEach(transformRing)}function transformRing(e){e.forEach(transformPoint)}function transformPoint(e){e[0]=e[0]*Math.pow(2,o)-s,e[1]=e[1]*Math.pow(2,o)-s}function resize(){return u=n+2*(s=3*a)>>o,l=i+2*s>>o,density}return density.x=function(t){return arguments.length?(e="function"===typeof t?t:Nu(+t),density):e},density.y=function(e){return arguments.length?(t="function"===typeof e?e:Nu(+e),density):t},density.weight=function(e){return arguments.length?(r="function"===typeof e?e:Nu(+e),density):r},density.size=function(e){if(!arguments.length)return[n,i];var t=Math.ceil(e[0]),r=Math.ceil(e[1]);if(!(t>=0)&&!(t>=0))throw new Error("invalid size");return n=t,i=r,resize()},density.cellSize=function(e){if(!arguments.length)return 1<<o;if(!((e=+e)>=1))throw new Error("invalid cell size");return o=Math.floor(Math.log(e)/Math.LN2),resize()},density.thresholds=function(e){return arguments.length?(c="function"===typeof e?e:Array.isArray(e)?Nu(Fu.call(e)):Nu(e),density):c},density.bandwidth=function(e){if(!arguments.length)return Math.sqrt(a*(a+1));if(!((e=+e)>=0))throw new Error("invalid bandwidth");return a=Math.round((Math.sqrt(4*e*e+1)-1)/2),resize()},density}(),n=Gu,i=t.materialize(t.SOURCE).source),r.thresholds(e.thresholds||(e.nice?o:function Contour_quantize(e){return function(t){for(var r=Su(t),n=r[0],i=r[1]-n,a=[],o=1;o<=e;++o)a.push(n+i*o/(e+1));return a}}(o))),n.forEach((function(t){null!=e[t]&&r[t](e[t])})),this.value&&(a.rem=this.value),i=i&&i.length?r(i).map(ingest):[],this.value=a.source=a.add=i,a};var Hu="Feature",Vu="FeatureCollection";function GeoJSON(e){Transform.call(this,null,e)}GeoJSON.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]},Object(V.y)(GeoJSON,Transform).transform=function(e,t){var r,n=this._features,i=this._points,a=e.fields,o=a&&a[0],s=a&&a[1],u=e.geojson,l=t.ADD;r=e.modified()||t.changed(t.REM)||t.modified(Object(V.g)(u))||o&&t.modified(Object(V.g)(o))||s&&t.modified(Object(V.g)(s)),this.value&&!r||(l=t.SOURCE,this._features=n=[],this._points=i=[]),u&&t.visit(l,(function(e){n.push(u(e))})),o&&s&&(t.visit(l,(function(e){var t=o(e),r=s(e);null!=t&&null!=r&&(t=+t)===t&&(r=+r)===r&&i.push([t,r])})),n=n.concat({type:Hu,geometry:{type:"MultiPoint",coordinates:i}})),this.value={type:Vu,features:n}};var Yu=function(){return new Adder};function Adder(){this.reset()}Adder.prototype={constructor:Adder,reset:function reset(){this.s=this.t=0},add:function add(e){adder_add($u,e,this.t),adder_add(this,$u.s,this.s),this.s?this.t+=$u.t:this.s=$u.t},valueOf:function valueOf(){return this.s}};var $u=new Adder;function adder_add(e,t,r){var n=e.s=t+r,i=n-t,a=n-i;e.t=t-a+(r-i)}var Xu=1e-6,Ku=1e-12,Ju=Math.PI,Qu=Ju/2,Zu=Ju/4,el=2*Ju,tl=180/Ju,rl=Ju/180,nl=Math.abs,il=Math.atan,al=Math.atan2,ol=Math.cos,sl=Math.ceil,ul=Math.exp,ll=(Math.floor,Math.log),cl=Math.pow,fl=Math.sin,dl=Math.sign||function(e){return e>0?1:e<0?-1:0},hl=Math.sqrt,pl=Math.tan;function math_acos(e){return e>1?0:e<-1?Ju:Math.acos(e)}function math_asin(e){return e>1?Qu:e<-1?-Qu:Math.asin(e)}function noop_noop(){}function streamGeometry(e,t){e&&ml.hasOwnProperty(e.type)&&ml[e.type](e,t)}var gl={Feature:function Feature(e,t){streamGeometry(e.geometry,t)},FeatureCollection:function FeatureCollection(e,t){for(var r=e.features,n=-1,i=r.length;++n<i;)streamGeometry(r[n].geometry,t)}},ml={Sphere:function Sphere(e,t){t.sphere()},Point:function Point(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function MultiPoint(e,t){for(var r=e.coordinates,n=-1,i=r.length;++n<i;)e=r[n],t.point(e[0],e[1],e[2])},LineString:function LineString(e,t){streamLine(e.coordinates,t,0)},MultiLineString:function MultiLineString(e,t){for(var r=e.coordinates,n=-1,i=r.length;++n<i;)streamLine(r[n],t,0)},Polygon:function Polygon(e,t){streamPolygon(e.coordinates,t)},MultiPolygon:function MultiPolygon(e,t){for(var r=e.coordinates,n=-1,i=r.length;++n<i;)streamPolygon(r[n],t)},GeometryCollection:function GeometryCollection(e,t){for(var r=e.geometries,n=-1,i=r.length;++n<i;)streamGeometry(r[n],t)}};function streamLine(e,t,r){var n,i=-1,a=e.length-r;for(t.lineStart();++i<a;)n=e[i],t.point(n[0],n[1],n[2]);t.lineEnd()}function streamPolygon(e,t){var r=-1,n=e.length;for(t.polygonStart();++r<n;)streamLine(e[r],t,1);t.polygonEnd()}var vl,yl,_l,bl,xl,wl=function(e,t){e&&gl.hasOwnProperty(e.type)?gl[e.type](e,t):streamGeometry(e,t)},kl=Yu(),Sl=Yu(),El={point:noop_noop,lineStart:noop_noop,lineEnd:noop_noop,polygonStart:function polygonStart(){kl.reset(),El.lineStart=areaRingStart,El.lineEnd=areaRingEnd},polygonEnd:function polygonEnd(){var e=+kl;Sl.add(e<0?el+e:e),this.lineStart=this.lineEnd=this.point=noop_noop},sphere:function sphere(){Sl.add(el)}};function areaRingStart(){El.point=areaPointFirst}function areaRingEnd(){areaPoint(vl,yl)}function areaPointFirst(e,t){El.point=areaPoint,vl=e,yl=t,_l=e*=rl,bl=ol(t=(t*=rl)/2+Zu),xl=fl(t)}function areaPoint(e,t){var r=(e*=rl)-_l,n=r>=0?1:-1,i=n*r,a=ol(t=(t*=rl)/2+Zu),o=fl(t),s=xl*o,u=bl*a+s*ol(i),l=s*n*fl(i);kl.add(al(l,u)),_l=e,bl=a,xl=o}function cartesian_spherical(e){return[al(e[1],e[0]),math_asin(e[2])]}function cartesian_cartesian(e){var t=e[0],r=e[1],n=ol(r);return[n*ol(t),n*fl(t),fl(r)]}function cartesianDot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function cartesianCross(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function cartesianAddInPlace(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function cartesianScale(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function cartesianNormalizeInPlace(e){var t=hl(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var Cl,Tl,Ol,Al,Rl,Dl,Pl,jl,Ml,Fl,Il=Yu(),Ll={point:boundsPoint,lineStart:boundsLineStart,lineEnd:boundsLineEnd,polygonStart:function polygonStart(){Ll.point=boundsRingPoint,Ll.lineStart=boundsRingStart,Ll.lineEnd=boundsRingEnd,Il.reset(),El.polygonStart()},polygonEnd:function polygonEnd(){El.polygonEnd(),Ll.point=boundsPoint,Ll.lineStart=boundsLineStart,Ll.lineEnd=boundsLineEnd,kl<0?(Cl=-(Ol=180),Tl=-(Al=90)):Il>Xu?Al=90:Il<-Xu&&(Tl=-90),Fl[0]=Cl,Fl[1]=Ol},sphere:function sphere(){Cl=-(Ol=180),Tl=-(Al=90)}};function boundsPoint(e,t){Ml.push(Fl=[Cl=e,Ol=e]),t<Tl&&(Tl=t),t>Al&&(Al=t)}function bounds_linePoint(e,t){var r=cartesian_cartesian([e*rl,t*rl]);if(jl){var n=cartesianCross(jl,r),i=cartesianCross([n[1],-n[0],0],n);cartesianNormalizeInPlace(i),i=cartesian_spherical(i);var a,o=e-Rl,s=o>0?1:-1,u=i[0]*tl*s,l=nl(o)>180;l^(s*Rl<u&&u<s*e)?(a=i[1]*tl)>Al&&(Al=a):l^(s*Rl<(u=(u+360)%360-180)&&u<s*e)?(a=-i[1]*tl)<Tl&&(Tl=a):(t<Tl&&(Tl=t),t>Al&&(Al=t)),l?e<Rl?bounds_angle(Cl,e)>bounds_angle(Cl,Ol)&&(Ol=e):bounds_angle(e,Ol)>bounds_angle(Cl,Ol)&&(Cl=e):Ol>=Cl?(e<Cl&&(Cl=e),e>Ol&&(Ol=e)):e>Rl?bounds_angle(Cl,e)>bounds_angle(Cl,Ol)&&(Ol=e):bounds_angle(e,Ol)>bounds_angle(Cl,Ol)&&(Cl=e)}else Ml.push(Fl=[Cl=e,Ol=e]);t<Tl&&(Tl=t),t>Al&&(Al=t),jl=r,Rl=e}function boundsLineStart(){Ll.point=bounds_linePoint}function boundsLineEnd(){Fl[0]=Cl,Fl[1]=Ol,Ll.point=boundsPoint,jl=null}function boundsRingPoint(e,t){if(jl){var r=e-Rl;Il.add(nl(r)>180?r+(r>0?360:-360):r)}else Dl=e,Pl=t;El.point(e,t),bounds_linePoint(e,t)}function boundsRingStart(){El.lineStart()}function boundsRingEnd(){boundsRingPoint(Dl,Pl),El.lineEnd(),nl(Il)>Xu&&(Cl=-(Ol=180)),Fl[0]=Cl,Fl[1]=Ol,jl=null}function bounds_angle(e,t){return(t-=e)<0?t+360:t}function rangeCompare(e,t){return e[0]-t[0]}function rangeContains(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}var Nl,Bl,Ul,zl,ql,Wl,Gl,Hl,Vl,Yl,$l,Xl,Kl,Jl,Ql,Zl,ec={sphere:noop_noop,point:centroidPoint,lineStart:centroidLineStart,lineEnd:centroidLineEnd,polygonStart:function polygonStart(){ec.lineStart=centroidRingStart,ec.lineEnd=centroidRingEnd},polygonEnd:function polygonEnd(){ec.lineStart=centroidLineStart,ec.lineEnd=centroidLineEnd}};function centroidPoint(e,t){e*=rl;var r=ol(t*=rl);centroidPointCartesian(r*ol(e),r*fl(e),fl(t))}function centroidPointCartesian(e,t,r){Ul+=(e-Ul)/++Nl,zl+=(t-zl)/Nl,ql+=(r-ql)/Nl}function centroidLineStart(){ec.point=centroidLinePointFirst}function centroidLinePointFirst(e,t){e*=rl;var r=ol(t*=rl);Jl=r*ol(e),Ql=r*fl(e),Zl=fl(t),ec.point=centroidLinePoint,centroidPointCartesian(Jl,Ql,Zl)}function centroidLinePoint(e,t){e*=rl;var r=ol(t*=rl),n=r*ol(e),i=r*fl(e),a=fl(t),o=al(hl((o=Ql*a-Zl*i)*o+(o=Zl*n-Jl*a)*o+(o=Jl*i-Ql*n)*o),Jl*n+Ql*i+Zl*a);Bl+=o,Wl+=o*(Jl+(Jl=n)),Gl+=o*(Ql+(Ql=i)),Hl+=o*(Zl+(Zl=a)),centroidPointCartesian(Jl,Ql,Zl)}function centroidLineEnd(){ec.point=centroidPoint}function centroidRingStart(){ec.point=centroidRingPointFirst}function centroidRingEnd(){centroidRingPoint(Xl,Kl),ec.point=centroidPoint}function centroidRingPointFirst(e,t){Xl=e,Kl=t,e*=rl,t*=rl,ec.point=centroidRingPoint;var r=ol(t);Jl=r*ol(e),Ql=r*fl(e),Zl=fl(t),centroidPointCartesian(Jl,Ql,Zl)}function centroidRingPoint(e,t){e*=rl;var r=ol(t*=rl),n=r*ol(e),i=r*fl(e),a=fl(t),o=Ql*a-Zl*i,s=Zl*n-Jl*a,u=Jl*i-Ql*n,l=hl(o*o+s*s+u*u),c=math_asin(l),f=l&&-c/l;Vl+=f*o,Yl+=f*s,$l+=f*u,Bl+=c,Wl+=c*(Jl+(Jl=n)),Gl+=c*(Ql+(Ql=i)),Hl+=c*(Zl+(Zl=a)),centroidPointCartesian(Jl,Ql,Zl)}var tc=function(e,t){function compose(r,n){return r=e(r,n),t(r[0],r[1])}return e.invert&&t.invert&&(compose.invert=function(r,n){return(r=t.invert(r,n))&&e.invert(r[0],r[1])}),compose};function rotationIdentity(e,t){return[nl(e)>Ju?e+Math.round(-e/el)*el:e,t]}function rotateRadians(e,t,r){return(e%=el)?t||r?tc(rotationLambda(e),rotationPhiGamma(t,r)):rotationLambda(e):t||r?rotationPhiGamma(t,r):rotationIdentity}function forwardRotationLambda(e){return function(t,r){return[(t+=e)>Ju?t-el:t<-Ju?t+el:t,r]}}function rotationLambda(e){var t=forwardRotationLambda(e);return t.invert=forwardRotationLambda(-e),t}function rotationPhiGamma(e,t){var r=ol(e),n=fl(e),i=ol(t),a=fl(t);function rotation(e,t){var o=ol(t),s=ol(e)*o,u=fl(e)*o,l=fl(t),c=l*r+s*n;return[al(u*i-c*a,s*r-l*n),math_asin(c*i+u*a)]}return rotation.invert=function(e,t){var o=ol(t),s=ol(e)*o,u=fl(e)*o,l=fl(t),c=l*i-u*a;return[al(u*i+l*a,s*r+c*n),math_asin(c*r-s*n)]},rotation}rotationIdentity.invert=rotationIdentity;var rc=function(e){function forward(t){return(t=e(t[0]*rl,t[1]*rl))[0]*=tl,t[1]*=tl,t}return e=rotateRadians(e[0]*rl,e[1]*rl,e.length>2?e[2]*rl:0),forward.invert=function(t){return(t=e.invert(t[0]*rl,t[1]*rl))[0]*=tl,t[1]*=tl,t},forward};function circleStream(e,t,r,n,i,a){if(r){var o=ol(t),s=fl(t),u=n*r;null==i?(i=t+n*el,a=t-u/2):(i=circleRadius(o,i),a=circleRadius(o,a),(n>0?i<a:i>a)&&(i+=n*el));for(var l,c=i;n>0?c>a:c<a;c-=u)l=cartesian_spherical([o,-s*ol(c),-s*fl(c)]),e.point(l[0],l[1])}}function circleRadius(e,t){(t=cartesian_cartesian(t))[0]-=e,cartesianNormalizeInPlace(t);var r=math_acos(-t[1]);return((-t[2]<0?-r:r)+el-Xu)%el}var nc=function(){var e,t=[];return{point:function point(t,r){e.push([t,r])},lineStart:function lineStart(){t.push(e=[])},lineEnd:noop_noop,rejoin:function rejoin(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function result(){var result=t;return t=[],e=null,result}}},ic=function(e,t){return nl(e[0]-t[0])<Xu&&nl(e[1]-t[1])<Xu};function Intersection(e,t,r,n){this.x=e,this.z=t,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}var ac=function(e,t,r,n,i){var a,o,s=[],u=[];if(e.forEach((function(e){if(!((t=e.length-1)<=0)){var t,r,n=e[0],o=e[t];if(ic(n,o)){for(i.lineStart(),a=0;a<t;++a)i.point((n=e[a])[0],n[1]);i.lineEnd()}else s.push(r=new Intersection(n,e,null,!0)),u.push(r.o=new Intersection(n,null,r,!1)),s.push(r=new Intersection(o,e,null,!1)),u.push(r.o=new Intersection(o,null,r,!0))}})),s.length){for(u.sort(t),rejoin_link(s),rejoin_link(u),a=0,o=u.length;a<o;++a)u[a].e=r=!r;for(var l,c,f=s[0];;){for(var d=f,h=!0;d.v;)if((d=d.n)===f)return;l=d.z,i.lineStart();do{if(d.v=d.o.v=!0,d.e){if(h)for(a=0,o=l.length;a<o;++a)i.point((c=l[a])[0],c[1]);else n(d.x,d.n.x,1,i);d=d.n}else{if(h)for(l=d.p.z,a=l.length-1;a>=0;--a)i.point((c=l[a])[0],c[1]);else n(d.x,d.p.x,-1,i);d=d.p}l=(d=d.o).z,h=!h}while(!d.v);i.lineEnd()}}};function rejoin_link(e){if(t=e.length){for(var t,r,n=0,i=e[0];++n<t;)i.n=r=e[n],r.p=i,i=r;i.n=r=e[0],r.p=i}}var oc=Yu();function longitude(e){return nl(e[0])<=Ju?e[0]:dl(e[0])*((nl(e[0])+Ju)%el-Ju)}var sc=function(e,t){var r=longitude(t),n=t[1],i=fl(n),a=[fl(r),-ol(r),0],o=0,s=0;oc.reset(),1===i?n=Qu+Xu:-1===i&&(n=-Qu-Xu);for(var u=0,l=e.length;u<l;++u)if(f=(c=e[u]).length)for(var c,f,d=c[f-1],h=longitude(d),p=d[1]/2+Zu,g=fl(p),m=ol(p),v=0;v<f;++v,h=_,g=x,m=w,d=y){var y=c[v],_=longitude(y),b=y[1]/2+Zu,x=fl(b),w=ol(b),k=_-h,S=k>=0?1:-1,E=S*k,C=E>Ju,T=g*x;if(oc.add(al(T*S*fl(E),m*w+T*ol(E))),o+=C?k+S*el:k,C^h>=r^_>=r){var O=cartesianCross(cartesian_cartesian(d),cartesian_cartesian(y));cartesianNormalizeInPlace(O);var A=cartesianCross(a,O);cartesianNormalizeInPlace(A);var R=(C^k>=0?-1:1)*math_asin(A[2]);(n>R||n===R&&(O[0]||O[1]))&&(s+=C^k>=0?1:-1)}}return(o<-Xu||o<Xu&&oc<-Xu)^1&s},uc=function(e,t){return e<t?-1:e>t?1:e>=t?0:NaN};var lc=function(e){return 1===e.length&&(e=function src_bisector_ascendingComparator(e){return function(t,r){return uc(e(t),r)}}(e)),{left:function left(t,r,n,i){for(null==n&&(n=0),null==i&&(i=t.length);n<i;){var a=n+i>>>1;e(t[a],r)<0?n=a+1:i=a}return n},right:function right(t,r,n,i){for(null==n&&(n=0),null==i&&(i=t.length);n<i;){var a=n+i>>>1;e(t[a],r)>0?i=a:n=a+1}return n}}}(uc);lc.right,lc.left;var cc=Array.prototype,fc=(cc.slice,cc.map,function(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=0|Math.max(0,Math.ceil((t-e)/r)),a=new Array(i);++n<i;)a[n]=e+n*r;return a});Math.sqrt(50),Math.sqrt(10),Math.sqrt(2);var dc=function(e){for(var t,r,n,i=e.length,a=-1,o=0;++a<i;)o+=e[a].length;for(r=new Array(o);--i>=0;)for(t=(n=e[i]).length;--t>=0;)r[--o]=n[t];return r};var hc=function(e,t,r,n){return function(i){var a,o,s,u=t(i),l=nc(),c=t(l),f=!1,d={point:point,lineStart:lineStart,lineEnd:lineEnd,polygonStart:function polygonStart(){d.point=pointRing,d.lineStart=ringStart,d.lineEnd=ringEnd,o=[],a=[]},polygonEnd:function polygonEnd(){d.point=point,d.lineStart=lineStart,d.lineEnd=lineEnd,o=dc(o);var e=sc(a,n);o.length?(f||(i.polygonStart(),f=!0),ac(o,clip_compareIntersection,e,r,i)):e&&(f||(i.polygonStart(),f=!0),i.lineStart(),r(null,null,1,i),i.lineEnd()),f&&(i.polygonEnd(),f=!1),o=a=null},sphere:function sphere(){i.polygonStart(),i.lineStart(),r(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function point(t,r){e(t,r)&&i.point(t,r)}function pointLine(e,t){u.point(e,t)}function lineStart(){d.point=pointLine,u.lineStart()}function lineEnd(){d.point=point,u.lineEnd()}function pointRing(e,t){s.push([e,t]),c.point(e,t)}function ringStart(){c.lineStart(),s=[]}function ringEnd(){pointRing(s[0][0],s[0][1]),c.lineEnd();var e,t,r,n,u=c.clean(),d=l.result(),h=d.length;if(s.pop(),a.push(s),s=null,h)if(1&u){if((t=(r=d[0]).length-1)>0){for(f||(i.polygonStart(),f=!0),i.lineStart(),e=0;e<t;++e)i.point((n=r[e])[0],n[1]);i.lineEnd()}}else h>1&&2&u&&d.push(d.pop().concat(d.shift())),o.push(d.filter(validSegment))}return d}};function validSegment(e){return e.length>1}function clip_compareIntersection(e,t){return((e=e.x)[0]<0?e[1]-Qu-Xu:Qu-e[1])-((t=t.x)[0]<0?t[1]-Qu-Xu:Qu-t[1])}var pc=hc((function(){return!0}),(function clipAntimeridianLine(e){var t,r=NaN,n=NaN,i=NaN;return{lineStart:function lineStart(){e.lineStart(),t=1},point:function point(a,o){var s=a>0?Ju:-Ju,u=nl(a-r);nl(u-Ju)<Xu?(e.point(r,n=(n+o)/2>0?Qu:-Qu),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(s,n),e.point(a,n),t=0):i!==s&&u>=Ju&&(nl(r-i)<Xu&&(r-=i*Xu),nl(a-s)<Xu&&(a-=s*Xu),n=function clipAntimeridianIntersect(e,t,r,n){var i,a,o=fl(e-r);return nl(o)>Xu?il((fl(t)*(a=ol(n))*fl(r)-fl(n)*(i=ol(t))*fl(e))/(i*a*o)):(t+n)/2}(r,n,a,o),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(s,n),t=0),e.point(r=a,n=o),i=s},lineEnd:function lineEnd(){e.lineEnd(),r=n=NaN},clean:function clean(){return 2-t}}}),(function clipAntimeridianInterpolate(e,t,r,n){var i;if(null==e)i=r*Qu,n.point(-Ju,i),n.point(0,i),n.point(Ju,i),n.point(Ju,0),n.point(Ju,-i),n.point(0,-i),n.point(-Ju,-i),n.point(-Ju,0),n.point(-Ju,i);else if(nl(e[0]-t[0])>Xu){var a=e[0]<t[0]?Ju:-Ju;i=r*a/2,n.point(-a,i),n.point(0,i),n.point(a,i)}else n.point(t[0],t[1])}),[-Ju,-Qu]);var gc=function(e){var t=ol(e),r=6*rl,n=t>0,i=nl(t)>Xu;function visible(e,r){return ol(e)*ol(r)>t}function intersect(e,r,n){var i=[1,0,0],a=cartesianCross(cartesian_cartesian(e),cartesian_cartesian(r)),o=cartesianDot(a,a),s=a[0],u=o-s*s;if(!u)return!n&&e;var l=t*o/u,c=-t*s/u,f=cartesianCross(i,a),d=cartesianScale(i,l);cartesianAddInPlace(d,cartesianScale(a,c));var h=f,p=cartesianDot(d,h),g=cartesianDot(h,h),m=p*p-g*(cartesianDot(d,d)-1);if(!(m<0)){var v=hl(m),y=cartesianScale(h,(-p-v)/g);if(cartesianAddInPlace(y,d),y=cartesian_spherical(y),!n)return y;var _,b=e[0],x=r[0],w=e[1],k=r[1];x<b&&(_=b,b=x,x=_);var S=x-b,E=nl(S-Ju)<Xu;if(!E&&k<w&&(_=w,w=k,k=_),E||S<Xu?E?w+k>0^y[1]<(nl(y[0]-b)<Xu?w:k):w<=y[1]&&y[1]<=k:S>Ju^(b<=y[0]&&y[0]<=x)){var C=cartesianScale(h,(-p+v)/g);return cartesianAddInPlace(C,d),[y,cartesian_spherical(C)]}}}function code(t,r){var i=n?e:Ju-e,a=0;return t<-i?a|=1:t>i&&(a|=2),r<-i?a|=4:r>i&&(a|=8),a}return hc(visible,(function clipLine(e){var t,r,a,o,s;return{lineStart:function lineStart(){o=a=!1,s=1},point:function point(u,l){var c,f=[u,l],d=visible(u,l),h=n?d?0:code(u,l):d?code(u+(u<0?Ju:-Ju),l):0;if(!t&&(o=a=d)&&e.lineStart(),d!==a&&(!(c=intersect(t,f))||ic(t,c)||ic(f,c))&&(f[0]+=Xu,f[1]+=Xu,d=visible(f[0],f[1])),d!==a)s=0,d?(e.lineStart(),c=intersect(f,t),e.point(c[0],c[1])):(c=intersect(t,f),e.point(c[0],c[1]),e.lineEnd()),t=c;else if(i&&t&&n^d){var p;h&r||!(p=intersect(f,t,!0))||(s=0,n?(e.lineStart(),e.point(p[0][0],p[0][1]),e.point(p[1][0],p[1][1]),e.lineEnd()):(e.point(p[1][0],p[1][1]),e.lineEnd(),e.lineStart(),e.point(p[0][0],p[0][1])))}!d||t&&ic(t,f)||e.point(f[0],f[1]),t=f,a=d,r=h},lineEnd:function lineEnd(){a&&e.lineEnd(),t=null},clean:function clean(){return s|(o&&a)<<1}}}),(function interpolate(t,n,i,a){circleStream(a,e,r,i,t,n)}),n?[0,-e]:[-Ju,e-Ju])},mc=function(e,t,r,n,i,a){var o,s=e[0],u=e[1],l=0,c=1,f=t[0]-s,d=t[1]-u;if(o=r-s,f||!(o>0)){if(o/=f,f<0){if(o<l)return;o<c&&(c=o)}else if(f>0){if(o>c)return;o>l&&(l=o)}if(o=i-s,f||!(o<0)){if(o/=f,f<0){if(o>c)return;o>l&&(l=o)}else if(f>0){if(o<l)return;o<c&&(c=o)}if(o=n-u,d||!(o>0)){if(o/=d,d<0){if(o<l)return;o<c&&(c=o)}else if(d>0){if(o>c)return;o>l&&(l=o)}if(o=a-u,d||!(o<0)){if(o/=d,d<0){if(o>c)return;o>l&&(l=o)}else if(d>0){if(o<l)return;o<c&&(c=o)}return l>0&&(e[0]=s+l*f,e[1]=u+l*d),c<1&&(t[0]=s+c*f,t[1]=u+c*d),!0}}}}},vc=1e9,yc=-vc;function clipRectangle(e,t,r,n){function visible(i,a){return e<=i&&i<=r&&t<=a&&a<=n}function interpolate(i,a,o,s){var u=0,l=0;if(null==i||(u=corner(i,o))!==(l=corner(a,o))||comparePoint(i,a)<0^o>0)do{s.point(0===u||3===u?e:r,u>1?n:t)}while((u=(u+o+4)%4)!==l);else s.point(a[0],a[1])}function corner(n,i){return nl(n[0]-e)<Xu?i>0?0:3:nl(n[0]-r)<Xu?i>0?2:1:nl(n[1]-t)<Xu?i>0?1:0:i>0?3:2}function compareIntersection(e,t){return comparePoint(e.x,t.x)}function comparePoint(e,t){var r=corner(e,1),n=corner(t,1);return r!==n?r-n:0===r?t[1]-e[1]:1===r?e[0]-t[0]:2===r?e[1]-t[1]:t[0]-e[0]}return function(i){var a,o,s,u,l,c,f,d,h,p,g,m=i,v=nc(),y={point:point,lineStart:function lineStart(){y.point=linePoint,o&&o.push(s=[]);p=!0,h=!1,f=d=NaN},lineEnd:function lineEnd(){a&&(linePoint(u,l),c&&h&&v.rejoin(),a.push(v.result()));y.point=point,h&&m.lineEnd()},polygonStart:function polygonStart(){m=v,a=[],o=[],g=!0},polygonEnd:function polygonEnd(){var t=function polygonInside(){for(var t=0,r=0,i=o.length;r<i;++r)for(var a,s,u=o[r],l=1,c=u.length,f=u[0],d=f[0],h=f[1];l<c;++l)a=d,s=h,f=u[l],d=f[0],h=f[1],s<=n?h>n&&(d-a)*(n-s)>(h-s)*(e-a)&&++t:h<=n&&(d-a)*(n-s)<(h-s)*(e-a)&&--t;return t}(),r=g&&t,u=(a=dc(a)).length;(r||u)&&(i.polygonStart(),r&&(i.lineStart(),interpolate(null,null,1,i),i.lineEnd()),u&&ac(a,compareIntersection,t,interpolate,i),i.polygonEnd());m=i,a=o=s=null}};function point(e,t){visible(e,t)&&m.point(e,t)}function linePoint(i,a){var v=visible(i,a);if(o&&s.push([i,a]),p)u=i,l=a,c=v,p=!1,v&&(m.lineStart(),m.point(i,a));else if(v&&h)m.point(i,a);else{var y=[f=Math.max(yc,Math.min(vc,f)),d=Math.max(yc,Math.min(vc,d))],_=[i=Math.max(yc,Math.min(vc,i)),a=Math.max(yc,Math.min(vc,a))];mc(y,_,e,t,r,n)?(h||(m.lineStart(),m.point(y[0],y[1])),m.point(_[0],_[1]),v||m.lineEnd(),g=!1):v&&(m.lineStart(),m.point(i,a),g=!1)}f=i,d=a,h=v}return y}}Yu();function graticuleX(e,t,r){var n=fc(e,t-Xu,r).concat(t);return function(e){return n.map((function(t){return[e,t]}))}}function graticuleY(e,t,r){var n=fc(e,t-Xu,r).concat(t);return function(e){return n.map((function(t){return[t,e]}))}}function graticule_graticule(){var e,t,r,n,i,a,o,s,u,l,c,f,d=10,h=d,p=90,g=360,m=2.5;function graticule(){return{type:"MultiLineString",coordinates:lines()}}function lines(){return fc(sl(n/p)*p,r,p).map(c).concat(fc(sl(s/g)*g,o,g).map(f)).concat(fc(sl(t/d)*d,e,d).filter((function(e){return nl(e%p)>Xu})).map(u)).concat(fc(sl(a/h)*h,i,h).filter((function(e){return nl(e%g)>Xu})).map(l))}return graticule.lines=function(){return lines().map((function(e){return{type:"LineString",coordinates:e}}))},graticule.outline=function(){return{type:"Polygon",coordinates:[c(n).concat(f(o).slice(1),c(r).reverse().slice(1),f(s).reverse().slice(1))]}},graticule.extent=function(e){return arguments.length?graticule.extentMajor(e).extentMinor(e):graticule.extentMinor()},graticule.extentMajor=function(e){return arguments.length?(n=+e[0][0],r=+e[1][0],s=+e[0][1],o=+e[1][1],n>r&&(e=n,n=r,r=e),s>o&&(e=s,s=o,o=e),graticule.precision(m)):[[n,s],[r,o]]},graticule.extentMinor=function(r){return arguments.length?(t=+r[0][0],e=+r[1][0],a=+r[0][1],i=+r[1][1],t>e&&(r=t,t=e,e=r),a>i&&(r=a,a=i,i=r),graticule.precision(m)):[[t,a],[e,i]]},graticule.step=function(e){return arguments.length?graticule.stepMajor(e).stepMinor(e):graticule.stepMinor()},graticule.stepMajor=function(e){return arguments.length?(p=+e[0],g=+e[1],graticule):[p,g]},graticule.stepMinor=function(e){return arguments.length?(d=+e[0],h=+e[1],graticule):[d,h]},graticule.precision=function(d){return arguments.length?(m=+d,u=graticuleX(a,i,90),l=graticuleY(t,e,m),c=graticuleX(s,o,90),f=graticuleY(n,r,m),graticule):m},graticule.extentMajor([[-180,-90+Xu],[180,90-Xu]]).extentMinor([[-180,-80-Xu],[180,80+Xu]])}var _c,bc,xc,wc,kc=function(e){return e},Sc=Yu(),Ec=Yu(),Cc={point:noop_noop,lineStart:noop_noop,lineEnd:noop_noop,polygonStart:function polygonStart(){Cc.lineStart=area_areaRingStart,Cc.lineEnd=area_areaRingEnd},polygonEnd:function polygonEnd(){Cc.lineStart=Cc.lineEnd=Cc.point=noop_noop,Sc.add(nl(Ec)),Ec.reset()},result:function result(){var e=Sc/2;return Sc.reset(),e}};function area_areaRingStart(){Cc.point=area_areaPointFirst}function area_areaPointFirst(e,t){Cc.point=area_areaPoint,_c=xc=e,bc=wc=t}function area_areaPoint(e,t){Ec.add(wc*e-xc*t),xc=e,wc=t}function area_areaRingEnd(){area_areaPoint(_c,bc)}var Tc=Cc,Oc=1/0,Ac=Oc,Rc=-Oc,Dc=Rc;var Pc,jc,Mc,Fc,Ic={point:function bounds_boundsPoint(e,t){e<Oc&&(Oc=e);e>Rc&&(Rc=e);t<Ac&&(Ac=t);t>Dc&&(Dc=t)},lineStart:noop_noop,lineEnd:noop_noop,polygonStart:noop_noop,polygonEnd:noop_noop,result:function result(){var e=[[Oc,Ac],[Rc,Dc]];return Rc=Dc=-(Ac=Oc=1/0),e}},Lc=0,Nc=0,Bc=0,Uc=0,zc=0,qc=0,Wc=0,Gc=0,Hc=0,Vc={point:centroid_centroidPoint,lineStart:centroid_centroidLineStart,lineEnd:centroid_centroidLineEnd,polygonStart:function polygonStart(){Vc.lineStart=centroid_centroidRingStart,Vc.lineEnd=centroid_centroidRingEnd},polygonEnd:function polygonEnd(){Vc.point=centroid_centroidPoint,Vc.lineStart=centroid_centroidLineStart,Vc.lineEnd=centroid_centroidLineEnd},result:function result(){var e=Hc?[Wc/Hc,Gc/Hc]:qc?[Uc/qc,zc/qc]:Bc?[Lc/Bc,Nc/Bc]:[NaN,NaN];return Lc=Nc=Bc=Uc=zc=qc=Wc=Gc=Hc=0,e}};function centroid_centroidPoint(e,t){Lc+=e,Nc+=t,++Bc}function centroid_centroidLineStart(){Vc.point=centroidPointFirstLine}function centroidPointFirstLine(e,t){Vc.point=centroidPointLine,centroid_centroidPoint(Mc=e,Fc=t)}function centroidPointLine(e,t){var r=e-Mc,n=t-Fc,i=hl(r*r+n*n);Uc+=i*(Mc+e)/2,zc+=i*(Fc+t)/2,qc+=i,centroid_centroidPoint(Mc=e,Fc=t)}function centroid_centroidLineEnd(){Vc.point=centroid_centroidPoint}function centroid_centroidRingStart(){Vc.point=centroidPointFirstRing}function centroid_centroidRingEnd(){centroidPointRing(Pc,jc)}function centroidPointFirstRing(e,t){Vc.point=centroidPointRing,centroid_centroidPoint(Pc=Mc=e,jc=Fc=t)}function centroidPointRing(e,t){var r=e-Mc,n=t-Fc,i=hl(r*r+n*n);Uc+=i*(Mc+e)/2,zc+=i*(Fc+t)/2,qc+=i,Wc+=(i=Fc*e-Mc*t)*(Mc+e),Gc+=i*(Fc+t),Hc+=3*i,centroid_centroidPoint(Mc=e,Fc=t)}var Yc=Vc;function PathContext(e){this._context=e}PathContext.prototype={_radius:4.5,pointRadius:function pointRadius(e){return this._radius=e,this},polygonStart:function polygonStart(){this._line=0},polygonEnd:function polygonEnd(){this._line=NaN},lineStart:function lineStart(){this._point=0},lineEnd:function lineEnd(){0===this._line&&this._context.closePath(),this._point=NaN},point:function point(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,el)}},result:noop_noop};var $c,Xc,Kc,Jc,Qc,Zc=Yu(),ef={point:noop_noop,lineStart:function lineStart(){ef.point=measure_lengthPointFirst},lineEnd:function lineEnd(){$c&&measure_lengthPoint(Xc,Kc),ef.point=noop_noop},polygonStart:function polygonStart(){$c=!0},polygonEnd:function polygonEnd(){$c=null},result:function result(){var e=+Zc;return Zc.reset(),e}};function measure_lengthPointFirst(e,t){ef.point=measure_lengthPoint,Xc=Jc=e,Kc=Qc=t}function measure_lengthPoint(e,t){Jc-=e,Qc-=t,Zc.add(hl(Jc*Jc+Qc*Qc)),Jc=e,Qc=t}var tf=ef;function PathString(){this._string=[]}function string_circle(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}PathString.prototype={_radius:4.5,_circle:string_circle(4.5),pointRadius:function pointRadius(e){return(e=+e)!==this._radius&&(this._radius=e,this._circle=null),this},polygonStart:function polygonStart(){this._line=0},polygonEnd:function polygonEnd(){this._line=NaN},lineStart:function lineStart(){this._point=0},lineEnd:function lineEnd(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function point(e,t){switch(this._point){case 0:this._string.push("M",e,",",t),this._point=1;break;case 1:this._string.push("L",e,",",t);break;default:null==this._circle&&(this._circle=string_circle(this._radius)),this._string.push("M",e,",",t,this._circle)}},result:function result(){if(this._string.length){var result=this._string.join("");return this._string=[],result}return null}};var rf=function(e,t){var r,n,i=4.5;function path(e){return e&&("function"===typeof i&&n.pointRadius(+i.apply(this,arguments)),wl(e,r(n))),n.result()}return path.area=function(e){return wl(e,r(Tc)),Tc.result()},path.measure=function(e){return wl(e,r(tf)),tf.result()},path.bounds=function(e){return wl(e,r(Ic)),Ic.result()},path.centroid=function(e){return wl(e,r(Yc)),Yc.result()},path.projection=function(t){return arguments.length?(r=null==t?(e=null,kc):(e=t).stream,path):e},path.context=function(e){return arguments.length?(n=null==e?(t=null,new PathString):new PathContext(t=e),"function"!==typeof i&&n.pointRadius(i),path):t},path.pointRadius=function(e){return arguments.length?(i="function"===typeof e?e:(n.pointRadius(+e),+e),path):i},path.projection(e).context(t)};function transform_transformer(e){return function(t){var r=new TransformStream;for(var n in e)r[n]=e[n];return r.stream=t,r}}function TransformStream(){}function fit_fit(e,t,r){var n=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),null!=n&&e.clipExtent(null),wl(r,e.stream(Ic)),t(Ic.result()),null!=n&&e.clipExtent(n),e}function fit_fitExtent(e,t,r){return fit_fit(e,(function(r){var n=t[1][0]-t[0][0],i=t[1][1]-t[0][1],a=Math.min(n/(r[1][0]-r[0][0]),i/(r[1][1]-r[0][1])),o=+t[0][0]+(n-a*(r[1][0]+r[0][0]))/2,s=+t[0][1]+(i-a*(r[1][1]+r[0][1]))/2;e.scale(150*a).translate([o,s])}),r)}function fit_fitSize(e,t,r){return fit_fitExtent(e,[[0,0],t],r)}function fit_fitWidth(e,t,r){return fit_fit(e,(function(r){var n=+t,i=n/(r[1][0]-r[0][0]),a=(n-i*(r[1][0]+r[0][0]))/2,o=-i*r[0][1];e.scale(150*i).translate([a,o])}),r)}function fit_fitHeight(e,t,r){return fit_fit(e,(function(r){var n=+t,i=n/(r[1][1]-r[0][1]),a=-i*r[0][0],o=(n-i*(r[1][1]+r[0][1]))/2;e.scale(150*i).translate([a,o])}),r)}TransformStream.prototype={constructor:TransformStream,point:function point(e,t){this.stream.point(e,t)},sphere:function sphere(){this.stream.sphere()},lineStart:function lineStart(){this.stream.lineStart()},lineEnd:function lineEnd(){this.stream.lineEnd()},polygonStart:function polygonStart(){this.stream.polygonStart()},polygonEnd:function polygonEnd(){this.stream.polygonEnd()}};var nf=16,af=ol(30*rl),of=function(e,t){return+t?function resample_resample(e,t){function resampleLineTo(r,n,i,a,o,s,u,l,c,f,d,h,p,g){var m=u-r,v=l-n,y=m*m+v*v;if(y>4*t&&p--){var _=a+f,b=o+d,x=s+h,w=hl(_*_+b*b+x*x),k=math_asin(x/=w),S=nl(nl(x)-1)<Xu||nl(i-c)<Xu?(i+c)/2:al(b,_),E=e(S,k),C=E[0],T=E[1],O=C-r,A=T-n,R=v*O-m*A;(R*R/y>t||nl((m*O+v*A)/y-.5)>.3||a*f+o*d+s*h<af)&&(resampleLineTo(r,n,i,a,o,s,C,T,S,_/=w,b/=w,x,p,g),g.point(C,T),resampleLineTo(C,T,S,_,b,x,u,l,c,f,d,h,p,g))}}return function(t){var r,n,i,a,o,s,u,l,c,f,d,h,p={point:point,lineStart:lineStart,lineEnd:lineEnd,polygonStart:function polygonStart(){t.polygonStart(),p.lineStart=ringStart},polygonEnd:function polygonEnd(){t.polygonEnd(),p.lineStart=lineStart}};function point(r,n){r=e(r,n),t.point(r[0],r[1])}function lineStart(){l=NaN,p.point=linePoint,t.lineStart()}function linePoint(r,n){var i=cartesian_cartesian([r,n]),a=e(r,n);resampleLineTo(l,c,u,f,d,h,l=a[0],c=a[1],u=r,f=i[0],d=i[1],h=i[2],nf,t),t.point(l,c)}function lineEnd(){p.point=point,t.lineEnd()}function ringStart(){lineStart(),p.point=ringPoint,p.lineEnd=ringEnd}function ringPoint(e,t){linePoint(r=e,t),n=l,i=c,a=f,o=d,s=h,p.point=linePoint}function ringEnd(){resampleLineTo(l,c,u,f,d,h,n,i,r,a,o,s,nf,t),p.lineEnd=lineEnd,lineEnd()}return p}}(e,t):function resampleNone(e){return transform_transformer({point:function point(t,r){t=e(t,r),this.stream.point(t[0],t[1])}})}(e)};var sf=transform_transformer({point:function point(e,t){this.stream.point(e*rl,t*rl)}});function scaleTranslate(e,t,r){function transform(n,i){return[t+e*n,r-e*i]}return transform.invert=function(n,i){return[(n-t)/e,(r-i)/e]},transform}function scaleTranslateRotate(e,t,r,n){var i=ol(n),a=fl(n),o=i*e,s=a*e,u=i/e,l=a/e,c=(a*r-i*t)/e,f=(a*t+i*r)/e;function transform(e,n){return[o*e-s*n+t,r-s*e-o*n]}return transform.invert=function(e,t){return[u*e-l*t+c,f-l*e-u*t]},transform}function projection_projection(e){return projectionMutator((function(){return e}))()}function projectionMutator(e){var t,r,n,i,a,o,s,u,l,c,f=150,d=480,h=250,p=0,g=0,m=0,v=0,y=0,_=0,b=null,x=pc,w=null,k=kc,S=.5;function projection(e){return u(e[0]*rl,e[1]*rl)}function invert(e){return(e=u.invert(e[0],e[1]))&&[e[0]*tl,e[1]*tl]}function recenter(){var e=scaleTranslateRotate(f,0,0,_).apply(null,t(p,g)),n=(_?scaleTranslateRotate:scaleTranslate)(f,d-e[0],h-e[1],_);return r=rotateRadians(m,v,y),s=tc(t,n),u=tc(r,s),o=of(s,S),reset()}function reset(){return l=c=null,projection}return projection.stream=function(e){return l&&c===e?l:l=sf(function transformRotate(e){return transform_transformer({point:function point(t,r){var n=e(t,r);return this.stream.point(n[0],n[1])}})}(r)(x(o(k(c=e)))))},projection.preclip=function(e){return arguments.length?(x=e,b=void 0,reset()):x},projection.postclip=function(e){return arguments.length?(k=e,w=n=i=a=null,reset()):k},projection.clipAngle=function(e){return arguments.length?(x=+e?gc(b=e*rl):(b=null,pc),reset()):b*tl},projection.clipExtent=function(e){return arguments.length?(k=null==e?(w=n=i=a=null,kc):clipRectangle(w=+e[0][0],n=+e[0][1],i=+e[1][0],a=+e[1][1]),reset()):null==w?null:[[w,n],[i,a]]},projection.scale=function(e){return arguments.length?(f=+e,recenter()):f},projection.translate=function(e){return arguments.length?(d=+e[0],h=+e[1],recenter()):[d,h]},projection.center=function(e){return arguments.length?(p=e[0]%360*rl,g=e[1]%360*rl,recenter()):[p*tl,g*tl]},projection.rotate=function(e){return arguments.length?(m=e[0]%360*rl,v=e[1]%360*rl,y=e.length>2?e[2]%360*rl:0,recenter()):[m*tl,v*tl,y*tl]},projection.angle=function(e){return arguments.length?(_=e%360*rl,recenter()):_*tl},projection.precision=function(e){return arguments.length?(o=of(s,S=e*e),reset()):hl(S)},projection.fitExtent=function(e,t){return fit_fitExtent(projection,e,t)},projection.fitSize=function(e,t){return fit_fitSize(projection,e,t)},projection.fitWidth=function(e,t){return fit_fitWidth(projection,e,t)},projection.fitHeight=function(e,t){return fit_fitHeight(projection,e,t)},function(){return t=e.apply(this,arguments),projection.invert=t.invert&&invert,recenter()}}function conicProjection(e){var t=0,r=Ju/3,n=projectionMutator(e),i=n(t,r);return i.parallels=function(e){return arguments.length?n(t=e[0]*rl,r=e[1]*rl):[t*tl,r*tl]},i}function conicEqualAreaRaw(e,t){var r=fl(e),n=(r+fl(t))/2;if(nl(n)<Xu)return function cylindricalEqualAreaRaw(e){var t=ol(e);function forward(e,r){return[e*t,fl(r)/t]}return forward.invert=function(e,r){return[e/t,math_asin(r*t)]},forward}(e);var i=1+r*(2*n-r),a=hl(i)/n;function project(e,t){var r=hl(i-2*n*fl(t))/n;return[r*fl(e*=n),a-r*ol(e)]}return project.invert=function(e,t){var r=a-t;return[al(e,nl(r))/n*dl(r),math_asin((i-(e*e+r*r)*n*n)/(2*n))]},project}var uf=function(){return conicProjection(conicEqualAreaRaw).scale(155.424).center([0,33.6442])},lf=function(){return uf().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])};function azimuthalRaw(e){return function(t,r){var n=ol(t),i=ol(r),a=e(n*i);return[a*i*fl(t),a*fl(r)]}}function azimuthalInvert(e){return function(t,r){var n=hl(t*t+r*r),i=e(n),a=fl(i),o=ol(i);return[al(t*a,n*o),math_asin(n&&r*a/n)]}}var cf=azimuthalRaw((function(e){return hl(2/(1+e))}));cf.invert=azimuthalInvert((function(e){return 2*math_asin(e/2)}));var ff=azimuthalRaw((function(e){return(e=math_acos(e))&&e/fl(e)}));ff.invert=azimuthalInvert((function(e){return e}));function mercatorRaw(e,t){return[e,ll(pl((Qu+t)/2))]}mercatorRaw.invert=function(e,t){return[e,2*il(ul(t))-Qu]};function mercatorProjection(e){var t,r,n,i=projection_projection(e),a=i.center,o=i.scale,s=i.translate,u=i.clipExtent,l=null;function reclip(){var a=Ju*o(),s=i(rc(i.rotate()).invert([0,0]));return u(null==l?[[s[0]-a,s[1]-a],[s[0]+a,s[1]+a]]:e===mercatorRaw?[[Math.max(s[0]-a,l),t],[Math.min(s[0]+a,r),n]]:[[l,Math.max(s[1]-a,t)],[r,Math.min(s[1]+a,n)]])}return i.scale=function(e){return arguments.length?(o(e),reclip()):o()},i.translate=function(e){return arguments.length?(s(e),reclip()):s()},i.center=function(e){return arguments.length?(a(e),reclip()):a()},i.clipExtent=function(e){return arguments.length?(null==e?l=t=r=n=null:(l=+e[0][0],t=+e[0][1],r=+e[1][0],n=+e[1][1]),reclip()):null==l?null:[[l,t],[r,n]]},reclip()}function tany(e){return pl((Qu+e)/2)}function conicConformalRaw(e,t){var r=ol(e),n=e===t?fl(e):ll(r/ol(t))/ll(tany(t)/tany(e)),i=r*cl(tany(e),n)/n;if(!n)return mercatorRaw;function project(e,t){i>0?t<-Qu+Xu&&(t=-Qu+Xu):t>Qu-Xu&&(t=Qu-Xu);var r=i/cl(tany(t),n);return[r*fl(n*e),i-r*ol(n*e)]}return project.invert=function(e,t){var r=i-t,a=dl(n)*hl(e*e+r*r);return[al(e,nl(r))/n*dl(r),2*il(cl(i/a,1/n))-Qu]},project}function equirectangularRaw(e,t){return[e,t]}equirectangularRaw.invert=equirectangularRaw;function conicEquidistantRaw(e,t){var r=ol(e),n=e===t?fl(e):(r-ol(t))/(t-e),i=r/n+e;if(nl(n)<Xu)return equirectangularRaw;function project(e,t){var r=i-t,a=n*e;return[r*fl(a),i-r*ol(a)]}return project.invert=function(e,t){var r=i-t;return[al(e,nl(r))/n*dl(r),i-dl(n)*hl(e*e+r*r)]},project}var df=1.340264,hf=-.081106,pf=893e-6,gf=.003796,mf=hl(3)/2;function equalEarthRaw(e,t){var r=math_asin(mf*fl(t)),n=r*r,i=n*n*n;return[e*ol(r)/(mf*(df+3*hf*n+i*(7*pf+9*gf*n))),r*(df+hf*n+i*(pf+gf*n))]}equalEarthRaw.invert=function(e,t){for(var r,n=t,i=n*n,a=i*i*i,o=0;o<12&&(a=(i=(n-=r=(n*(df+hf*i+a*(pf+gf*i))-t)/(df+3*hf*i+a*(7*pf+9*gf*i)))*n)*i*i,!(nl(r)<Ku));++o);return[mf*e*(df+3*hf*i+a*(7*pf+9*gf*i))/ol(n),math_asin(fl(n)/mf)]};function gnomonicRaw(e,t){var r=ol(t),n=ol(e)*r;return[r*fl(e)/n,fl(t)/n]}gnomonicRaw.invert=azimuthalInvert(il);function identity_scaleTranslate(e,t,r,n){return 1===e&&1===t&&0===r&&0===n?kc:transform_transformer({point:function point(i,a){this.stream.point(i*e+r,a*t+n)}})}function naturalEarth1Raw(e,t){var r=t*t,n=r*r;return[e*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791)),t*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))]}naturalEarth1Raw.invert=function(e,t){var r,n=t,i=25;do{var a=n*n,o=a*a;n-=r=(n*(1.007226+a*(.015085+o*(.028874*a-.044475-.005916*o)))-t)/(1.007226+a*(.045255+o*(.259866*a-.311325-.005916*11*o)))}while(nl(r)>Xu&&--i>0);return[e/(.8707+(a=n*n)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),n]};function orthographicRaw(e,t){return[ol(t)*fl(e),fl(t)]}orthographicRaw.invert=azimuthalInvert(math_asin);function stereographicRaw(e,t){var r=ol(t),n=1+ol(e)*r;return[r*fl(e)/n,fl(t)/n]}stereographicRaw.invert=azimuthalInvert((function(e){return 2*il(e)}));function transverseMercatorRaw(e,t){return[ll(pl((Qu+t)/2)),-e]}transverseMercatorRaw.invert=function(e,t){return[-t,2*il(ul(e))-Qu]};var vf=rf(),yf=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function projections_projection(e,t){if(!e||"string"!==typeof e)throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(_f[e]=function projections_create(e,t){return function projection(){var r=t();return r.type=e,r.path=rf().projection(r),r.copy=r.copy||function(){var e=projection();return yf.forEach((function(t){r[t]&&e[t](r[t]())})),e.path.pointRadius(r.path.pointRadius()),e},r}}(e,t),this):_f[e]||null}function getProjectionPath(e){return e&&e.path||vf}var _f={albers:lf,albersusa:function(){var e,t,r,n,i,a,o=lf(),s=uf().rotate([154,0]).center([-2,58.5]).parallels([55,65]),u=uf().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function point(e,t){a=[e,t]}};function albersUsa(e){var t=e[0],o=e[1];return a=null,r.point(t,o),a||(n.point(t,o),a)||(i.point(t,o),a)}function reset(){return e=t=null,albersUsa}return albersUsa.invert=function(e){var t=o.scale(),r=o.translate(),n=(e[0]-r[0])/t,i=(e[1]-r[1])/t;return(i>=.12&&i<.234&&n>=-.425&&n<-.214?s:i>=.166&&i<.234&&n>=-.214&&n<-.115?u:o).invert(e)},albersUsa.stream=function(r){return e&&t===r?e:e=function multiplex(e){var t=e.length;return{point:function point(r,n){for(var i=-1;++i<t;)e[i].point(r,n)},sphere:function sphere(){for(var r=-1;++r<t;)e[r].sphere()},lineStart:function lineStart(){for(var r=-1;++r<t;)e[r].lineStart()},lineEnd:function lineEnd(){for(var r=-1;++r<t;)e[r].lineEnd()},polygonStart:function polygonStart(){for(var r=-1;++r<t;)e[r].polygonStart()},polygonEnd:function polygonEnd(){for(var r=-1;++r<t;)e[r].polygonEnd()}}}([o.stream(t=r),s.stream(r),u.stream(r)])},albersUsa.precision=function(e){return arguments.length?(o.precision(e),s.precision(e),u.precision(e),reset()):o.precision()},albersUsa.scale=function(e){return arguments.length?(o.scale(e),s.scale(.35*e),u.scale(e),albersUsa.translate(o.translate())):o.scale()},albersUsa.translate=function(e){if(!arguments.length)return o.translate();var t=o.scale(),a=+e[0],c=+e[1];return r=o.translate(e).clipExtent([[a-.455*t,c-.238*t],[a+.455*t,c+.238*t]]).stream(l),n=s.translate([a-.307*t,c+.201*t]).clipExtent([[a-.425*t+Xu,c+.12*t+Xu],[a-.214*t-Xu,c+.234*t-Xu]]).stream(l),i=u.translate([a-.205*t,c+.212*t]).clipExtent([[a-.214*t+Xu,c+.166*t+Xu],[a-.115*t-Xu,c+.234*t-Xu]]).stream(l),reset()},albersUsa.fitExtent=function(e,t){return fit_fitExtent(albersUsa,e,t)},albersUsa.fitSize=function(e,t){return fit_fitSize(albersUsa,e,t)},albersUsa.fitWidth=function(e,t){return fit_fitWidth(albersUsa,e,t)},albersUsa.fitHeight=function(e,t){return fit_fitHeight(albersUsa,e,t)},albersUsa.scale(1070)},azimuthalequalarea:function(){return projection_projection(cf).scale(124.75).clipAngle(179.999)},azimuthalequidistant:function(){return projection_projection(ff).scale(79.4188).clipAngle(179.999)},conicconformal:function(){return conicProjection(conicConformalRaw).scale(109.5).parallels([30,30])},conicequalarea:uf,conicequidistant:function(){return conicProjection(conicEquidistantRaw).scale(131.154).center([0,13.9389])},equalEarth:function(){return projection_projection(equalEarthRaw).scale(177.158)},equirectangular:function(){return projection_projection(equirectangularRaw).scale(152.63)},gnomonic:function(){return projection_projection(gnomonicRaw).scale(144.049).clipAngle(60)},identity:function(){var e,t,r,n,i,a,o=1,s=0,u=0,l=1,c=1,f=kc,d=null,h=kc;function reset(){return n=i=null,a}return a={stream:function stream(e){return n&&i===e?n:n=f(h(i=e))},postclip:function postclip(n){return arguments.length?(h=n,d=e=t=r=null,reset()):h},clipExtent:function clipExtent(n){return arguments.length?(h=null==n?(d=e=t=r=null,kc):clipRectangle(d=+n[0][0],e=+n[0][1],t=+n[1][0],r=+n[1][1]),reset()):null==d?null:[[d,e],[t,r]]},scale:function scale(e){return arguments.length?(f=identity_scaleTranslate((o=+e)*l,o*c,s,u),reset()):o},translate:function translate(e){return arguments.length?(f=identity_scaleTranslate(o*l,o*c,s=+e[0],u=+e[1]),reset()):[s,u]},reflectX:function reflectX(e){return arguments.length?(f=identity_scaleTranslate(o*(l=e?-1:1),o*c,s,u),reset()):l<0},reflectY:function reflectY(e){return arguments.length?(f=identity_scaleTranslate(o*l,o*(c=e?-1:1),s,u),reset()):c<0},fitExtent:function fitExtent(e,t){return fit_fitExtent(a,e,t)},fitSize:function fitSize(e,t){return fit_fitSize(a,e,t)},fitWidth:function fitWidth(e,t){return fit_fitWidth(a,e,t)},fitHeight:function fitHeight(e,t){return fit_fitHeight(a,e,t)}}},mercator:function(){return mercatorProjection(mercatorRaw).scale(961/el)},naturalEarth1:function(){return projection_projection(naturalEarth1Raw).scale(175.295)},orthographic:function(){return projection_projection(orthographicRaw).scale(249.5).clipAngle(90+Xu)},stereographic:function(){return projection_projection(stereographicRaw).scale(250).clipAngle(142)},transversemercator:function(){var e=mercatorProjection(transverseMercatorRaw),t=e.center,r=e.rotate;return e.center=function(e){return arguments.length?t([-e[1],e[0]]):[(e=t())[1],-e[0]]},e.rotate=function(e){return arguments.length?r([e[0],e[1],e.length>2?e[2]+90:90]):[(e=r())[0],e[1],e[2]-90]},r([0,0,90]).scale(159.155)}};for(var bf in _f)projections_projection(bf,_f[bf]);function GeoPath(e){Transform.call(this,null,e)}function GeoPoint(e){Transform.call(this,null,e)}function GeoShape(e){Transform.call(this,null,e)}function Graticule(e){Transform.call(this,[],e),this.generator=graticule_graticule()}function Projection(e){Transform.call(this,null,e),this.modified(!0)}function Projection_set(e,t,r){Object(V.D)(e[t])&&e[t](r)}GeoPath.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]},Object(V.y)(GeoPath,Transform).transform=function(e,t){var r=t.fork(t.ALL),n=this.value,i=e.field||V.x,a=e.as||"path",o=r.SOURCE;!n||e.modified()?(this.value=n=getProjectionPath(e.projection),r.materialize().reflow()):o=i===V.x||t.modified(i.fields)?r.ADD_MOD:r.ADD;var s=function initPath(e,t){var r=e.pointRadius();e.context(null),null!=t&&e.pointRadius(t);return r}(n,e.pointRadius);return r.visit(o,(function set(e){e[a]=n(i(e))})),n.pointRadius(s),r.modifies(a)},GeoPoint.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]},Object(V.y)(GeoPoint,Transform).transform=function(e,t){var r,n=e.projection,i=e.fields[0],a=e.fields[1],o=e.as||["x","y"],s=o[0],u=o[1];function set(e){var t=n([i(e),a(e)]);t?(e[s]=t[0],e[u]=t[1]):(e[s]=void 0,e[u]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,set):(r=t.modified(i.fields)||t.modified(a.fields),t.visit(r?t.ADD_MOD:t.ADD,set)),t.modifies(o)},GeoShape.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]},Object(V.y)(GeoShape,Transform).transform=function(e,t){var r=t.fork(t.ALL),n=this.value,i=e.as||"shape",a=r.ADD;return n&&!e.modified()||(this.value=n=function shapeGenerator(e,t,r){var n=null==r?function(r){return e(t(r))}:function(n){var i=e.pointRadius(),a=e.pointRadius(r)(t(n));return e.pointRadius(i),a};return n.context=function(t){return e.context(t),n},n}(getProjectionPath(e.projection),e.field||Object(V.t)("datum"),e.pointRadius),r.materialize().reflow(),a=r.SOURCE),r.visit(a,(function(e){e[i]=n})),r.modifies(i)},Graticule.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]},Object(V.y)(Graticule,Transform).transform=function(e,t){var r,n=this.value,i=this.generator;if(!n.length||e.modified())for(var a in e)Object(V.D)(i[a])&&i[a](e[a]);return r=i(),n.length?t.mod.push(replace(n[0],r)):t.add.push(ingest(r)),n[0]=r,t},Object(V.y)(Projection,Transform).transform=function(e,t){var r=this.value;return!r||e.modified("type")?(this.value=r=function Projection_create(e){var t=projections_projection((e||"mercator").toLowerCase());t||Object(V.n)("Unrecognized projection type: "+e);return t()}(e.type),yf.forEach((function(t){null!=e[t]&&Projection_set(r,t,e[t])}))):yf.forEach((function(t){e.modified(t)&&Projection_set(r,t,e[t])})),null!=e.pointRadius&&r.path.pointRadius(e.pointRadius),e.fit&&function Projection_fit(e,t){var r=function collectGeoJSON(e){return 1===(e=Object(V.i)(e)).length?e[0]:{type:Vu,features:e.reduce((function(e,t){return e.concat(function featurize(e){return e.type===Vu?e.features:Object(V.i)(e).filter((function(e){return null!=e})).map((function(e){return e.type===Hu?e:{type:Hu,geometry:e}}))}(t))}),[])}}(t.fit);t.extent?e.fitExtent(t.extent,r):t.size&&e.fitSize(t.size,r)}(r,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)};function add_add(e,t,r,n){if(isNaN(t)||isNaN(r))return e;var i,a,o,s,u,l,c,f,d,h=e._root,p={data:n},g=e._x0,m=e._y0,v=e._x1,y=e._y1;if(!h)return e._root=p,e;for(;h.length;)if((l=t>=(a=(g+v)/2))?g=a:v=a,(c=r>=(o=(m+y)/2))?m=o:y=o,i=h,!(h=h[f=c<<1|l]))return i[f]=p,e;if(s=+e._x.call(null,h.data),u=+e._y.call(null,h.data),t===s&&r===u)return p.next=h,i?i[f]=p:e._root=p,e;do{i=i?i[f]=new Array(4):e._root=new Array(4),(l=t>=(a=(g+v)/2))?g=a:v=a,(c=r>=(o=(m+y)/2))?m=o:y=o}while((f=c<<1|l)===(d=(u>=o)<<1|s>=a));return i[d]=h,i[f]=p,e}var xf=function(e,t,r,n,i){this.node=e,this.x0=t,this.y0=r,this.x1=n,this.y1=i};function x_defaultX(e){return e[0]}function y_defaultY(e){return e[1]}function quadtree(e,t,r){var n=new Quadtree(null==t?x_defaultX:t,null==r?y_defaultY:r,NaN,NaN,NaN,NaN);return null==e?n:n.addAll(e)}function Quadtree(e,t,r,n,i,a){this._x=e,this._y=t,this._x0=r,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function leaf_copy(e){for(var t={data:e.data},r=t;e=e.next;)r=r.next={data:e.data};return t}var wf=quadtree.prototype=Quadtree.prototype;wf.copy=function(){var e,t,r=new Quadtree(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=leaf_copy(n),r;for(e=[{source:n,target:r._root=new Array(4)}];n=e.pop();)for(var i=0;i<4;++i)(t=n.source[i])&&(t.length?e.push({source:t,target:n.target[i]=new Array(4)}):n.target[i]=leaf_copy(t));return r},wf.add=function(e){var t=+this._x.call(null,e),r=+this._y.call(null,e);return add_add(this.cover(t,r),t,r,e)},wf.addAll=function addAll(e){var t,r,n,i,a=e.length,o=new Array(a),s=new Array(a),u=1/0,l=1/0,c=-1/0,f=-1/0;for(r=0;r<a;++r)isNaN(n=+this._x.call(null,t=e[r]))||isNaN(i=+this._y.call(null,t))||(o[r]=n,s[r]=i,n<u&&(u=n),n>c&&(c=n),i<l&&(l=i),i>f&&(f=i));if(u>c||l>f)return this;for(this.cover(u,l).cover(c,f),r=0;r<a;++r)add_add(this,o[r],s[r],e[r]);return this},wf.cover=function(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var r=this._x0,n=this._y0,i=this._x1,a=this._y1;if(isNaN(r))i=(r=Math.floor(e))+1,a=(n=Math.floor(t))+1;else{for(var o,s,u=i-r,l=this._root;r>e||e>=i||n>t||t>=a;)switch(s=(t<n)<<1|e<r,(o=new Array(4))[s]=l,l=o,u*=2,s){case 0:i=r+u,a=n+u;break;case 1:r=i-u,a=n+u;break;case 2:i=r+u,n=a-u;break;case 3:r=i-u,n=a-u}this._root&&this._root.length&&(this._root=l)}return this._x0=r,this._y0=n,this._x1=i,this._y1=a,this},wf.data=function(){var e=[];return this.visit((function(t){if(!t.length)do{e.push(t.data)}while(t=t.next)})),e},wf.extent=function(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},wf.find=function(e,t,r){var n,i,a,o,s,u,l,c=this._x0,f=this._y0,d=this._x1,h=this._y1,p=[],g=this._root;for(g&&p.push(new xf(g,c,f,d,h)),null==r?r=1/0:(c=e-r,f=t-r,d=e+r,h=t+r,r*=r);u=p.pop();)if(!(!(g=u.node)||(i=u.x0)>d||(a=u.y0)>h||(o=u.x1)<c||(s=u.y1)<f))if(g.length){var m=(i+o)/2,v=(a+s)/2;p.push(new xf(g[3],m,v,o,s),new xf(g[2],i,v,m,s),new xf(g[1],m,a,o,v),new xf(g[0],i,a,m,v)),(l=(t>=v)<<1|e>=m)&&(u=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=u)}else{var y=e-+this._x.call(null,g.data),_=t-+this._y.call(null,g.data),b=y*y+_*_;if(b<r){var x=Math.sqrt(r=b);c=e-x,f=t-x,d=e+x,h=t+x,n=g.data}}return n},wf.remove=function(e){if(isNaN(a=+this._x.call(null,e))||isNaN(o=+this._y.call(null,e)))return this;var t,r,n,i,a,o,s,u,l,c,f,d,h=this._root,p=this._x0,g=this._y0,m=this._x1,v=this._y1;if(!h)return this;if(h.length)for(;;){if((l=a>=(s=(p+m)/2))?p=s:m=s,(c=o>=(u=(g+v)/2))?g=u:v=u,t=h,!(h=h[f=c<<1|l]))return this;if(!h.length)break;(t[f+1&3]||t[f+2&3]||t[f+3&3])&&(r=t,d=f)}for(;h.data!==e;)if(n=h,!(h=h.next))return this;return(i=h.next)&&delete h.next,n?(i?n.next=i:delete n.next,this):t?(i?t[f]=i:delete t[f],(h=t[0]||t[1]||t[2]||t[3])&&h===(t[3]||t[2]||t[1]||t[0])&&!h.length&&(r?r[d]=h:this._root=h),this):(this._root=i,this)},wf.removeAll=function removeAll(e){for(var t=0,r=e.length;t<r;++t)this.remove(e[t]);return this},wf.root=function(){return this._root},wf.size=function(){var e=0;return this.visit((function(t){if(!t.length)do{++e}while(t=t.next)})),e},wf.visit=function(e){var t,r,n,i,a,o,s=[],u=this._root;for(u&&s.push(new xf(u,this._x0,this._y0,this._x1,this._y1));t=s.pop();)if(!e(u=t.node,n=t.x0,i=t.y0,a=t.x1,o=t.y1)&&u.length){var l=(n+a)/2,c=(i+o)/2;(r=u[3])&&s.push(new xf(r,l,c,a,o)),(r=u[2])&&s.push(new xf(r,n,c,l,o)),(r=u[1])&&s.push(new xf(r,l,i,a,c)),(r=u[0])&&s.push(new xf(r,n,i,l,c))}return this},wf.visitAfter=function(e){var t,r=[],n=[];for(this._root&&r.push(new xf(this._root,this._x0,this._y0,this._x1,this._y1));t=r.pop();){var i=t.node;if(i.length){var a,o=t.x0,s=t.y0,u=t.x1,l=t.y1,c=(o+u)/2,f=(s+l)/2;(a=i[0])&&r.push(new xf(a,o,s,c,f)),(a=i[1])&&r.push(new xf(a,c,s,u,f)),(a=i[2])&&r.push(new xf(a,o,f,c,l)),(a=i[3])&&r.push(new xf(a,c,f,u,l))}n.push(t)}for(;t=n.pop();)e(t.node,t.x0,t.y0,t.x1,t.y1);return this},wf.x=function(e){return arguments.length?(this._x=e,this):this._x},wf.y=function(e){return arguments.length?(this._y=e,this):this._y};var kf=function(e){return function(){return e}},Sf=function(){return 1e-6*(Math.random()-.5)};function collide_x(e){return e.x+e.vx}function collide_y(e){return e.y+e.vy}function link_index(e){return e.index}function link_find(e,t){var r=e.get(t);if(!r)throw new Error("missing: "+t);return r}var Ef={value:function value(){}};function dispatch_dispatch(){for(var e,t=0,r=arguments.length,n={};t<r;++t){if(!(e=arguments[t]+"")||e in n)throw new Error("illegal type: "+e);n[e]=[]}return new Dispatch(n)}function Dispatch(e){this._=e}function dispatch_parseTypenames(e,t){return e.trim().split(/^|\s+/).map((function(e){var r="",n=e.indexOf(".");if(n>=0&&(r=e.slice(n+1),e=e.slice(0,n)),e&&!t.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:r}}))}function dispatch_get(e,t){for(var r,n=0,i=e.length;n<i;++n)if((r=e[n]).name===t)return r.value}function dispatch_set(e,t,r){for(var n=0,i=e.length;n<i;++n)if(e[n].name===t){e[n]=Ef,e=e.slice(0,n).concat(e.slice(n+1));break}return null!=r&&e.push({name:t,value:r}),e}Dispatch.prototype=dispatch_dispatch.prototype={constructor:Dispatch,on:function on(e,t){var r,n=this._,i=dispatch_parseTypenames(e+"",n),a=-1,o=i.length;if(!(arguments.length<2)){if(null!=t&&"function"!==typeof t)throw new Error("invalid callback: "+t);for(;++a<o;)if(r=(e=i[a]).type)n[r]=dispatch_set(n[r],e.name,t);else if(null==t)for(r in n)n[r]=dispatch_set(n[r],e.name,null);return this}for(;++a<o;)if((r=(e=i[a]).type)&&(r=dispatch_get(n[r],e.name)))return r},copy:function copy(){var copy={},e=this._;for(var t in e)copy[t]=e[t].slice();return new Dispatch(copy)},call:function call(e,t){if((r=arguments.length-2)>0)for(var r,n,i=new Array(r),a=0;a<r;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=0,r=(n=this._[e]).length;a<r;++a)n[a].value.apply(t,i)},apply:function apply(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var n=this._[e],i=0,a=n.length;i<a;++i)n[i].value.apply(t,r)}};var Cf,Tf,Of=dispatch_dispatch,Af=0,Rf=0,Df=0,Pf=1e3,jf=0,Mf=0,Ff=0,If="object"===typeof performance&&performance.now?performance:Date,Lf="object"===typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function now(){return Mf||(Lf(clearNow),Mf=If.now()+Ff)}function clearNow(){Mf=0}function Timer(){this._call=this._time=this._next=null}function timer(e,t,r){var n=new Timer;return n.restart(e,t,r),n}function wake(){Mf=(jf=If.now())+Ff,Af=Rf=0;try{!function timerFlush(){now(),++Af;for(var e,t=Cf;t;)(e=Mf-t._time)>=0&&t._call.call(null,e),t=t._next;--Af}()}finally{Af=0,function nap(){var e,t,r=Cf,n=1/0;for(;r;)r._call?(n>r._time&&(n=r._time),e=r,r=r._next):(t=r._next,r._next=null,r=e?e._next=t:Cf=t);Tf=e,sleep(n)}(),Mf=0}}function poke(){var e=If.now(),t=e-jf;t>Pf&&(Ff-=t,jf=e)}function sleep(e){Af||(Rf&&(Rf=clearTimeout(Rf)),e-Mf>24?(e<1/0&&(Rf=setTimeout(wake,e-If.now()-Ff)),Df&&(Df=clearInterval(Df))):(Df||(jf=If.now(),Df=setInterval(poke,Pf)),Af=1,Lf(wake)))}Timer.prototype=timer.prototype={constructor:Timer,restart:function restart(e,t,r){if("function"!==typeof e)throw new TypeError("callback is not a function");r=(null==r?now():+r)+(null==t?0:+t),this._next||Tf===this||(Tf?Tf._next=this:Cf=this,Tf=this),this._call=e,this._time=r,sleep()},stop:function stop(){this._call&&(this._call=null,this._time=1/0,sleep())}};function simulation_x(e){return e.x}function simulation_y(e){return e.y}var Nf=10,Bf=Math.PI*(3-Math.sqrt(5)),Uf=function(e){var t,r=1,n=.001,i=1-Math.pow(n,1/300),a=0,o=.6,s=new Map,u=timer(step),l=Of("tick","end");function step(){tick(),l.call("tick",t),r<n&&(u.stop(),l.call("end",t))}function tick(n){var u,l,c=e.length;void 0===n&&(n=1);for(var f=0;f<n;++f)for(r+=(a-r)*i,s.forEach((function(e){e(r)})),u=0;u<c;++u)null==(l=e[u]).fx?l.x+=l.vx*=o:(l.x=l.fx,l.vx=0),null==l.fy?l.y+=l.vy*=o:(l.y=l.fy,l.vy=0);return t}function initializeNodes(){for(var t,r=0,n=e.length;r<n;++r){if((t=e[r]).index=r,null!=t.fx&&(t.x=t.fx),null!=t.fy&&(t.y=t.fy),isNaN(t.x)||isNaN(t.y)){var i=Nf*Math.sqrt(r),a=r*Bf;t.x=i*Math.cos(a),t.y=i*Math.sin(a)}(isNaN(t.vx)||isNaN(t.vy))&&(t.vx=t.vy=0)}}function initializeForce(t){return t.initialize&&t.initialize(e),t}return null==e&&(e=[]),initializeNodes(),t={tick:tick,restart:function restart(){return u.restart(step),t},stop:function stop(){return u.stop(),t},nodes:function nodes(r){return arguments.length?(e=r,initializeNodes(),s.forEach(initializeForce),t):e},alpha:function alpha(e){return arguments.length?(r=+e,t):r},alphaMin:function alphaMin(e){return arguments.length?(n=+e,t):n},alphaDecay:function alphaDecay(e){return arguments.length?(i=+e,t):+i},alphaTarget:function alphaTarget(e){return arguments.length?(a=+e,t):a},velocityDecay:function velocityDecay(e){return arguments.length?(o=1-e,t):1-o},force:function force(e,r){return arguments.length>1?(null==r?s.delete(e):s.set(e,initializeForce(r)),t):s.get(e)},find:function find(t,r,n){var i,a,o,s,u,l=0,c=e.length;for(null==n?n=1/0:n*=n,l=0;l<c;++l)(o=(i=t-(s=e[l]).x)*i+(a=r-s.y)*a)<n&&(u=s,n=o);return u},on:function on(e,r){return arguments.length>1?(l.on(e,r),t):l.on(e)}}},zf={center:function(e,t){var r;function force(){var n,i,a=r.length,o=0,s=0;for(n=0;n<a;++n)o+=(i=r[n]).x,s+=i.y;for(o=o/a-e,s=s/a-t,n=0;n<a;++n)(i=r[n]).x-=o,i.y-=s}return null==e&&(e=0),null==t&&(t=0),force.initialize=function(e){r=e},force.x=function(t){return arguments.length?(e=+t,force):e},force.y=function(e){return arguments.length?(t=+e,force):t},force},collide:function(e){var t,r,n=1,i=1;function force(){for(var e,a,o,s,u,l,c,f=t.length,d=0;d<i;++d)for(a=quadtree(t,collide_x,collide_y).visitAfter(prepare),e=0;e<f;++e)o=t[e],l=r[o.index],c=l*l,s=o.x+o.vx,u=o.y+o.vy,a.visit(apply);function apply(e,t,r,i,a){var f=e.data,d=e.r,h=l+d;if(!f)return t>s+h||i<s-h||r>u+h||a<u-h;if(f.index>o.index){var p=s-f.x-f.vx,g=u-f.y-f.vy,m=p*p+g*g;m<h*h&&(0===p&&(m+=(p=Sf())*p),0===g&&(m+=(g=Sf())*g),m=(h-(m=Math.sqrt(m)))/m*n,o.vx+=(p*=m)*(h=(d*=d)/(c+d)),o.vy+=(g*=m)*h,f.vx-=p*(h=1-h),f.vy-=g*h)}}}function prepare(e){if(e.data)return e.r=r[e.data.index];for(var t=e.r=0;t<4;++t)e[t]&&e[t].r>e.r&&(e.r=e[t].r)}function initialize(){if(t){var n,i,a=t.length;for(r=new Array(a),n=0;n<a;++n)i=t[n],r[i.index]=+e(i,n,t)}}return"function"!==typeof e&&(e=kf(null==e?1:+e)),force.initialize=function(e){t=e,initialize()},force.iterations=function(e){return arguments.length?(i=+e,force):i},force.strength=function(e){return arguments.length?(n=+e,force):n},force.radius=function(t){return arguments.length?(e="function"===typeof t?t:kf(+t),initialize(),force):e},force},nbody:function(){var e,t,r,n,i=kf(-30),a=1,o=1/0,s=.81;function force(n){var i,a=e.length,o=quadtree(e,simulation_x,simulation_y).visitAfter(accumulate);for(r=n,i=0;i<a;++i)t=e[i],o.visit(apply)}function initialize(){if(e){var t,r,a=e.length;for(n=new Array(a),t=0;t<a;++t)r=e[t],n[r.index]=+i(r,t,e)}}function accumulate(e){var t,r,i,a,o,s=0,u=0;if(e.length){for(i=a=o=0;o<4;++o)(t=e[o])&&(r=Math.abs(t.value))&&(s+=t.value,u+=r,i+=r*t.x,a+=r*t.y);e.x=i/u,e.y=a/u}else{(t=e).x=t.data.x,t.y=t.data.y;do{s+=n[t.data.index]}while(t=t.next)}e.value=s}function apply(e,i,u,l){if(!e.value)return!0;var c=e.x-t.x,f=e.y-t.y,d=l-i,h=c*c+f*f;if(d*d/s<h)return h<o&&(0===c&&(h+=(c=Sf())*c),0===f&&(h+=(f=Sf())*f),h<a&&(h=Math.sqrt(a*h)),t.vx+=c*e.value*r/h,t.vy+=f*e.value*r/h),!0;if(!(e.length||h>=o)){(e.data!==t||e.next)&&(0===c&&(h+=(c=Sf())*c),0===f&&(h+=(f=Sf())*f),h<a&&(h=Math.sqrt(a*h)));do{e.data!==t&&(d=n[e.data.index]*r/h,t.vx+=c*d,t.vy+=f*d)}while(e=e.next)}}return force.initialize=function(t){e=t,initialize()},force.strength=function(e){return arguments.length?(i="function"===typeof e?e:kf(+e),initialize(),force):i},force.distanceMin=function(e){return arguments.length?(a=e*e,force):Math.sqrt(a)},force.distanceMax=function(e){return arguments.length?(o=e*e,force):Math.sqrt(o)},force.theta=function(e){return arguments.length?(s=e*e,force):Math.sqrt(s)},force},link:function(e){var t,r,n,i,a,o=link_index,s=function defaultStrength(e){return 1/Math.min(i[e.source.index],i[e.target.index])},u=kf(30),l=1;function force(n){for(var i=0,o=e.length;i<l;++i)for(var s,u,c,f,d,h,p,g=0;g<o;++g)u=(s=e[g]).source,f=(c=s.target).x+c.vx-u.x-u.vx||Sf(),d=c.y+c.vy-u.y-u.vy||Sf(),f*=h=((h=Math.sqrt(f*f+d*d))-r[g])/h*n*t[g],d*=h,c.vx-=f*(p=a[g]),c.vy-=d*p,u.vx+=f*(p=1-p),u.vy+=d*p}function initialize(){if(n){var s,u,l=n.length,c=e.length,f=new Map(n.map((function(e,t){return[o(e,t,n),e]})));for(s=0,i=new Array(l);s<c;++s)(u=e[s]).index=s,"object"!==typeof u.source&&(u.source=link_find(f,u.source)),"object"!==typeof u.target&&(u.target=link_find(f,u.target)),i[u.source.index]=(i[u.source.index]||0)+1,i[u.target.index]=(i[u.target.index]||0)+1;for(s=0,a=new Array(c);s<c;++s)u=e[s],a[s]=i[u.source.index]/(i[u.source.index]+i[u.target.index]);t=new Array(c),initializeStrength(),r=new Array(c),initializeDistance()}}function initializeStrength(){if(n)for(var r=0,i=e.length;r<i;++r)t[r]=+s(e[r],r,e)}function initializeDistance(){if(n)for(var t=0,i=e.length;t<i;++t)r[t]=+u(e[t],t,e)}return null==e&&(e=[]),force.initialize=function(e){n=e,initialize()},force.links=function(t){return arguments.length?(e=t,initialize(),force):e},force.id=function(e){return arguments.length?(o=e,force):o},force.iterations=function(e){return arguments.length?(l=+e,force):l},force.strength=function(e){return arguments.length?(s="function"===typeof e?e:kf(+e),initializeStrength(),force):s},force.distance=function(e){return arguments.length?(u="function"===typeof e?e:kf(+e),initializeDistance(),force):u},force},x:function(e){var t,r,n,i=kf(.1);function force(e){for(var i,a=0,o=t.length;a<o;++a)(i=t[a]).vx+=(n[a]-i.x)*r[a]*e}function initialize(){if(t){var a,o=t.length;for(r=new Array(o),n=new Array(o),a=0;a<o;++a)r[a]=isNaN(n[a]=+e(t[a],a,t))?0:+i(t[a],a,t)}}return"function"!==typeof e&&(e=kf(null==e?0:+e)),force.initialize=function(e){t=e,initialize()},force.strength=function(e){return arguments.length?(i="function"===typeof e?e:kf(+e),initialize(),force):i},force.x=function(t){return arguments.length?(e="function"===typeof t?t:kf(+t),initialize(),force):e},force},y:function(e){var t,r,n,i=kf(.1);function force(e){for(var i,a=0,o=t.length;a<o;++a)(i=t[a]).vy+=(n[a]-i.y)*r[a]*e}function initialize(){if(t){var a,o=t.length;for(r=new Array(o),n=new Array(o),a=0;a<o;++a)r[a]=isNaN(n[a]=+e(t[a],a,t))?0:+i(t[a],a,t)}}return"function"!==typeof e&&(e=kf(null==e?0:+e)),force.initialize=function(e){t=e,initialize()},force.strength=function(e){return arguments.length?(i="function"===typeof e?e:kf(+e),initialize(),force):i},force.y=function(t){return arguments.length?(e="function"===typeof t?t:kf(+t),initialize(),force):e},force}},qf="forces",Wf=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],Gf=["static","iterations"],Hf=["x","y","vx","vy"];function Force(e){Transform.call(this,null,e)}Force.Definition={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean",default:!1},{name:"restart",type:"boolean",default:!1},{name:"iterations",type:"number",default:300},{name:"alpha",type:"number",default:1},{name:"alphaMin",type:"number",default:.001},{name:"alphaTarget",type:"number",default:0},{name:"velocityDecay",type:"number",default:.4},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number",default:0},{name:"y",type:"number",default:0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30},{name:"theta",type:"number",default:.9},{name:"distanceMin",type:"number",default:1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number",default:30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number",default:1}]},{key:{force:"x"},params:[{name:"strength",type:"number",default:.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number",default:.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,default:Hf}]};var Vf=Object(V.y)(Force,Transform);function setup(e,t,r,n){var i,a,o,s,u=Object(V.i)(t.forces);for(i=0,a=Wf.length;i<a;++i)(o=Wf[i])!==qf&&t.modified(o)&&e[o](t[o]);for(i=0,a=u.length;i<a;++i)s=qf+i,(o=r||t.modified(qf,i)?getForce(u[i]):n&&modified(u[i],n)?e.force(s):null)&&e.force(s,o);for(a=e.numForces||0;i<a;++i)e.force(qf+i,null);return e.numForces=u.length,e}function modified(e,t){var r,n;for(r in e)if(Object(V.D)(n=e[r])&&t.modified(Object(V.g)(n)))return 1;return 0}function getForce(e){var t,r;for(r in Object(V.v)(zf,e.force)||Object(V.n)("Unrecognized force: "+e.force),t=zf[e.force](),e)Object(V.D)(t[r])&&setForceParam(t[r],e[r],e);return t}function setForceParam(e,t,r){e(Object(V.D)(t)?function(e){return t(e,r)}:t)}Vf.transform=function(e,t){var r=this.value,n=t.changed(t.ADD_REM),i=e.modified(Wf),a=e.iterations||300;if(r?(n&&(t.modifies("index"),r.nodes(t.source)),(i||t.changed(t.MOD))&&setup(r,e,0,t)):(this.value=r=function Force_simulation(e,t){var r=Uf(e),n=!1,i=r.stop,a=r.restart;return r.stopped=function(){return n},r.restart=function(){return n=!1,a()},r.stop=function(){return n=!0,i()},setup(r,t,!0).on("end",(function(){n=!0}))}(t.source,e),r.on("tick",function rerun(e,t){return function(){e.touch(t).run()}}(t.dataflow,this)),e.static||(n=!0,r.tick()),t.modifies("index")),i||n||e.modified(Gf)||t.changed()&&e.restart)if(r.alpha(Math.max(r.alpha(),e.alpha||1)).alphaDecay(1-Math.pow(r.alphaMin(),1/a)),e.static)for(r.stop();--a>=0;)r.tick();else if(r.stopped()&&r.restart(),!n)return t.StopPropagation;return this.finish(e,t)},Vf.finish=function(e,t){for(var r,n=t.dataflow,i=this._argops,a=0,o=i.length;a<o;++a)if((r=i[a]).name===qf&&"link"===r.op._argval.force)for(var s,u=r.op._argops,l=0,c=u.length;l<c;++l)if("links"===u[l].name&&(s=u[l].op.source)){n.pulse(s,n.changeset().reflow());break}return t.reflow(e.modified()).modifies(Hf)};var Yf=function(e,t,r){var n={};return e.each((function(e){var i=e.data;r(i)&&(n[t(i)]=e)})),e.lookup=n,e};function defaultSeparation(e,t){return e.parent===t.parent?1:2}function meanXReduce(e,t){return e+t.x}function maxYReduce(e,t){return Math.max(e,t.y)}function count_count(e){var t=0,r=e.children,n=r&&r.length;if(n)for(;--n>=0;)t+=r[n].value;else t=1;e.value=t}function hierarchy(e,t){var r,n,i,a,o,s=new Node(e),u=+e.value&&(s.value=e.value),l=[s];for(null==t&&(t=defaultChildren);r=l.pop();)if(u&&(r.value=+r.data.value),(i=t(r.data))&&(o=i.length))for(r.children=new Array(o),a=o-1;a>=0;--a)l.push(n=r.children[a]=new Node(i[a])),n.parent=r,n.depth=r.depth+1;return s.eachBefore(computeHeight)}function defaultChildren(e){return e.children}function copyData(e){e.data=e.data.data}function computeHeight(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Node(e){this.data=e,this.depth=this.height=0,this.parent=null}Node.prototype=hierarchy.prototype={constructor:Node,count:function(){return this.eachAfter(count_count)},each:function(e){var t,r,n,i,a=this,o=[a];do{for(t=o.reverse(),o=[];a=t.pop();)if(e(a),r=a.children)for(n=0,i=r.length;n<i;++n)o.push(r[n])}while(o.length);return this},eachAfter:function(e){for(var t,r,n,i=this,a=[i],o=[];i=a.pop();)if(o.push(i),t=i.children)for(r=0,n=t.length;r<n;++r)a.push(t[r]);for(;i=o.pop();)e(i);return this},eachBefore:function(e){for(var t,r,n=this,i=[n];n=i.pop();)if(e(n),t=n.children)for(r=t.length-1;r>=0;--r)i.push(t[r]);return this},sum:function(e){return this.eachAfter((function(t){for(var r=+e(t.data)||0,n=t.children,i=n&&n.length;--i>=0;)r+=n[i].value;t.value=r}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,r=function leastCommonAncestor(e,t){if(e===t)return e;var r=e.ancestors(),n=t.ancestors(),i=null;e=r.pop(),t=n.pop();for(;e===t;)i=e,e=r.pop(),t=n.pop();return i}(t,e),n=[t];t!==r;)t=t.parent,n.push(t);for(var i=n.length;e!==r;)n.splice(i,0,e),e=e.parent;return n},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){var e=[];return this.each((function(t){e.push(t)})),e},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(r){r!==e&&t.push({source:r.parent,target:r})})),t},copy:function node_copy(){return hierarchy(this).eachBefore(copyData)}};var $f=Array.prototype.slice;var Xf=function(e){for(var t,r,n=0,i=(e=function array_shuffle(e){for(var t,r,n=e.length;n;)r=Math.random()*n--|0,t=e[n],e[n]=e[r],e[r]=t;return e}($f.call(e))).length,a=[];n<i;)t=e[n],r&&enclosesWeak(r,t)?++n:(r=encloseBasis(a=extendBasis(a,t)),n=0);return r};function extendBasis(e,t){var r,n;if(enclosesWeakAll(t,e))return[t];for(r=0;r<e.length;++r)if(enclosesNot(t,e[r])&&enclosesWeakAll(encloseBasis2(e[r],t),e))return[e[r],t];for(r=0;r<e.length-1;++r)for(n=r+1;n<e.length;++n)if(enclosesNot(encloseBasis2(e[r],e[n]),t)&&enclosesNot(encloseBasis2(e[r],t),e[n])&&enclosesNot(encloseBasis2(e[n],t),e[r])&&enclosesWeakAll(encloseBasis3(e[r],e[n],t),e))return[e[r],e[n],t];throw new Error}function enclosesNot(e,t){var r=e.r-t.r,n=t.x-e.x,i=t.y-e.y;return r<0||r*r<n*n+i*i}function enclosesWeak(e,t){var r=e.r-t.r+1e-6,n=t.x-e.x,i=t.y-e.y;return r>0&&r*r>n*n+i*i}function enclosesWeakAll(e,t){for(var r=0;r<t.length;++r)if(!enclosesWeak(e,t[r]))return!1;return!0}function encloseBasis(e){switch(e.length){case 1:return function encloseBasis1(e){return{x:e.x,y:e.y,r:e.r}}(e[0]);case 2:return encloseBasis2(e[0],e[1]);case 3:return encloseBasis3(e[0],e[1],e[2])}}function encloseBasis2(e,t){var r=e.x,n=e.y,i=e.r,a=t.x,o=t.y,s=t.r,u=a-r,l=o-n,c=s-i,f=Math.sqrt(u*u+l*l);return{x:(r+a+u/f*c)/2,y:(n+o+l/f*c)/2,r:(f+i+s)/2}}function encloseBasis3(e,t,r){var n=e.x,i=e.y,a=e.r,o=t.x,s=t.y,u=t.r,l=r.x,c=r.y,f=r.r,d=n-o,h=n-l,p=i-s,g=i-c,m=u-a,v=f-a,y=n*n+i*i-a*a,_=y-o*o-s*s+u*u,b=y-l*l-c*c+f*f,x=h*p-d*g,w=(p*b-g*_)/(2*x)-n,k=(g*m-p*v)/x,S=(h*_-d*b)/(2*x)-i,E=(d*v-h*m)/x,C=k*k+E*E-1,T=2*(a+w*k+S*E),O=w*w+S*S-a*a,A=-(C?(T+Math.sqrt(T*T-4*C*O))/(2*C):O/T);return{x:n+w+k*A,y:i+S+E*A,r:A}}function siblings_place(e,t,r){var n,i,a,o,s=e.x-t.x,u=e.y-t.y,l=s*s+u*u;l?(i=t.r+r.r,i*=i,o=e.r+r.r,i>(o*=o)?(n=(l+o-i)/(2*l),a=Math.sqrt(Math.max(0,o/l-n*n)),r.x=e.x-n*s-a*u,r.y=e.y-n*u+a*s):(n=(l+i-o)/(2*l),a=Math.sqrt(Math.max(0,i/l-n*n)),r.x=t.x+n*s-a*u,r.y=t.y+n*u+a*s)):(r.x=t.x+r.r,r.y=t.y)}function intersects(e,t){var r=e.r+t.r-1e-6,n=t.x-e.x,i=t.y-e.y;return r>0&&r*r>n*n+i*i}function score(e){var t=e._,r=e.next._,n=t.r+r.r,i=(t.x*r.r+r.x*t.r)/n,a=(t.y*r.r+r.y*t.r)/n;return i*i+a*a}function siblings_Node(e){this._=e,this.next=null,this.previous=null}function packEnclose(e){if(!(i=e.length))return 0;var t,r,n,i,a,o,s,u,l,c,f;if((t=e[0]).x=0,t.y=0,!(i>1))return t.r;if(r=e[1],t.x=-r.r,r.x=t.r,r.y=0,!(i>2))return t.r+r.r;siblings_place(r,t,n=e[2]),t=new siblings_Node(t),r=new siblings_Node(r),n=new siblings_Node(n),t.next=n.previous=r,r.next=t.previous=n,n.next=r.previous=t;e:for(s=3;s<i;++s){siblings_place(t._,r._,n=e[s]),n=new siblings_Node(n),u=r.next,l=t.previous,c=r._.r,f=t._.r;do{if(c<=f){if(intersects(u._,n._)){r=u,t.next=r,r.previous=t,--s;continue e}c+=u._.r,u=u.next}else{if(intersects(l._,n._)){(t=l).next=r,r.previous=t,--s;continue e}f+=l._.r,l=l.previous}}while(u!==l.next);for(n.previous=t,n.next=r,t.next=r.previous=r=n,a=score(t);(n=n.next)!==r;)(o=score(n))<a&&(t=n,a=o);r=t.next}for(t=[r._],n=r;(n=n.next)!==r;)t.push(n._);for(n=Xf(t),s=0;s<i;++s)(t=e[s]).x-=n.x,t.y-=n.y;return n.r}function optional(e){return null==e?null:required(e)}function required(e){if("function"!==typeof e)throw new Error;return e}function constantZero(){return 0}var Kf=function(e){return function(){return e}};function defaultRadius(e){return Math.sqrt(e.value)}function radiusLeaf(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function packChildren(e,t){return function(r){if(n=r.children){var n,i,a,o=n.length,s=e(r)*t||0;if(s)for(i=0;i<o;++i)n[i].r+=s;if(a=packEnclose(n),s)for(i=0;i<o;++i)n[i].r-=s;r.r=a+s}}}function translateChild(e){return function(t){var r=t.parent;t.r*=e,r&&(t.x=r.x+e*t.x,t.y=r.y+e*t.y)}}var Jf=function(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)},Qf=function(e,t,r,n,i){for(var a,o=e.children,s=-1,u=o.length,l=e.value&&(n-t)/e.value;++s<u;)(a=o[s]).y0=r,a.y1=i,a.x0=t,a.x1=t+=a.value*l},Zf="$",ed={depth:-1},td={};function defaultId(e){return e.id}function defaultParentId(e){return e.parentId}var rd=function(){var e=defaultId,t=defaultParentId;function stratify(r){var n,i,a,o,s,u,l,c=r.length,f=new Array(c),d={};for(i=0;i<c;++i)n=r[i],s=f[i]=new Node(n),null!=(u=e(n,i,r))&&(u+="")&&(d[l=Zf+(s.id=u)]=l in d?td:s);for(i=0;i<c;++i)if(s=f[i],null!=(u=t(r[i],i,r))&&(u+="")){if(!(o=d[Zf+u]))throw new Error("missing: "+u);if(o===td)throw new Error("ambiguous: "+u);o.children?o.children.push(s):o.children=[s],s.parent=o}else{if(a)throw new Error("multiple roots");a=s}if(!a)throw new Error("no root");if(a.parent=ed,a.eachBefore((function(e){e.depth=e.parent.depth+1,--c})).eachBefore(computeHeight),a.parent=null,c>0)throw new Error("cycle");return a}return stratify.id=function(t){return arguments.length?(e=required(t),stratify):e},stratify.parentId=function(e){return arguments.length?(t=required(e),stratify):t},stratify};function tree_defaultSeparation(e,t){return e.parent===t.parent?1:2}function nextLeft(e){var t=e.children;return t?t[0]:e.t}function nextRight(e){var t=e.children;return t?t[t.length-1]:e.t}function moveSubtree(e,t,r){var n=r/(t.i-e.i);t.c-=n,t.s+=r,e.c+=n,t.z+=r,t.m+=r}function nextAncestor(e,t,r){return e.a.parent===t.parent?e.a:r}function TreeNode(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}TreeNode.prototype=Object.create(Node.prototype);var nd=function(e,t,r,n,i){for(var a,o=e.children,s=-1,u=o.length,l=e.value&&(i-r)/e.value;++s<u;)(a=o[s]).x0=t,a.x1=n,a.y0=r,a.y1=r+=a.value*l},id=(1+Math.sqrt(5))/2;function squarifyRatio(e,t,r,n,i,a){for(var o,s,u,l,c,f,d,h,p,g,m,v=[],y=t.children,_=0,b=0,x=y.length,w=t.value;_<x;){u=i-r,l=a-n;do{c=y[b++].value}while(!c&&b<x);for(f=d=c,m=c*c*(g=Math.max(l/u,u/l)/(w*e)),p=Math.max(d/m,m/f);b<x;++b){if(c+=s=y[b].value,s<f&&(f=s),s>d&&(d=s),m=c*c*g,(h=Math.max(d/m,m/f))>p){c-=s;break}p=h}v.push(o={value:c,dice:u<l,children:y.slice(_,b)}),o.dice?Qf(o,r,n,i,w?n+=l*c/w:a):nd(o,r,n,w?r+=u*c/w:i,a),w-=c,_=b}return v}var ad=function custom(e){function squarify(t,r,n,i,a){squarifyRatio(e,t,r,n,i,a)}return squarify.ratio=function(e){return custom((e=+e)>1?e:1)},squarify}(id),od=function custom(e){function resquarify(t,r,n,i,a){if((o=t._squarify)&&o.ratio===e)for(var o,s,u,l,c,f=-1,d=o.length,h=t.value;++f<d;){for(u=(s=o[f]).children,l=s.value=0,c=u.length;l<c;++l)s.value+=u[l].value;s.dice?Qf(s,r,n,i,n+=(a-n)*s.value/h):nd(s,r,n,r+=(i-r)*s.value/h,a),h-=s.value}else t._squarify=o=squarifyRatio(e,t,r,n,i,a),o.ratio=e}return resquarify.ratio=function(e){return custom((e=+e)>1?e:1)},resquarify}(id);function Nest(e){Transform.call(this,null,e)}function Nest_children(e){return e.values}function nest(){var e,t=[];return e={entries:function entries(e){return function _entries(e,r){if(++r>t.length)return e;var n,i=[];for(n in e)i.push({key:n,values:_entries(e[n],r)});return i}(function apply(e,r){if(r>=t.length)return e;for(var n,i,a,o=-1,s=e.length,u=t[r++],l={},c={};++o<s;)(a=l[n=u(i=e[o])+""])?a.push(i):l[n]=[i];for(n in l)c[n]=apply(l[n],r);return c}(e,0),0)},key:function key(r){return t.push(r),e}}}function HierarchyLayout(e){Transform.call(this,null,e)}function HierarchyLayout_defaultSeparation(e,t){return e.parent===t.parent?1:2}Nest.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]},Object(V.y)(Nest,Transform).transform=function(e,t){t.source||Object(V.n)("Nest transform requires an upstream data source.");var r=e.generate,n=e.modified(),i=t.clone(),a=this.value;return(!a||n||t.changed())&&(a&&a.each((function(e){e.children&&isTuple(e.data)&&i.rem.push(e.data)})),this.value=a=hierarchy({values:Object(V.i)(e.keys).reduce((function(e,t){return e.key(t),e}),nest()).entries(i.source)},Nest_children),r&&a.each((function(e){e.children&&(e=ingest(e.data),i.add.push(e),i.source.push(e))})),Yf(a,tupleid,tupleid)),i.source.root=a,i},Object(V.y)(HierarchyLayout,Transform).transform=function(e,t){t.source&&t.source.root||Object(V.n)(this.constructor.name+" transform requires a backing tree data source.");var r=this.layout(e.method),n=this.fields,i=t.source.root,a=e.as||n;e.field?i.sum(e.field):i.count(),e.sort&&i.sort(stableCompare(e.sort,(function(e){return e.data}))),function setParams(e,t,r){for(var n,i=0,a=t.length;i<a;++i)(n=t[i])in r&&e[n](r[n])}(r,this.params,e),r.separation&&r.separation(!1!==e.separation?HierarchyLayout_defaultSeparation:V.M);try{this.value=r(i)}catch(o){Object(V.n)(o)}return i.each((function(e){!function setFields(e,t,r){for(var n=e.data,i=0,a=t.length-1;i<a;++i)n[r[i]]=e[t[i]];n[r[a]]=e.children?e.children.length:0}(e,n,a)})),t.reflow(e.modified()).modifies(a).modifies("leaf")};var sd=["x","y","r","depth","children"];function Pack(e){HierarchyLayout.call(this,e)}Pack.Definition={type:"Pack",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"radius",type:"field",default:null},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:sd.length,default:sd}]};var ud=Object(V.y)(Pack,HierarchyLayout);ud.layout=function(){var e=null,t=1,r=1,n=constantZero;function pack(i){return i.x=t/2,i.y=r/2,e?i.eachBefore(radiusLeaf(e)).eachAfter(packChildren(n,.5)).eachBefore(translateChild(1)):i.eachBefore(radiusLeaf(defaultRadius)).eachAfter(packChildren(constantZero,1)).eachAfter(packChildren(n,i.r/Math.min(t,r))).eachBefore(translateChild(Math.min(t,r)/(2*i.r))),i}return pack.radius=function(t){return arguments.length?(e=optional(t),pack):e},pack.size=function(e){return arguments.length?(t=+e[0],r=+e[1],pack):[t,r]},pack.padding=function(e){return arguments.length?(n="function"===typeof e?e:Kf(+e),pack):n},pack},ud.params=["radius","size","padding"],ud.fields=sd;var ld=["x0","y0","x1","y1","depth","children"];function Partition(e){HierarchyLayout.call(this,e)}Partition.Definition={type:"Partition",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:ld.length,default:ld}]};var cd=Object(V.y)(Partition,HierarchyLayout);function Stratify(e){Transform.call(this,null,e)}cd.layout=function(){var e=1,t=1,r=0,n=!1;function partition(i){var a=i.height+1;return i.x0=i.y0=r,i.x1=e,i.y1=t/a,i.eachBefore(function positionNode(e,t){return function(n){n.children&&Qf(n,n.x0,e*(n.depth+1)/t,n.x1,e*(n.depth+2)/t);var i=n.x0,a=n.y0,o=n.x1-r,s=n.y1-r;o<i&&(i=o=(i+o)/2),s<a&&(a=s=(a+s)/2),n.x0=i,n.y0=a,n.x1=o,n.y1=s}}(t,a)),n&&i.eachBefore(Jf),i}return partition.round=function(e){return arguments.length?(n=!!e,partition):n},partition.size=function(r){return arguments.length?(e=+r[0],t=+r[1],partition):[e,t]},partition.padding=function(e){return arguments.length?(r=+e,partition):r},partition},cd.params=["size","round","padding"],cd.fields=ld,Stratify.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]},Object(V.y)(Stratify,Transform).transform=function(e,t){t.source||Object(V.n)("Stratify transform requires an upstream data source.");var r=this.value,n=e.modified(),i=t.fork(t.ALL).materialize(t.SOURCE),a=!this.value||n||t.changed(t.ADD_REM)||t.modified(e.key.fields)||t.modified(e.parentKey.fields);return i.source=i.source.slice(),a&&(r=i.source.length?Yf(rd().id(e.key).parentId(e.parentKey)(i.source),e.key,V.eb):Yf(rd()([{}]),e.key,e.key)),i.source.root=this.value=r,i};var fd={tidy:function(){var e=tree_defaultSeparation,t=1,r=1,n=null;function tree(i){var a=function treeRoot(e){for(var t,r,n,i,a,o=new TreeNode(e,0),s=[o];t=s.pop();)if(n=t._.children)for(t.children=new Array(a=n.length),i=a-1;i>=0;--i)s.push(r=t.children[i]=new TreeNode(n[i],i)),r.parent=t;return(o.parent=new TreeNode(null,0)).children=[o],o}(i);if(a.eachAfter(firstWalk),a.parent.m=-a.z,a.eachBefore(secondWalk),n)i.eachBefore(sizeNode);else{var o=i,s=i,u=i;i.eachBefore((function(e){e.x<o.x&&(o=e),e.x>s.x&&(s=e),e.depth>u.depth&&(u=e)}));var l=o===s?1:e(o,s)/2,c=l-o.x,f=t/(s.x+l+c),d=r/(u.depth||1);i.eachBefore((function(e){e.x=(e.x+c)*f,e.y=e.depth*d}))}return i}function firstWalk(t){var r=t.children,n=t.parent.children,i=t.i?n[t.i-1]:null;if(r){!function executeShifts(e){for(var t,r=0,n=0,i=e.children,a=i.length;--a>=0;)(t=i[a]).z+=r,t.m+=r,r+=t.s+(n+=t.c)}(t);var a=(r[0].z+r[r.length-1].z)/2;i?(t.z=i.z+e(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+e(t._,i._));t.parent.A=function apportion(t,r,n){if(r){for(var i,a=t,o=t,s=r,u=a.parent.children[0],l=a.m,c=o.m,f=s.m,d=u.m;s=nextRight(s),a=nextLeft(a),s&&a;)u=nextLeft(u),(o=nextRight(o)).a=t,(i=s.z+f-a.z-l+e(s._,a._))>0&&(moveSubtree(nextAncestor(s,t,n),t,i),l+=i,c+=i),f+=s.m,l+=a.m,d+=u.m,c+=o.m;s&&!nextRight(o)&&(o.t=s,o.m+=f-c),a&&!nextLeft(u)&&(u.t=a,u.m+=l-d,n=t)}return n}(t,i,t.parent.A||n[0])}function secondWalk(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function sizeNode(e){e.x*=t,e.y=e.depth*r}return tree.separation=function(t){return arguments.length?(e=t,tree):e},tree.size=function(e){return arguments.length?(n=!1,t=+e[0],r=+e[1],tree):n?null:[t,r]},tree.nodeSize=function(e){return arguments.length?(n=!0,t=+e[0],r=+e[1],tree):n?[t,r]:null},tree},cluster:function(){var e=defaultSeparation,t=1,r=1,n=!1;function cluster(i){var a,o=0;i.eachAfter((function(t){var r=t.children;r?(t.x=function meanX(e){return e.reduce(meanXReduce,0)/e.length}(r),t.y=function maxY(e){return 1+e.reduce(maxYReduce,0)}(r)):(t.x=a?o+=e(t,a):0,t.y=0,a=t)}));var s=function leafLeft(e){for(var t;t=e.children;)e=t[0];return e}(i),u=function leafRight(e){for(var t;t=e.children;)e=t[t.length-1];return e}(i),l=s.x-e(s,u)/2,c=u.x+e(u,s)/2;return i.eachAfter(n?function(e){e.x=(e.x-i.x)*t,e.y=(i.y-e.y)*r}:function(e){e.x=(e.x-l)/(c-l)*t,e.y=(1-(i.y?e.y/i.y:1))*r})}return cluster.separation=function(t){return arguments.length?(e=t,cluster):e},cluster.size=function(e){return arguments.length?(n=!1,t=+e[0],r=+e[1],cluster):n?null:[t,r]},cluster.nodeSize=function(e){return arguments.length?(n=!0,t=+e[0],r=+e[1],cluster):n?[t,r]:null},cluster}},dd=["x","y","depth","children"];function Tree(e){HierarchyLayout.call(this,e)}Tree.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:dd.length,default:dd}]};var hd=Object(V.y)(Tree,HierarchyLayout);function TreeLinks(e){Transform.call(this,[],e)}hd.layout=function(e){var t=e||"tidy";if(Object(V.v)(fd,t))return fd[t]();Object(V.n)("Unrecognized Tree layout method: "+t)},hd.params=["size","nodeSize"],hd.fields=dd,TreeLinks.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},Object(V.y)(TreeLinks,Transform).transform=function(e,t){var r=this.value,n=t.source&&t.source.root,i=t.fork(t.NO_SOURCE),a={};return n||Object(V.n)("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(i.rem=r,t.visit(t.SOURCE,(function(e){a[tupleid(e)]=1})),n.each((function(e){var t=e.data,r=e.parent&&e.parent.data;r&&a[tupleid(t)]&&a[tupleid(r)]&&i.add.push(ingest({source:r,target:t}))})),this.value=i.add):t.changed(t.MOD)&&(t.visit(t.MOD,(function(e){a[tupleid(e)]=1})),r.forEach((function(e){(a[tupleid(e.source)]||a[tupleid(e.target)])&&i.mod.push(e)}))),i};var pd={binary:function(e,t,r,n,i){var a,o,s=e.children,u=s.length,l=new Array(u+1);for(l[0]=o=a=0;a<u;++a)l[a+1]=o+=s[a].value;!function partition(e,t,r,n,i,a,o){if(e>=t-1){var u=s[e];return u.x0=n,u.y0=i,u.x1=a,void(u.y1=o)}var c=l[e],f=r/2+c,d=e+1,h=t-1;for(;d<h;){var p=d+h>>>1;l[p]<f?d=p+1:h=p}f-l[d-1]<l[d]-f&&e+1<d&&--d;var g=l[d]-c,m=r-g;if(a-n>o-i){var v=(n*m+a*g)/r;partition(e,d,g,n,i,v,o),partition(d,t,m,v,i,a,o)}else{var y=(i*m+o*g)/r;partition(e,d,g,n,i,a,y),partition(d,t,m,n,y,a,o)}}(0,u,e.value,t,r,n,i)},dice:Qf,slice:nd,slicedice:function(e,t,r,n,i){(1&e.depth?nd:Qf)(e,t,r,n,i)},squarify:ad,resquarify:od},gd=["x0","y0","x1","y1","depth","children"];function Treemap(e){HierarchyLayout.call(this,e)}Treemap.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:gd.length,default:gd}]};var md=Object(V.y)(Treemap,HierarchyLayout);md.layout=function(){var e=function(){var e=ad,t=!1,r=1,n=1,i=[0],a=constantZero,o=constantZero,s=constantZero,u=constantZero,l=constantZero;function treemap(e){return e.x0=e.y0=0,e.x1=r,e.y1=n,e.eachBefore(positionNode),i=[0],t&&e.eachBefore(Jf),e}function positionNode(t){var r=i[t.depth],n=t.x0+r,c=t.y0+r,f=t.x1-r,d=t.y1-r;f<n&&(n=f=(n+f)/2),d<c&&(c=d=(c+d)/2),t.x0=n,t.y0=c,t.x1=f,t.y1=d,t.children&&(r=i[t.depth+1]=a(t)/2,n+=l(t)-r,c+=o(t)-r,(f-=s(t)-r)<n&&(n=f=(n+f)/2),(d-=u(t)-r)<c&&(c=d=(c+d)/2),e(t,n,c,f,d))}return treemap.round=function(e){return arguments.length?(t=!!e,treemap):t},treemap.size=function(e){return arguments.length?(r=+e[0],n=+e[1],treemap):[r,n]},treemap.tile=function(t){return arguments.length?(e=required(t),treemap):e},treemap.padding=function(e){return arguments.length?treemap.paddingInner(e).paddingOuter(e):treemap.paddingInner()},treemap.paddingInner=function(e){return arguments.length?(a="function"===typeof e?e:Kf(+e),treemap):a},treemap.paddingOuter=function(e){return arguments.length?treemap.paddingTop(e).paddingRight(e).paddingBottom(e).paddingLeft(e):treemap.paddingTop()},treemap.paddingTop=function(e){return arguments.length?(o="function"===typeof e?e:Kf(+e),treemap):o},treemap.paddingRight=function(e){return arguments.length?(s="function"===typeof e?e:Kf(+e),treemap):s},treemap.paddingBottom=function(e){return arguments.length?(u="function"===typeof e?e:Kf(+e),treemap):u},treemap.paddingLeft=function(e){return arguments.length?(l="function"===typeof e?e:Kf(+e),treemap):l},treemap}();return e.ratio=function(t){var r=e.tile();r.ratio&&e.tile(r.ratio(t))},e.method=function(t){Object(V.v)(pd,t)?e.tile(pd[t]):Object(V.n)("Unrecognized Treemap layout method: "+t)},e},md.params=["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],md.fields=gd;var vd=function(e,t){var r,n,i,a,o,s,u=[],l=function get(e){return e(a)};if(null==t)u.push(e);else for(r={},n=0,i=e.length;n<i;++n)a=e[n],(s=r[o=t.map(l)])||(r[o]=s=[],s.dims=o,u.push(s)),s.push(a);return u};function Loess(e){Transform.call(this,null,e)}Loess.Definition={type:"Loess",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"bandwidth",type:"number",default:.3},{name:"as",type:"string",array:!0}]},Object(V.y)(Loess,Transform).transform=function(e,t){var r=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){var n=t.materialize(t.SOURCE).source,i=vd(n,e.groupby),a=(e.groupby||[]).map(V.h),o=a.length,s=e.as||[Object(V.h)(e.x),Object(V.h)(e.y)],u=[];i.forEach((function(t){Ht(t,e.x,e.y,e.bandwidth||.3).forEach((function(e){for(var r={},n=0;n<o;++n)r[a[n]]=t.dims[n];r[s[0]]=e[0],r[s[1]]=e[1],u.push(ingest(r))}))})),this.value&&(r.rem=this.value),this.value=r.add=r.source=u}return r};var yd={linear:Lt,log:Nt,exp:Bt,pow:Ut,quad:zt,poly:Wt};function Regression(e){Transform.call(this,null,e)}Regression.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(yd)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]},Object(V.y)(Regression,Transform).transform=function(e,t){var r=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){var n=t.materialize(t.SOURCE).source,i=vd(n,e.groupby),a=(e.groupby||[]).map(V.h),o=e.method||"linear",s=e.order||3,u=function degreesOfFreedom(e,t){return"poly"===e?t:"quad"===e?2:1}(o,s),l=e.as||[Object(V.h)(e.x),Object(V.h)(e.y)],c=yd[o],f=[],d=e.extent;Object(V.v)(yd,o)||Object(V.n)("Invalid regression method: "+o),null!=d&&"log"===o&&d[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),i.forEach((function(r){if(r.length<=u)t.dataflow.warn("Skipping regression with more parameters than data points.");else{var n=c(r,e.x,e.y,s);if(e.params)f.push(ingest({keys:r.dims,coef:n.coef,rSquared:n.rSquared}));else{var i=d||Object(V.p)(r,e.x),h=function add(e){for(var t={},n=0;n<a.length;++n)t[a[n]]=r.dims[n];t[l[0]]=e[0],t[l[1]]=e[1],f.push(ingest(t))};"linear"===o?i.forEach((function(e){return h([e,n.predict(e)])})):Yt(n.predict,i,25,200).forEach(h)}}})),this.value&&(r.rem=this.value),this.value=r.add=r.source=f}return r};var _d=r(2),bd=r(3),xd=Math.pow(2,-52),wd=new Uint32Array(512),kd=function(){function Delaunator(e){Object(_d.a)(this,Delaunator);var t=e.length>>1;if(t>0&&"number"!==typeof e[0])throw new Error("Expected coords to contain numbers.");this.coords=e;var r=Math.max(2*t-5,0);this._triangles=new Uint32Array(3*r),this._halfedges=new Int32Array(3*r),this._hashSize=Math.ceil(Math.sqrt(t)),this._hullPrev=new Uint32Array(t),this._hullNext=new Uint32Array(t),this._hullTri=new Uint32Array(t),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(t),this._dists=new Float64Array(t),this.update()}return Object(bd.a)(Delaunator,null,[{key:"from",value:function from(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:defaultGetX,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:defaultGetY,n=e.length,i=new Float64Array(2*n),a=0;a<n;a++){var o=e[a];i[2*a]=t(o),i[2*a+1]=r(o)}return new Delaunator(i)}}]),Object(bd.a)(Delaunator,[{key:"update",value:function update(){for(var e=this.coords,t=this._hullPrev,r=this._hullNext,n=this._hullTri,i=this._hullHash,a=e.length>>1,o=1/0,s=1/0,u=-1/0,l=-1/0,c=0;c<a;c++){var f=e[2*c],d=e[2*c+1];f<o&&(o=f),d<s&&(s=d),f>u&&(u=f),d>l&&(l=d),this._ids[c]=c}for(var h,p,g,m=(o+u)/2,v=(s+l)/2,y=1/0,_=0;_<a;_++){var b=delaunator_dist(m,v,e[2*_],e[2*_+1]);b<y&&(h=_,y=b)}var x=e[2*h],w=e[2*h+1];y=1/0;for(var k=0;k<a;k++)if(k!==h){var S=delaunator_dist(x,w,e[2*k],e[2*k+1]);S<y&&S>0&&(p=k,y=S)}for(var E=e[2*p],C=e[2*p+1],T=1/0,O=0;O<a;O++)if(O!==h&&O!==p){var A=circumradius(x,w,E,C,e[2*O],e[2*O+1]);A<T&&(g=O,T=A)}var R=e[2*g],D=e[2*g+1];if(T===1/0){for(var P=0;P<a;P++)this._dists[P]=e[2*P]-e[0]||e[2*P+1]-e[1];quicksort(this._ids,this._dists,0,a-1);for(var j=new Uint32Array(a),M=0,F=0,I=-1/0;F<a;F++){var L=this._ids[F];this._dists[L]>I&&(j[M++]=L,I=this._dists[L])}return this.hull=j.subarray(0,M),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(delaunator_orient(x,w,E,C,R,D)){var N=p,B=E,U=C;p=g,E=R,C=D,g=N,R=B,D=U}var z=function circumcenter(e,t,r,n,i,a){var o=r-e,s=n-t,u=i-e,l=a-t,c=o*o+s*s,f=u*u+l*l,d=.5/(o*l-s*u);return{x:e+(l*c-s*f)*d,y:t+(o*f-u*c)*d}}(x,w,E,C,R,D);this._cx=z.x,this._cy=z.y;for(var q=0;q<a;q++)this._dists[q]=delaunator_dist(e[2*q],e[2*q+1],z.x,z.y);quicksort(this._ids,this._dists,0,a-1),this._hullStart=h;var W=3;r[h]=t[g]=p,r[p]=t[h]=g,r[g]=t[p]=h,n[h]=0,n[p]=1,n[g]=2,i.fill(-1),i[this._hashKey(x,w)]=h,i[this._hashKey(E,C)]=p,i[this._hashKey(R,D)]=g,this.trianglesLen=0,this._addTriangle(h,p,g,-1,-1,-1);for(var G,H,V=0;V<this._ids.length;V++){var Y=this._ids[V],$=e[2*Y],X=e[2*Y+1];if(!(V>0&&Math.abs($-G)<=xd&&Math.abs(X-H)<=xd)&&(G=$,H=X,Y!==h&&Y!==p&&Y!==g)){for(var K=0,J=0,Q=this._hashKey($,X);J<this._hashSize&&(-1===(K=i[(Q+J)%this._hashSize])||K===r[K]);J++);for(var Z=K=t[K],ee=void 0;ee=r[Z],!delaunator_orient($,X,e[2*Z],e[2*Z+1],e[2*ee],e[2*ee+1]);)if((Z=ee)===K){Z=-1;break}if(-1!==Z){var te=this._addTriangle(Z,Y,r[Z],-1,-1,n[Z]);n[Y]=this._legalize(te+2),n[Z]=te,W++;for(var re=r[Z];ee=r[re],delaunator_orient($,X,e[2*re],e[2*re+1],e[2*ee],e[2*ee+1]);)te=this._addTriangle(re,Y,ee,n[Y],-1,n[re]),n[Y]=this._legalize(te+2),r[re]=re,W--,re=ee;if(Z===K)for(;delaunator_orient($,X,e[2*(ee=t[Z])],e[2*ee+1],e[2*Z],e[2*Z+1]);)te=this._addTriangle(ee,Y,Z,-1,n[Z],n[ee]),this._legalize(te+2),n[ee]=te,r[Z]=Z,W--,Z=ee;this._hullStart=t[Y]=Z,r[Z]=t[re]=Y,r[Y]=re,i[this._hashKey($,X)]=Y,i[this._hashKey(e[2*Z],e[2*Z+1])]=Z}}}this.hull=new Uint32Array(W);for(var ne=0,ie=this._hullStart;ne<W;ne++)this.hull[ne]=ie,ie=r[ie];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}},{key:"_hashKey",value:function _hashKey(e,t){return Math.floor(function pseudoAngle(e,t){var r=e/(Math.abs(e)+Math.abs(t));return(t>0?3-r:1+r)/4}(e-this._cx,t-this._cy)*this._hashSize)%this._hashSize}},{key:"_legalize",value:function _legalize(e){for(var t=this._triangles,r=this._halfedges,n=this.coords,i=0,a=0;;){var o=r[e],s=e-e%3;if(a=s+(e+2)%3,-1!==o){var u=o-o%3,l=s+(e+1)%3,c=u+(o+2)%3,f=t[a],d=t[e],h=t[l],p=t[c];if(inCircle(n[2*f],n[2*f+1],n[2*d],n[2*d+1],n[2*h],n[2*h+1],n[2*p],n[2*p+1])){t[e]=p,t[o]=f;var g=r[c];if(-1===g){var m=this._hullStart;do{if(this._hullTri[m]===c){this._hullTri[m]=e;break}m=this._hullPrev[m]}while(m!==this._hullStart)}this._link(e,g),this._link(o,r[a]),this._link(a,c);var v=u+(o+1)%3;i<wd.length&&(wd[i++]=v)}else{if(0===i)break;e=wd[--i]}}else{if(0===i)break;e=wd[--i]}}return a}},{key:"_link",value:function _link(e,t){this._halfedges[e]=t,-1!==t&&(this._halfedges[t]=e)}},{key:"_addTriangle",value:function _addTriangle(e,t,r,n,i,a){var o=this.trianglesLen;return this._triangles[o]=e,this._triangles[o+1]=t,this._triangles[o+2]=r,this._link(o,n),this._link(o+1,i),this._link(o+2,a),this.trianglesLen+=3,o}}]),Delaunator}();function delaunator_dist(e,t,r,n){var i=e-r,a=t-n;return i*i+a*a}function orientIfSure(e,t,r,n,i,a){var o=(n-t)*(i-e),s=(r-e)*(a-t);return Math.abs(o-s)>=33306690738754716e-32*Math.abs(o+s)?o-s:0}function delaunator_orient(e,t,r,n,i,a){return(orientIfSure(i,a,e,t,r,n)||orientIfSure(e,t,r,n,i,a)||orientIfSure(r,n,i,a,e,t))<0}function inCircle(e,t,r,n,i,a,o,s){var u=e-o,l=t-s,c=r-o,f=n-s,d=i-o,h=a-s,p=c*c+f*f,g=d*d+h*h;return u*(f*g-p*h)-l*(c*g-p*d)+(u*u+l*l)*(c*h-f*d)<0}function circumradius(e,t,r,n,i,a){var o=r-e,s=n-t,u=i-e,l=a-t,c=o*o+s*s,f=u*u+l*l,d=.5/(o*l-s*u),h=(l*c-s*f)*d,p=(o*f-u*c)*d;return h*h+p*p}function quicksort(e,t,r,n){if(n-r<=20)for(var i=r+1;i<=n;i++){for(var a=e[i],o=t[a],s=i-1;s>=r&&t[e[s]]>o;)e[s+1]=e[s--];e[s+1]=a}else{var u=r+1,l=n;delaunator_swap(e,r+n>>1,u),t[e[r]]>t[e[n]]&&delaunator_swap(e,r,n),t[e[u]]>t[e[n]]&&delaunator_swap(e,u,n),t[e[r]]>t[e[u]]&&delaunator_swap(e,r,u);for(var c=e[u],f=t[c];;){do{u++}while(t[e[u]]<f);do{l--}while(t[e[l]]>f);if(l<u)break;delaunator_swap(e,u,l)}e[r+1]=e[l],e[l]=c,n-u+1>=l-r?(quicksort(e,t,u,n),quicksort(e,t,r,l-1)):(quicksort(e,t,r,l-1),quicksort(e,t,u,n))}}function delaunator_swap(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function defaultGetX(e){return e[0]}function defaultGetY(e){return e[1]}var Sd=function(){function Path(){Object(_d.a)(this,Path),this._x0=this._y0=this._x1=this._y1=null,this._=""}return Object(bd.a)(Path,[{key:"moveTo",value:function moveTo(e,t){this._+="M".concat(this._x0=this._x1=+e,",").concat(this._y0=this._y1=+t)}},{key:"closePath",value:function closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}},{key:"lineTo",value:function lineTo(e,t){this._+="L".concat(this._x1=+e,",").concat(this._y1=+t)}},{key:"arc",value:function arc(e,t,r){var n=(e=+e)+(r=+r),i=t=+t;if(r<0)throw new Error("negative radius");null===this._x1?this._+="M".concat(n,",").concat(i):(Math.abs(this._x1-n)>1e-6||Math.abs(this._y1-i)>1e-6)&&(this._+="L"+n+","+i),r&&(this._+="A".concat(r,",").concat(r,",0,1,1,").concat(e-r,",").concat(t,"A").concat(r,",").concat(r,",0,1,1,").concat(this._x1=n,",").concat(this._y1=i))}},{key:"rect",value:function rect(e,t,r,n){this._+="M".concat(this._x0=this._x1=+e,",").concat(this._y0=this._y1=+t,"h").concat(+r,"v").concat(+n,"h").concat(-r,"Z")}},{key:"value",value:function value(){return this._||null}}]),Path}(),Ed=function(){function Polygon(){Object(_d.a)(this,Polygon),this._=[]}return Object(bd.a)(Polygon,[{key:"moveTo",value:function moveTo(e,t){this._.push([e,t])}},{key:"closePath",value:function closePath(){this._.push(this._[0].slice())}},{key:"lineTo",value:function lineTo(e,t){this._.push([e,t])}},{key:"value",value:function value(){return this._.length?this._:null}}]),Polygon}(),Cd=function(){function Voronoi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,960,500],r=Object(qt.a)(t,4),n=r[0],i=r[1],a=r[2],o=r[3];if(Object(_d.a)(this,Voronoi),!((a=+a)>=(n=+n))||!((o=+o)>=(i=+i)))throw new Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(2*e.points.length),this.vectors=new Float64Array(2*e.points.length),this.xmax=a,this.xmin=n,this.ymax=o,this.ymin=i,this._init()}return Object(bd.a)(Voronoi,[{key:"update",value:function update(){return this.delaunay.update(),this._init(),this}},{key:"_init",value:function _init(){for(var e,t,r=this.delaunay,n=r.points,i=r.hull,a=r.triangles,o=this.vectors,s=this.circumcenters=this._circumcenters.subarray(0,a.length/3*2),u=0,l=0,c=a.length;u<c;u+=3,l+=2){var f=2*a[u],d=2*a[u+1],h=2*a[u+2],p=n[f],g=n[f+1],m=n[d],v=n[d+1],y=n[h],_=n[h+1],b=m-p,x=v-g,w=y-p,k=_-g,S=b*b+x*x,E=w*w+k*k,C=2*(b*k-x*w);if(C)if(Math.abs(C)<1e-8)e=(p+y)/2,t=(g+_)/2;else{var T=1/C;e=p+(k*S-x*E)*T,t=g+(b*E-w*S)*T}else e=(p+y)/2-1e8*k,t=(g+_)/2+1e8*w;s[l]=e,s[l+1]=t}var O,A,R,D=i[i.length-1],P=4*D,j=n[2*D],M=n[2*D+1];o.fill(0);for(var F=0;F<i.length;++F)O=P,A=j,R=M,P=4*(D=i[F]),j=n[2*D],M=n[2*D+1],o[O+2]=o[P]=R-M,o[O+3]=o[P+1]=j-A}},{key:"render",value:function render(e){var t=null==e?e=new Sd:void 0,r=this.delaunay,n=r.halfedges,i=r.inedges,a=r.hull,o=this.circumcenters,s=this.vectors;if(a.length<=1)return null;for(var u=0,l=n.length;u<l;++u){var c=n[u];if(!(c<u)){var f=2*Math.floor(u/3),d=2*Math.floor(c/3),h=o[f],p=o[f+1],g=o[d],m=o[d+1];this._renderSegment(h,p,g,m,e)}}for(var v,y=a[a.length-1],_=0;_<a.length;++_){v=y,y=a[_];var b=2*Math.floor(i[y]/3),x=o[b],w=o[b+1],k=4*v,S=this._project(x,w,s[k+2],s[k+3]);S&&this._renderSegment(x,w,S[0],S[1],e)}return t&&t.value()}},{key:"renderBounds",value:function renderBounds(e){var t=null==e?e=new Sd:void 0;return e.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),t&&t.value()}},{key:"renderCell",value:function renderCell(e,t){var r=null==t?t=new Sd:void 0,n=this._clip(e);if(null!==n){t.moveTo(n[0],n[1]);for(var i=n.length;n[0]===n[i-2]&&n[1]===n[i-1]&&i>1;)i-=2;for(var a=2;a<i;a+=2)n[a]===n[a-2]&&n[a+1]===n[a-1]||t.lineTo(n[a],n[a+1]);return t.closePath(),r&&r.value()}}},{key:"cellPolygons",value:A.a.mark((function cellPolygons(){var e,t,r,n;return A.a.wrap((function cellPolygons$(i){for(;;)switch(i.prev=i.next){case 0:e=this.delaunay.points,t=0,r=e.length/2;case 2:if(!(t<r)){i.next=10;break}if(!(n=this.cellPolygon(t))){i.next=7;break}return i.next=7,n;case 7:++t,i.next=2;break;case 10:case"end":return i.stop()}}),cellPolygons,this)}))},{key:"cellPolygon",value:function cellPolygon(e){var t=new Ed;return this.renderCell(e,t),t.value()}},{key:"_renderSegment",value:function _renderSegment(e,t,r,n,i){var a,o=this._regioncode(e,t),s=this._regioncode(r,n);0===o&&0===s?(i.moveTo(e,t),i.lineTo(r,n)):(a=this._clipSegment(e,t,r,n,o,s))&&(i.moveTo(a[0],a[1]),i.lineTo(a[2],a[3]))}},{key:"contains",value:function contains(e,t,r){return(t=+t)===t&&(r=+r)===r&&this.delaunay._step(e,t,r)===e}},{key:"_cell",value:function _cell(e){var t=this.circumcenters,r=this.delaunay,n=r.inedges,i=r.halfedges,a=r.triangles,o=n[e];if(-1===o)return null;var s=[],u=o;do{var l=Math.floor(u/3);if(s.push(t[2*l],t[2*l+1]),a[u=u%3===2?u-2:u+1]!==e)break;u=i[u]}while(u!==o&&-1!==u);return s}},{key:"_clip",value:function _clip(e){if(0===e&&1===this.delaunay.hull.length)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];var t=this._cell(e);if(null===t)return null;var r=this.vectors,n=4*e;return r[n]||r[n+1]?this._clipInfinite(e,t,r[n],r[n+1],r[n+2],r[n+3]):this._clipFinite(e,t)}},{key:"_clipFinite",value:function _clipFinite(e,t){for(var r,n,i,a,o,s=t.length,u=null,l=t[s-2],c=t[s-1],f=this._regioncode(l,c),d=0;d<s;d+=2)if(r=l,n=c,l=t[d],c=t[d+1],i=f,f=this._regioncode(l,c),0===i&&0===f)a=o,o=0,u?u.push(l,c):u=[l,c];else{var h=void 0,p=void 0,g=void 0,m=void 0,v=void 0;if(0===i){if(null===(h=this._clipSegment(r,n,l,c,i,f)))continue;var y=h,_=Object(qt.a)(y,4);p=_[0],g=_[1],m=_[2],v=_[3]}else{if(null===(h=this._clipSegment(l,c,r,n,f,i)))continue;var b=h,x=Object(qt.a)(b,4);m=x[0],v=x[1],p=x[2],g=x[3],a=o,o=this._edgecode(p,g),a&&o&&this._edge(e,a,o,u,u.length),u?u.push(p,g):u=[p,g]}a=o,o=this._edgecode(m,v),a&&o&&this._edge(e,a,o,u,u.length),u?u.push(m,v):u=[m,v]}if(u)a=o,o=this._edgecode(u[0],u[1]),a&&o&&this._edge(e,a,o,u,u.length);else if(this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return u}},{key:"_clipSegment",value:function _clipSegment(e,t,r,n,i,a){for(;;){if(0===i&&0===a)return[e,t,r,n];if(i&a)return null;var o=void 0,s=void 0,u=i||a;8&u?(o=e+(r-e)*(this.ymax-t)/(n-t),s=this.ymax):4&u?(o=e+(r-e)*(this.ymin-t)/(n-t),s=this.ymin):2&u?(s=t+(n-t)*(this.xmax-e)/(r-e),o=this.xmax):(s=t+(n-t)*(this.xmin-e)/(r-e),o=this.xmin),i?(e=o,t=s,i=this._regioncode(e,t)):(r=o,n=s,a=this._regioncode(r,n))}}},{key:"_clipInfinite",value:function _clipInfinite(e,t,r,n,i,a){var o,s=Array.from(t);if((o=this._project(s[0],s[1],r,n))&&s.unshift(o[0],o[1]),(o=this._project(s[s.length-2],s[s.length-1],i,a))&&s.push(o[0],o[1]),s=this._clipFinite(e,s))for(var u,l=0,c=s.length,f=this._edgecode(s[c-2],s[c-1]);l<c;l+=2)u=f,f=this._edgecode(s[l],s[l+1]),u&&f&&(l=this._edge(e,u,f,s,l),c=s.length);else this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(s=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return s}},{key:"_edge",value:function _edge(e,t,r,n,i){for(;t!==r;){var a=void 0,o=void 0;switch(t){case 5:t=4;continue;case 4:t=6,a=this.xmax,o=this.ymin;break;case 6:t=2;continue;case 2:t=10,a=this.xmax,o=this.ymax;break;case 10:t=8;continue;case 8:t=9,a=this.xmin,o=this.ymax;break;case 9:t=1;continue;case 1:t=5,a=this.xmin,o=this.ymin}n[i]===a&&n[i+1]===o||!this.contains(e,a,o)||(n.splice(i,0,a,o),i+=2)}if(n.length>4)for(var s=0;s<n.length;s+=2){var u=(s+2)%n.length,l=(s+4)%n.length;(n[s]===n[u]&&n[u]===n[l]||n[s+1]===n[u+1]&&n[u+1]===n[l+1])&&(n.splice(u,2),s-=2)}return i}},{key:"_project",value:function _project(e,t,r,n){var i,a,o,s=1/0;if(n<0){if(t<=this.ymin)return null;(i=(this.ymin-t)/n)<s&&(o=this.ymin,a=e+(s=i)*r)}else if(n>0){if(t>=this.ymax)return null;(i=(this.ymax-t)/n)<s&&(o=this.ymax,a=e+(s=i)*r)}if(r>0){if(e>=this.xmax)return null;(i=(this.xmax-e)/r)<s&&(a=this.xmax,o=t+(s=i)*n)}else if(r<0){if(e<=this.xmin)return null;(i=(this.xmin-e)/r)<s&&(a=this.xmin,o=t+(s=i)*n)}return[a,o]}},{key:"_edgecode",value:function _edgecode(e,t){return(e===this.xmin?1:e===this.xmax?2:0)|(t===this.ymin?4:t===this.ymax?8:0)}},{key:"_regioncode",value:function _regioncode(e,t){return(e<this.xmin?1:e>this.xmax?2:0)|(t<this.ymin?4:t>this.ymax?8:0)}}]),Voronoi}(),Td=A.a.mark(flatIterable),Od=2*Math.PI;function pointX(e){return e[0]}function pointY(e){return e[1]}function jitter(e,t,r){return[e+Math.sin(e+t)*r,t+Math.cos(e-t)*r]}var Ad=function(){function Delaunay(e){Object(_d.a)(this,Delaunay),this._delaunator=new kd(e),this.inedges=new Int32Array(e.length/2),this._hullIndex=new Int32Array(e.length/2),this.points=this._delaunator.coords,this._init()}return Object(bd.a)(Delaunay,[{key:"update",value:function update(){return this._delaunator.update(),this._init(),this}},{key:"_init",value:function _init(){var e=this._delaunator,t=this.points;if(e.hull&&e.hull.length>2&&function delaunay_area(e,t){for(var r,n=e.length,i=t[2*e[n-1]],a=t[2*e[n-1]+1],o=0,s=0;s<n;s++)r=i,o+=a*(i=t[2*e[s]])-r*(a=t[2*e[s]+1]);return o/2}(e.hull,t)<1e-10){this.collinear=Int32Array.from({length:t.length/2},(function(e,t){return t})).sort((function(e,r){return t[2*e]-t[2*r]||t[2*e+1]-t[2*r+1]}));for(var r=this.collinear[0],n=this.collinear[this.collinear.length-1],i=[t[2*r],t[2*r+1],t[2*n],t[2*n+1]],a=1e-8*Math.sqrt(Math.pow(i[3]-i[1],2)+Math.pow(i[2]-i[0],2)),o=0,s=t.length/2;o<s;++o){var u=jitter(t[2*o],t[2*o+1],a);t[2*o]=u[0],t[2*o+1]=u[1]}this._delaunator=new kd(t)}else delete this.collinear;for(var l=this.halfedges=this._delaunator.halfedges,c=this.hull=this._delaunator.hull,f=this.triangles=this._delaunator.triangles,d=this.inedges.fill(-1),h=this._hullIndex.fill(-1),p=0,g=l.length;p<g;++p){var m=f[p%3===2?p-2:p+1];-1!==l[p]&&-1!==d[m]||(d[m]=p)}for(var v=0,y=c.length;v<y;++v)h[c[v]]=v;c.length<=2&&c.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=c[0],this.triangles[1]=c[1],this.triangles[2]=c[1],d[c[0]]=1,2===c.length&&(d[c[1]]=0))}},{key:"voronoi",value:function voronoi(e){return new Cd(this,e)}},{key:"neighbors",value:A.a.mark((function neighbors(e){var t,r,n,i,a,o,s,u,l,c;return A.a.wrap((function neighbors$(f){for(;;)switch(f.prev=f.next){case 0:if(t=this.inedges,r=this.hull,n=this._hullIndex,i=this.halfedges,a=this.triangles,!this.collinear){f.next=10;break}if(!((o=this.collinear.indexOf(e))>0)){f.next=6;break}return f.next=6,this.collinear[o-1];case 6:if(!(o<this.collinear.length-1)){f.next=9;break}return f.next=9,this.collinear[o+1];case 9:return f.abrupt("return");case 10:if(-1!==(s=t[e])){f.next=13;break}return f.abrupt("return");case 13:u=s,l=-1;case 14:return f.next=16,l=a[u];case 16:if(a[u=u%3===2?u-2:u+1]===e){f.next=19;break}return f.abrupt("return");case 19:if(-1!==(u=i[u])){f.next=26;break}if((c=r[(n[e]+1)%r.length])===l){f.next=25;break}return f.next=25,c;case 25:return f.abrupt("return");case 26:if(u!==s){f.next=14;break}case 27:case"end":return f.stop()}}),neighbors,this)}))},{key:"find",value:function find(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if((e=+e)!==e||(t=+t)!==t)return-1;for(var n,i=r;(n=this._step(r,e,t))>=0&&n!==r&&n!==i;)r=n;return n}},{key:"_step",value:function _step(e,t,r){var n=this.inedges,i=this.hull,a=this._hullIndex,o=this.halfedges,s=this.triangles,u=this.points;if(-1===n[e]||!u.length)return(e+1)%(u.length>>1);var l=e,c=Math.pow(t-u[2*e],2)+Math.pow(r-u[2*e+1],2),f=n[e],d=f;do{var h=s[d],p=Math.pow(t-u[2*h],2)+Math.pow(r-u[2*h+1],2);if(p<c&&(c=p,l=h),s[d=d%3===2?d-2:d+1]!==e)break;if(-1===(d=o[d])){if((d=i[(a[e]+1)%i.length])!==h&&Math.pow(t-u[2*d],2)+Math.pow(r-u[2*d+1],2)<c)return d;break}}while(d!==f);return l}},{key:"render",value:function render(e){for(var t=null==e?e=new Sd:void 0,r=this.points,n=this.halfedges,i=this.triangles,a=0,o=n.length;a<o;++a){var s=n[a];if(!(s<a)){var u=2*i[a],l=2*i[s];e.moveTo(r[u],r[u+1]),e.lineTo(r[l],r[l+1])}}return this.renderHull(e),t&&t.value()}},{key:"renderPoints",value:function renderPoints(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,r=null==e?e=new Sd:void 0,n=this.points,i=0,a=n.length;i<a;i+=2){var o=n[i],s=n[i+1];e.moveTo(o+t,s),e.arc(o,s,t,0,Od)}return r&&r.value()}},{key:"renderHull",value:function renderHull(e){var t=null==e?e=new Sd:void 0,r=this.hull,n=this.points,i=2*r[0],a=r.length;e.moveTo(n[i],n[i+1]);for(var o=1;o<a;++o){var s=2*r[o];e.lineTo(n[s],n[s+1])}return e.closePath(),t&&t.value()}},{key:"hullPolygon",value:function hullPolygon(){var e=new Ed;return this.renderHull(e),e.value()}},{key:"renderTriangle",value:function renderTriangle(e,t){var r=null==t?t=new Sd:void 0,n=this.points,i=this.triangles,a=2*i[e*=3],o=2*i[e+1],s=2*i[e+2];return t.moveTo(n[a],n[a+1]),t.lineTo(n[o],n[o+1]),t.lineTo(n[s],n[s+1]),t.closePath(),r&&r.value()}},{key:"trianglePolygons",value:A.a.mark((function trianglePolygons(){var e,t,r;return A.a.wrap((function trianglePolygons$(n){for(;;)switch(n.prev=n.next){case 0:e=this.triangles,t=0,r=e.length/3;case 2:if(!(t<r)){n.next=8;break}return n.next=5,this.trianglePolygon(t);case 5:++t,n.next=2;break;case 8:case"end":return n.stop()}}),trianglePolygons,this)}))},{key:"trianglePolygon",value:function trianglePolygon(e){var t=new Ed;return this.renderTriangle(e,t),t.value()}}]),Delaunay}();function flatArray(e,t,r,n){for(var i=e.length,a=new Float64Array(2*i),o=0;o<i;++o){var s=e[o];a[2*o]=t.call(n,s,o,e),a[2*o+1]=r.call(n,s,o,e)}return a}function flatIterable(e,t,r,n){var i,a,o,s,u,l,c;return A.a.wrap((function flatIterable$(f){for(;;)switch(f.prev=f.next){case 0:i=0,a=!0,o=!1,s=void 0,f.prev=4,u=e[Symbol.iterator]();case 6:if(a=(l=u.next()).done){f.next=16;break}return c=l.value,f.next=10,t.call(n,c,i,e);case 10:return f.next=12,r.call(n,c,i,e);case 12:++i;case 13:a=!0,f.next=6;break;case 16:f.next=22;break;case 18:f.prev=18,f.t0=f.catch(4),o=!0,s=f.t0;case 22:f.prev=22,f.prev=23,a||null==u.return||u.return();case 25:if(f.prev=25,!o){f.next=28;break}throw s;case 28:return f.finish(25);case 29:return f.finish(22);case 30:case"end":return f.stop()}}),Td,null,[[4,18,22,30],[23,,25,29]])}function Voronoi_Voronoi(e){Transform.call(this,null,e)}Ad.from=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pointX,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:pointY,n=arguments.length>3?arguments[3]:void 0;return new Ad("length"in e?flatArray(e,t,r,n):Float64Array.from(flatIterable(e,t,r,n)))},Voronoi_Voronoi.Definition={type:"Voronoi",metadata:{modifies:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"size",type:"number",array:!0,length:2},{name:"extent",type:"array",array:!0,length:2,default:[[-1e5,-1e5],[1e5,1e5]],content:{type:"number",array:!0,length:2}},{name:"as",type:"string",default:"path"}]};var Rd=Object(V.y)(Voronoi_Voronoi,Transform),Dd=[-1e5,-1e5,1e5,1e5];function toPathString(e){for(var t=e[0][0],r=e[0][1],n=e.length-1;e[n][0]===t&&e[n][1]===r;--n);return"M"+e.slice(0,n+1).join("L")+"Z"}Rd.transform=function(e,t){var r=e.as||"path",n=t.source;if(!n||!n.length)return t;var i=e.size;i=i?[0,0,i[0],i[1]]:(i=e.extent)?[i[0][0],i[0][1],i[1][0],i[1][1]]:Dd;for(var a=this.value=Ad.from(n,e.x,e.y).voronoi(i),o=0,s=n.length;o<s;++o){var u=a.cellPolygon(o);n[o][r]=u?toPathString(u):null}return t.reflow(e.modified()).modifies(r)};var Pd=Math.PI/180,jd=64,Md=2048,Fd=function(){var e,t,r,n,i,a,o,s=[256,256],u=archimedeanSpiral,l=[],c=Math.random,f={};function place(e,t,r){for(var n,i,a,o,l,f=t.x,d=t.y,h=Math.sqrt(s[0]*s[0]+s[1]*s[1]),p=u(s),g=c()<.5?1:-1,m=-g;(n=p(m+=g))&&(i=~~n[0],a=~~n[1],!(Math.min(Math.abs(i),Math.abs(a))>=h));)if(t.x=f+i,t.y=d+a,!(t.x+t.x0<0||t.y+t.y0<0||t.x+t.x1>s[0]||t.y+t.y1>s[1])&&(!r||!cloudCollide(t,e,s[0]))&&(!r||(l=r,(o=t).x+o.x1>l[0].x&&o.x+o.x0<l[1].x&&o.y+o.y1>l[0].y&&o.y+o.y0<l[1].y))){for(var v,y=t.sprite,_=t.width>>5,b=s[0]>>5,x=t.x-(_<<4),w=127&x,k=32-w,S=t.y1-t.y0,E=(t.y+t.y0)*b+(x>>5),C=0;C<S;C++){v=0;for(var T=0;T<=_;T++)e[E+T]|=v<<k|(T<_?(v=y[C*_+T])>>>w:0);E+=b}return t.sprite=null,!0}return!1}return f.layout=function(){for(var u=function getContext(e){e.width=e.height=1;var t=Math.sqrt(e.getContext("2d").getImageData(0,0,1,1).data.length>>2);e.width=(jd<<5)/t,e.height=Md/t;var r=e.getContext("2d");return r.fillStyle=r.strokeStyle="red",r.textAlign="center",{context:r,ratio:t}}(domCanvas()),f=function zeroArray(e){var t=[],r=-1;for(;++r<e;)t[r]=0;return t}((s[0]>>5)*s[1]),d=null,h=l.length,p=-1,g=[],m=l.map((function(s){return{text:e(s),font:t(s),style:n(s),weight:i(s),rotate:a(s),size:~~r(s),padding:o(s),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:s}})).sort((function(e,t){return t.size-e.size}));++p<h;){var v=m[p];v.x=s[0]*(c()+.5)>>1,v.y=s[1]*(c()+.5)>>1,cloudSprite(u,v,m,p),v.hasText&&place(f,v,d)&&(g.push(v),d?cloudBounds(d,v):d=[{x:v.x+v.x0,y:v.y+v.y0},{x:v.x+v.x1,y:v.y+v.y1}],v.x-=s[0]>>1,v.y-=s[1]>>1)}return g},f.words=function(e){return arguments.length?(l=e,f):l},f.size=function(e){return arguments.length?(s=[+e[0],+e[1]],f):s},f.font=function(e){return arguments.length?(t=functor(e),f):t},f.fontStyle=function(e){return arguments.length?(n=functor(e),f):n},f.fontWeight=function(e){return arguments.length?(i=functor(e),f):i},f.rotate=function(e){return arguments.length?(a=functor(e),f):a},f.text=function(t){return arguments.length?(e=functor(t),f):e},f.spiral=function(e){return arguments.length?(u=Id[e]||e,f):u},f.fontSize=function(e){return arguments.length?(r=functor(e),f):r},f.padding=function(e){return arguments.length?(o=functor(e),f):o},f.random=function(e){return arguments.length?(c=e,f):c},f};function cloudSprite(e,t,r,n){if(!t.sprite){var i=e.context,a=e.ratio;i.clearRect(0,0,(jd<<5)/a,Md/a);var o,s,u,l,c,f=0,d=0,h=0,p=r.length;for(--n;++n<p;){if(t=r[n],i.save(),i.font=t.style+" "+t.weight+" "+~~((t.size+1)/a)+"px "+t.font,o=i.measureText(t.text+"m").width*a,u=t.size<<1,t.rotate){var g=Math.sin(t.rotate*Pd),m=Math.cos(t.rotate*Pd),v=o*m,y=o*g,_=u*m,b=u*g;o=Math.max(Math.abs(v+b),Math.abs(v-b))+31>>5<<5,u=~~Math.max(Math.abs(y+_),Math.abs(y-_))}else o=o+31>>5<<5;if(u>h&&(h=u),f+o>=jd<<5&&(f=0,d+=h,h=0),d+u>=Md)break;i.translate((f+(o>>1))/a,(d+(u>>1))/a),t.rotate&&i.rotate(t.rotate*Pd),i.fillText(t.text,0,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,0,0)),i.restore(),t.width=o,t.height=u,t.xoff=f,t.yoff=d,t.x1=o>>1,t.y1=u>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,f+=o}for(var x=i.getImageData(0,0,(jd<<5)/a,Md/a).data,w=[];--n>=0;)if((t=r[n]).hasText){for(s=(o=t.width)>>5,u=t.y1-t.y0,l=0;l<u*s;l++)w[l]=0;if(null==(f=t.xoff))return;d=t.yoff;var k=0,S=-1;for(c=0;c<u;c++){for(l=0;l<o;l++){var E=s*c+(l>>5),C=x[(d+c)*(jd<<5)+(f+l)<<2]?1<<31-l%32:0;w[E]|=C,k|=C}k?S=c:(t.y0++,u--,c--,d++)}t.y1=t.y0+S,t.sprite=w.slice(0,(t.y1-t.y0)*s)}}}function cloudCollide(e,t,r){r>>=5;for(var n,i=e.sprite,a=e.width>>5,o=e.x-(a<<4),s=127&o,u=32-s,l=e.y1-e.y0,c=(e.y+e.y0)*r+(o>>5),f=0;f<l;f++){n=0;for(var d=0;d<=a;d++)if((n<<u|(d<a?(n=i[f*a+d])>>>s:0))&t[c+d])return!0;c+=r}return!1}function cloudBounds(e,t){var r=e[0],n=e[1];t.x+t.x0<r.x&&(r.x=t.x+t.x0),t.y+t.y0<r.y&&(r.y=t.y+t.y0),t.x+t.x1>n.x&&(n.x=t.x+t.x1),t.y+t.y1>n.y&&(n.y=t.y+t.y1)}function archimedeanSpiral(e){var t=e[0]/e[1];return function(e){return[t*(e*=.1)*Math.cos(e),e*Math.sin(e)]}}function functor(e){return"function"===typeof e?e:function(){return e}}var Id={archimedean:archimedeanSpiral,rectangular:function rectangularSpiral(e){var t=4*e[0]/e[1],r=0,n=0;return function(e){var i=e<0?-1:1;switch(Math.sqrt(1+4*i*e)-i&3){case 0:r+=t;break;case 1:n+=4;break;case 2:r-=t;break;default:n-=4}return[r,n]}}},Ld=["x","y","font","fontSize","fontStyle","fontWeight","angle"],Nd=["text","font","rotate","fontSize","fontStyle","fontWeight"];function Wordcloud(e){Transform.call(this,Fd(),e)}function array8(e){return new Uint8Array(e)}function array16(e){return new Uint16Array(e)}function array32(e){return new Uint32Array(e)}function Bitmaps_array(e,t,r){var n=(t<257?array8:t<65537?array16:array32)(e);return r&&n.set(r),n}Wordcloud.Definition={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,default:"sans-serif"},{name:"fontStyle",type:"string",expr:!0,default:"normal"},{name:"fontWeight",type:"string",expr:!0,default:"normal"},{name:"fontSize",type:"number",expr:!0,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:!0,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,default:Ld}]},Object(V.y)(Wordcloud,Transform).transform=function(e,t){!e.size||e.size[0]&&e.size[1]||Object(V.n)("Wordcloud size dimensions must be non-zero.");var r=e.modified();if(r||t.changed(t.ADD_REM)||Nd.some((function modp(r){var n=e[r];return Object(V.D)(n)&&t.modified(n.fields)}))){var n,i=t.materialize(t.SOURCE).source,a=this.value,o=e.as||Ld,s=e.fontSize||14;if(Object(V.D)(s)?n=e.fontSizeRange:s=Object(V.l)(s),n){var u=s,l=scales_scale("sqrt")().domain(function Wordcloud_extent(e,t){for(var r,n=1/0,i=-1/0,a=0,o=t.length;a<o;++a)(r=e(t[a]))<n&&(n=r),r>i&&(i=r);return[n,i]}(u,i)).range(n);s=function fontSize(e){return l(u(e))}}i.forEach((function(e){e[o[0]]=NaN,e[o[1]]=NaN,e[o[3]]=0}));for(var c,f,d=a.words(i).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(s).random(kt).layout(),h=a.size(),p=h[0]>>1,g=h[1]>>1,m=0,v=d.length;m<v;++m)(f=(c=d[m]).datum)[o[0]]=c.x+p,f[o[1]]=c.y+g,f[o[2]]=c.font,f[o[3]]=c.size,f[o[4]]=c.style,f[o[5]]=c.weight,f[o[6]]=c.rotate;return t.reflow(r).modifies(o)}};var Bd=function(e,t,r){var n=1<<t;return{one:n,zero:~n,range:r.slice(),bisect:e.bisect,index:e.index,size:e.size,onAdd:function onAdd(e,t){var r,i=this.bisect(this.range,e.value),a=e.index,o=i[0],s=i[1],u=a.length;for(r=0;r<o;++r)t[a[r]]|=n;for(r=s;r<u;++r)t[a[r]]|=n;return this}}},Ud=function(e,t){return Array.from(t,(function(t){return e[t]}))};function SortedIndex(){var e=array32(0),t=[],r=0;return{insert:function insert(n,i,a){if(!i.length)return[];var o,s,u,l=r,c=i.length,f=Array(c),d=array32(c);for(u=0;u<c;++u)f[u]=n(i[u]),d[u]=u;if(f=function SortedIndex_sort(e,t){return e.sort.call(t,(function(t,r){var n=e[t],i=e[r];return n<i?-1:n>i?1:0})),Ud(e,t)}(f,d),l)o=t,s=e,t=Array(l+c),e=array32(l+c),function SortedIndex_merge(e,t,r,n,i,a,o,s,u){var l,c=0,f=0;for(l=0;c<n&&f<o;++l)t[c]<i[f]?(s[l]=t[c],u[l]=r[c++]):(s[l]=i[f],u[l]=a[f++]+e);for(;c<n;++c,++l)s[l]=t[c],u[l]=r[c];for(;f<o;++f,++l)s[l]=i[f],u[l]=a[f]+e}(a,o,s,l,f,d,c,t,e);else{if(a>0)for(u=0;u<c;++u)d[u]+=a;t=f,e=d}return r=l+c,{index:d,value:f}},remove:function remove(n,i){var a,o,s,u=r;for(o=0;!i[e[o]]&&o<u;++o);for(s=o;o<u;++o)i[a=e[o]]||(e[s]=a,t[s]=t[o],++s);r=u-n},bisect:function bisect(e,n){var i;return n?i=n.length:(n=t,i=r),[_o(n,e[0],0,i),yo(n,e[1],0,i)]},reindex:function reindex(t){for(var n=0,i=r;n<i;++n)e[n]=t[e[n]]},index:function index(){return e},size:function size(){return r}}}function CrossFilter(e){Transform.call(this,function Bitmaps(){var e=8,t=[],r=array32(0),n=Bitmaps_array(0,e),i=Bitmaps_array(0,e);return{data:function data(){return t},seen:function seen(){return r=function lengthen(e,t,r){return e.length>=t?e:((r=r||new e.constructor(t)).set(e),r)}(r,t.length)},add:function add(e){for(var r,n=0,i=t.length,a=e.length;n<a;++n)(r=e[n])._index=i++,t.push(r)},remove:function remove(e,r){var a,o,s,u=t.length,l=Array(u-e),c=t;for(o=0;!r[o]&&o<u;++o)l[o]=t[o],c[o]=o;for(s=o;o<u;++o)a=t[o],r[o]?c[o]=-1:(c[o]=s,n[s]=n[o],i[s]=i[o],l[s]=a,a._index=s++),n[o]=0;return t=l,c},size:function size(){return t.length},curr:function curr(){return n},prev:function prev(){return i},reset:function reset(e){i[e]=n[e]},all:function all(){return e<257?255:e<65537?65535:4294967295},set:function set(e,t){n[e]|=t},clear:function clear(e,t){n[e]&=~t},resize:function resize(t,r){(t>n.length||r>e)&&(e=Math.max(r,e),n=Bitmaps_array(t,e,n),i=Bitmaps_array(t,e))}}}(),e),this._indices=null,this._dims=null}CrossFilter.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]};var zd=Object(V.y)(CrossFilter,Transform);function ResolveFilter(e){Transform.call(this,null,e)}zd.transform=function(e,t){return this._dims?e.modified("fields")||e.fields.some((function(e){return t.modified(e.fields)}))?this.reinit(e,t):this.eval(e,t):this.init(e,t)},zd.init=function(e,t){for(var r,n,i=e.fields,a=e.query,o=this._indices={},s=this._dims=[],u=a.length,l=0;l<u;++l)n=o[r=i[l].fname]||(o[r]=SortedIndex()),s.push(Bd(n,l,a[l]));return this.eval(e,t)},zd.reinit=function(e,t){var r,n,i,a,o,s,u,l,c,f=t.materialize().fork(),d=e.fields,h=e.query,p=this._indices,g=this._dims,m=this.value,v=m.curr(),y=m.prev(),_=m.all(),b=f.rem=f.add,x=f.mod,w=h.length,k={};if(y.set(v),t.rem.length&&(o=this.remove(e,t,f)),t.add.length&&m.add(t.add),t.mod.length)for(s={},u=0,l=(a=t.mod).length;u<l;++u)s[a[u]._index]=1;for(u=0;u<w;++u)c=d[u],(!g[u]||e.modified("fields",u)||t.modified(c.fields))&&((r=k[i=c.fname])||(p[i]=n=SortedIndex(),k[i]=r=n.insert(c,t.source,0)),g[u]=Bd(n,u,h[u]).onAdd(r,v));for(u=0,l=m.data().length;u<l;++u)o[u]||(y[u]!==v[u]?b.push(u):s[u]&&v[u]!==_&&x.push(u));return m.mask=(1<<w)-1,f},zd.eval=function(e,t){var r=t.materialize().fork(),n=this._dims.length,i=0;return t.rem.length&&(this.remove(e,t,r),i|=(1<<n)-1),e.modified("query")&&!e.modified("fields")&&(i|=this.update(e,t,r)),t.add.length&&(this.insert(e,t,r),i|=(1<<n)-1),t.mod.length&&(this.modify(t,r),i|=(1<<n)-1),this.value.mask=i,r},zd.insert=function(e,t,r){var n,i,a,o=t.add,s=this.value,u=this._dims,l=this._indices,c=e.fields,f={},d=r.add,h=s.size(),p=h+o.length,g=u.length;s.resize(p,g),s.add(o);var m=s.curr(),v=s.prev(),y=s.all();for(n=0;n<g;++n)a=f[i=c[n].fname]||(f[i]=l[i].insert(c[n],o,h)),u[n].onAdd(a,m);for(;h<p;++h)v[h]=y,m[h]!==y&&d.push(h)},zd.modify=function(e,t){var r,n,i,a=t.mod,o=this.value,s=o.curr(),u=o.all(),l=e.mod;for(r=0,n=l.length;r<n;++r)s[i=l[r]._index]!==u&&a.push(i)},zd.remove=function(e,t,r){var n,i,a,o,s=this._indices,u=this.value,l=u.curr(),c=u.prev(),f=u.all(),d={},h=r.rem,p=t.rem;for(n=0,i=p.length;n<i;++n)d[a=p[n]._index]=1,c[a]=o=l[a],l[a]=f,o!==f&&h.push(a);for(a in s)s[a].remove(i,d);return this.reindex(t,i,d),d},zd.reindex=function(e,t,r){var n=this._indices,i=this.value;e.runAfter((function(){var e=i.remove(t,r);for(var a in n)n[a].reindex(e)}))},zd.update=function(e,t,r){var n,i,a=this._dims,o=e.query,s=t.stamp,u=a.length,l=0;for(r.filters=0,i=0;i<u;++i)e.modified("query",i)&&(n=i,++l);if(1===l)l=a[n].one,this.incrementOne(a[n],o[n],r.add,r.rem);else for(i=0,l=0;i<u;++i)e.modified("query",i)&&(l|=a[i].one,this.incrementAll(a[i],o[i],s,r.add),r.rem=r.add);return l},zd.incrementAll=function(e,t,r,n){var i,a,o,s=this.value,u=s.seen(),l=s.curr(),c=s.prev(),f=e.index(),d=e.bisect(e.range),h=e.bisect(t),p=h[0],g=h[1],m=d[0],v=d[1],y=e.one;if(p<m)for(i=p,a=Math.min(m,g);i<a;++i)u[o=f[i]]!==r&&(c[o]=l[o],u[o]=r,n.push(o)),l[o]^=y;else if(p>m)for(i=m,a=Math.min(p,v);i<a;++i)u[o=f[i]]!==r&&(c[o]=l[o],u[o]=r,n.push(o)),l[o]^=y;if(g>v)for(i=Math.max(p,v),a=g;i<a;++i)u[o=f[i]]!==r&&(c[o]=l[o],u[o]=r,n.push(o)),l[o]^=y;else if(g<v)for(i=Math.max(m,g),a=v;i<a;++i)u[o=f[i]]!==r&&(c[o]=l[o],u[o]=r,n.push(o)),l[o]^=y;e.range=t.slice()},zd.incrementOne=function(e,t,r,n){var i,a,o,s=this.value.curr(),u=e.index(),l=e.bisect(e.range),c=e.bisect(t),f=c[0],d=c[1],h=l[0],p=l[1],g=e.one;if(f<h)for(i=f,a=Math.min(h,d);i<a;++i)s[o=u[i]]^=g,r.push(o);else if(f>h)for(i=h,a=Math.min(f,p);i<a;++i)s[o=u[i]]^=g,n.push(o);if(d>p)for(i=Math.max(f,p),a=d;i<a;++i)s[o=u[i]]^=g,r.push(o);else if(d<p)for(i=Math.max(h,d),a=p;i<a;++i)s[o=u[i]]^=g,n.push(o);e.range=t.slice()},ResolveFilter.Definition={type:"ResolveFilter",metadata:{},params:[{name:"ignore",type:"number",required:!0,description:"A bit mask indicating which filters to ignore."},{name:"filter",type:"object",required:!0,description:"Per-tuple filter bitmaps from a CrossFilter transform."}]},Object(V.y)(ResolveFilter,Transform).transform=function(e,t){var r=~(e.ignore||0),n=e.filter,i=n.mask;if(0===(i&r))return t.StopPropagation;var a=t.fork(t.ALL),o=n.data(),s=n.curr(),u=n.prev(),l=function pass(e){return s[e]&r?null:o[e]};return a.filter(a.MOD,l),i&i-1?(a.filter(a.ADD,(function(e){var t=s[e]&r;return!t&&t^u[e]&r?o[e]:null})),a.filter(a.REM,(function(e){var t=s[e]&r;return t&&!(t^t^u[e]&r)?o[e]:null}))):(a.filter(a.ADD,l),a.filter(a.REM,(function(e){return(s[e]&r)===i?o[e]:null}))),a.filter(a.SOURCE,(function(e){return l(e._index)}))};var qd=r(194),Wd=/^([A-Za-z]+:)?\/\//,Gd=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,Hd=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,Vd="file://";function vega_loader_src_loader_load(e,t){return node_modules_vega_loader_src_loader_load.apply(this,arguments)}function node_modules_vega_loader_src_loader_load(){return(node_modules_vega_loader_src_loader_load=Object(Y.a)(A.a.mark((function _callee2(e,t){var r,n;return A.a.wrap((function _callee2$(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,this.sanitize(e,t);case 2:return r=i.sent,n=r.href,i.abrupt("return",r.localFile?this.file(n):this.http(n,t));case 5:case"end":return i.stop()}}),_callee2,this)})))).apply(this,arguments)}function vega_loader_src_loader_sanitize(e,t){return node_modules_vega_loader_src_loader_sanitize.apply(this,arguments)}function node_modules_vega_loader_src_loader_sanitize(){return(node_modules_vega_loader_src_loader_sanitize=Object(Y.a)(A.a.mark((function _callee3(e,t){var r,n,i,a,o,s,u;return A.a.wrap((function _callee3$(l){for(;;)switch(l.prev=l.next){case 0:return t=Object(V.o)({},this.options,t),r=this.fileAccess,n={href:null},s=Gd.test(e.replace(Hd,"")),null!=e&&"string"===typeof e&&s||Object(V.n)("Sanitize failure, invalid URI: "+Object(V.X)(e)),u=Wd.test(e),(o=t.baseURL)&&!u&&(e.startsWith("/")||"/"===o[o.length-1]||(e="/"+e),e=o+e),a=(i=e.startsWith(Vd))||"file"===t.mode||"http"!==t.mode&&!u&&r,i?e=e.slice(Vd.length):e.startsWith("//")&&("file"===t.defaultProtocol?(e=e.slice(2),a=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(n,"localFile",{value:!!a}),n.href=e,t.target&&(n.target=t.target+""),t.rel&&(n.rel=t.rel+""),l.abrupt("return",n);case 13:case"end":return l.stop()}}),_callee3,this)})))).apply(this,arguments)}function src_loader_fileLoader(e){return e?function(t){return new Promise((function(r,n){e.readFile(t,(function(e,t){e?n(e):r(t)}))}))}:vega_loader_src_loader_fileReject}function vega_loader_src_loader_fileReject(){return node_modules_vega_loader_src_loader_fileReject.apply(this,arguments)}function node_modules_vega_loader_src_loader_fileReject(){return(node_modules_vega_loader_src_loader_fileReject=Object(Y.a)(A.a.mark((function _callee4(){return A.a.wrap((function _callee4$(e){for(;;)switch(e.prev=e.next){case 0:Object(V.n)("No file system access.");case 1:case"end":return e.stop()}}),_callee4)})))).apply(this,arguments)}function src_loader_httpLoader(e){return e?function(){var t=Object(Y.a)(A.a.mark((function _callee(t,r){var n,i,a;return A.a.wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:return n=Object(V.o)({},this.options.http,r),i=r&&r.response,o.next=4,e(t,n);case 4:return a=o.sent,o.abrupt("return",a.ok?Object(V.D)(a[i])?a[i]():a.text():Object(V.n)(a.status+""+a.statusText));case 6:case"end":return o.stop()}}),_callee,this)})));return function(e,r){return t.apply(this,arguments)}}():vega_loader_src_loader_httpReject}function vega_loader_src_loader_httpReject(){return node_modules_vega_loader_src_loader_httpReject.apply(this,arguments)}function node_modules_vega_loader_src_loader_httpReject(){return(node_modules_vega_loader_src_loader_httpReject=Object(Y.a)(A.a.mark((function _callee5(){return A.a.wrap((function _callee5$(e){for(;;)switch(e.prev=e.next){case 0:Object(V.n)("No HTTP fetch method available.");case 1:case"end":return e.stop()}}),_callee5)})))).apply(this,arguments)}var Yd={boolean:V.Y,integer:V.ab,number:V.ab,date:V.Z,string:V.cb,unknown:V.x},$d=[function src_type_isBoolean(e){return"true"===e||"false"===e||!0===e||!1===e},function src_type_isInteger(e){return src_type_isNumber(e)&&(e=+e)===~~e},src_type_isNumber,function src_type_isDate(e){return!isNaN(Date.parse(e))}],Xd=["boolean","integer","number","date"];function src_type_inferType(e,t){if(!e||!e.length)return"unknown";var r,n,i,a,o=0,s=e.length,u=$d.length,l=$d.map((function(e,t){return t+1}));for(n=0,s=e.length;n<s;++n)for(r=t?e[n][t]:e[n],i=0;i<u;++i)if(l[i]&&(null!=(a=r)&&a===a)&&!$d[i](r)&&(l[i]=0,++o===$d.length))return"string";return o=l.reduce((function(e,t){return 0===e?t:e}),0)-1,Xd[o]}function src_type_inferTypes(e,t){return t.reduce((function(t,r){return t[r]=src_type_inferType(e,r),t}),{})}function src_type_isNumber(e){return!isNaN(+e)&&!(e instanceof Date)}function formats_dsv_delimitedFormat(e){var t=function parse(t,r){var n={delimiter:e};return src_formats_dsv_dsv(t,r?Object(V.o)(r,n):n)};return t.responseType="text",t}function src_formats_dsv_dsv(e,t){return t.header&&(e=t.header.map(V.X).join(t.delimiter)+"\n"+e),me(t.delimiter).parse(e+"")}src_formats_dsv_dsv.responseType="text";var Kd=r(89),Jd={interior:function interior(e,t){return e!==t},exterior:function exterior(e,t){return e===t}};function formats_topojson_topojson(e,t){var r,n,i,a;return e=Object(Kd.a)(e,t),t&&t.feature?(r=ke,i=t.feature):t&&t.mesh?(r=Ee,i=t.mesh,a=Jd[t.filter]):Object(V.n)("Missing TopoJSON feature or mesh parameter."),(n=(n=e.objects[i])?r(e,n,a):Object(V.n)("Invalid TopoJSON object: "+i))&&n.features||[n]}formats_topojson_topojson.responseType="json";var Qd={dsv:src_formats_dsv_dsv,csv:formats_dsv_delimitedFormat(","),tsv:formats_dsv_delimitedFormat("\t"),json:Kd.a,topojson:formats_topojson_topojson};function vega_loader_src_formats_formats(e,t){return arguments.length>1?(Qd[e]=t,this):Object(V.v)(Qd,e)?Qd[e]:null}function src_formats_responseType(e){var t=vega_loader_src_formats_formats(e);return t&&t.responseType||"text"}var Zd=function(e,t,r){var n=vega_loader_src_formats_formats((t=t||{}).type||"json");return n||Object(V.n)("Unknown data format type: "+t.type),e=n(e,t),t.parse&&function vega_loader_src_read_parse(e,t,r){if(!e.length)return;r=r||rt;var n,i,a,o,s,u,l,c=e.columns||Object.keys(e[0]);"auto"===t&&(t=src_type_inferTypes(e,c));for(c=Object.keys(t),n=c.map((function(e){var n,i,a=t[e];if(a&&(0===a.indexOf("date:")||0===a.indexOf("utc:")))return("'"===(i=(n=a.split(/:(.+)?/,2))[1])[0]&&"'"===i[i.length-1]||'"'===i[0]&&'"'===i[i.length-1])&&(i=i.slice(1,-1)),"utc"===n[0]?it(i):r(i);if(!Yd[a])throw Error("Illegal format pattern: "+e+":"+a);return Yd[a]})),o=0,u=e.length,l=c.length;o<u;++o)for(i=e[o],s=0;s<l;++s)a=c[s],i[a]=n[s](i[a])}(e,t.parse,r),Object(V.v)(e,"columns")&&delete e.columns,e};var eh=function(e,t){return function(r){return{options:r||{},sanitize:vega_loader_src_loader_sanitize,load:vega_loader_src_loader_load,fileAccess:!!t,file:src_loader_fileLoader(t),http:src_loader_httpLoader(e)}}}("undefined"!==typeof fetch&&fetch,null);function Bounds_Bounds(e){this.clear(),e&&this.union(e)}var th=Bounds_Bounds.prototype;th.clone=function(){return new Bounds_Bounds(this)},th.clear=function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},th.empty=function(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},th.equals=function(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},th.set=function(e,t,r,n){return r<e?(this.x2=e,this.x1=r):(this.x1=e,this.x2=r),n<t?(this.y2=t,this.y1=n):(this.y1=t,this.y2=n),this},th.add=function(e,t){return e<this.x1&&(this.x1=e),t<this.y1&&(this.y1=t),e>this.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},th.expand=function(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},th.round=function(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},th.translate=function(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},th.rotate=function(e,t,r){var n=this.rotatedPoints(e,t,r);return this.clear().add(n[0],n[1]).add(n[2],n[3]).add(n[4],n[5]).add(n[6],n[7])},th.rotatedPoints=function(e,t,r){var n=this.x1,i=this.y1,a=this.x2,o=this.y2,s=Math.cos(e),u=Math.sin(e),l=t-t*s+r*u,c=r-t*u-r*s;return[s*n-u*i+l,u*n+s*i+c,s*n-u*o+l,u*n+s*o+c,s*a-u*i+l,u*a+s*i+c,s*a-u*o+l,u*a+s*o+c]},th.union=function(e){return e.x1<this.x1&&(this.x1=e.x1),e.y1<this.y1&&(this.y1=e.y1),e.x2>this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},th.intersect=function(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2<this.x2&&(this.x2=e.x2),e.y2<this.y2&&(this.y2=e.y2),this},th.encloses=function(e){return e&&this.x1<=e.x1&&this.x2>=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},th.alignsWith=function(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},th.intersects=function(e){return e&&!(this.x2<e.x1||this.x1>e.x2||this.y2<e.y1||this.y1>e.y2)},th.contains=function(e,t){return!(e<this.x1||e>this.x2||t<this.y1||t>this.y2)},th.width=function(){return this.x2-this.x1},th.height=function(){return this.y2-this.y1};var rh=0,nh="p_";function Gradient_isGradient(e){return e&&e.gradient}function Gradient_gradientRef(e,t,r){var n=e.id,i=e.gradient,a="radial"===i?nh:"";return n||(n=e.id="gradient_"+rh++,"radial"===i?(e.x1=src_Gradient_get(e.x1,.5),e.y1=src_Gradient_get(e.y1,.5),e.r1=src_Gradient_get(e.r1,0),e.x2=src_Gradient_get(e.x2,.5),e.y2=src_Gradient_get(e.y2,.5),e.r2=src_Gradient_get(e.r2,.5),a=nh):(e.x1=src_Gradient_get(e.x1,0),e.y1=src_Gradient_get(e.y1,0),e.x2=src_Gradient_get(e.x2,1),e.y2=src_Gradient_get(e.y2,0))),t[n]=e,"url("+(r||"")+"#"+a+n+")"}function src_Gradient_get(e,t){return null!=e?e:t}var ih=function(e,t){var r,n=[];return r={gradient:"linear",x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:n,stop:function stop(e,t){return n.push({offset:e,color:t}),r}}};function Item_Item(e){this.mark=e,this.bounds=this.bounds||new Bounds_Bounds}function GroupItem_GroupItem(e){Item_Item.call(this,e),this.items=this.items||[]}function ResourceLoader_ResourceLoader(e){this._pending=0,this._loader=e||eh()}Object(V.y)(GroupItem_GroupItem,Item_Item);var ah=ResourceLoader_ResourceLoader.prototype;function ResourceLoader_increment(e){e._pending+=1}function ResourceLoader_decrement(e){e._pending-=1}ah.pending=function(){return this._pending},ah.sanitizeURL=function(e){var t=this;return ResourceLoader_increment(t),t._loader.sanitize(e,{context:"href"}).then((function(e){return ResourceLoader_decrement(t),e})).catch((function(){return ResourceLoader_decrement(t),null}))},ah.loadImage=function(e){var t=this,r=domImage();return ResourceLoader_increment(t),t._loader.sanitize(e,{context:"image"}).then((function(e){var n=e.href;if(!n||!r)throw{url:n};var i=new r;return i.onload=function(){ResourceLoader_decrement(t),i.loaded=!0},i.onerror=function(){ResourceLoader_decrement(t),i.loaded=!1},i.src=n,i})).catch((function(e){return ResourceLoader_decrement(t),{loaded:!1,width:0,height:0,src:e&&e.url||""}}))},ah.ready=function(){var e=this;return new Promise((function(t){!function poll(r){e.pending()?setTimeout((function(){poll(!0)}),10):t(r)}(!1)}))};var oh={basis:{curve:Bn},"basis-closed":{curve:Un},"basis-open":{curve:zn},bundle:{curve:qn,tension:"beta",value:.85},cardinal:{curve:Wn,tension:"tension",value:0},"cardinal-open":{curve:Hn,tension:"tension",value:0},"cardinal-closed":{curve:Gn,tension:"tension",value:0},"catmull-rom":{curve:Vn,tension:"alpha",value:.5},"catmull-rom-closed":{curve:Yn,tension:"alpha",value:.5},"catmull-rom-open":{curve:$n,tension:"alpha",value:.5},linear:{curve:Pn},"linear-closed":{curve:Xn},monotone:{horizontal:monotoneY,vertical:monotoneX},natural:{curve:Kn},step:{curve:Jn},"step-after":{curve:stepAfter},"step-before":{curve:stepBefore}};function curves_curves(e,t,r){var n=Object(V.v)(oh,e)&&oh[e],i=null;return n&&(i=n.curve||n[t||"vertical"],n.tension&&null!=r&&(i=i[n.tension](r))),i}var sh={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},uh=[/([MLHVCSQTAZmlhvcsqtaz])/g,/###/,/(\d)([-+])/g,/\s|,|###/],lh=function(e){var t,r,n,i,a,o,s,u,l,c,f,d=[];for(u=0,c=(t=e.slice().replace(uh[0],"###$1").split(uh[1]).slice(1)).length;u<c;++u){for(n=(r=t[u]).slice(1).trim().replace(uh[2],"$1###$2").split(uh[3]),i=[o=r.charAt(0)],l=0,f=n.length;l<f;++l)(a=+n[l])===a&&i.push(a);if(s=sh[o.toLowerCase()],i.length-1>s)for(l=1,f=i.length;l<f;l+=s)d.push([o].concat(i.slice(l,l+s)));else d.push(i)}return d},ch=Math.PI/180,fh=Math.PI/2,dh=2*Math.PI,hh=Math.sqrt(3)/2,ph={},gh={},mh=[].join;function arc_bezier(e){var t=mh.call(e);if(gh[t])return gh[t];var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],c=l*o,f=-u*s,d=u*o,h=l*s,p=Math.cos(i),g=Math.sin(i),m=Math.cos(a),v=Math.sin(a),y=.5*(a-i),_=Math.sin(.5*y),b=8/3*_*_/Math.sin(y),x=r+p-b*g,w=n+g+b*p,k=r+m,S=n+v,E=k+b*v,C=S-b*m;return gh[t]=[c*x+f*w,d*x+h*w,c*E+f*C,d*E+h*C,c*k+f*S,d*k+h*S]}var vh=["l",0,0,0,0,0,0,0];function path_render_scale(e,t){var r=vh[0]=e[0];if("a"===r||"A"===r)vh[1]=t*e[1],vh[2]=t*e[2],vh[3]=e[3],vh[4]=e[4],vh[5]=e[5],vh[6]=t*e[6],vh[7]=t*e[7];else for(var n=1,i=e.length;n<i;++n)vh[n]=t*e[n];return vh}var _h=function(e,t,r,n,i){var a,o,s,u,l,c=null,f=0,d=0,h=0,p=0;null==r&&(r=0),null==n&&(n=0),null==i&&(i=1),e.beginPath&&e.beginPath();for(var g=0,m=t.length;g<m;++g){switch(a=t[g],1!==i&&(a=path_render_scale(a,i)),a[0]){case"l":f+=a[1],d+=a[2],e.lineTo(f+r,d+n);break;case"L":f=a[1],d=a[2],e.lineTo(f+r,d+n);break;case"h":f+=a[1],e.lineTo(f+r,d+n);break;case"H":f=a[1],e.lineTo(f+r,d+n);break;case"v":d+=a[1],e.lineTo(f+r,d+n);break;case"V":d=a[1],e.lineTo(f+r,d+n);break;case"m":f+=a[1],d+=a[2],e.moveTo(f+r,d+n);break;case"M":f=a[1],d=a[2],e.moveTo(f+r,d+n);break;case"c":o=f+a[5],s=d+a[6],h=f+a[3],p=d+a[4],e.bezierCurveTo(f+a[1]+r,d+a[2]+n,h+r,p+n,o+r,s+n),f=o,d=s;break;case"C":f=a[5],d=a[6],h=a[3],p=a[4],e.bezierCurveTo(a[1]+r,a[2]+n,h+r,p+n,f+r,d+n);break;case"s":o=f+a[3],s=d+a[4],h=2*f-h,p=2*d-p,e.bezierCurveTo(h+r,p+n,f+a[1]+r,d+a[2]+n,o+r,s+n),h=f+a[1],p=d+a[2],f=o,d=s;break;case"S":o=a[3],s=a[4],h=2*f-h,p=2*d-p,e.bezierCurveTo(h+r,p+n,a[1]+r,a[2]+n,o+r,s+n),f=o,d=s,h=a[1],p=a[2];break;case"q":o=f+a[3],s=d+a[4],h=f+a[1],p=d+a[2],e.quadraticCurveTo(h+r,p+n,o+r,s+n),f=o,d=s;break;case"Q":o=a[3],s=a[4],e.quadraticCurveTo(a[1]+r,a[2]+n,o+r,s+n),f=o,d=s,h=a[1],p=a[2];break;case"t":o=f+a[1],s=d+a[2],null===c[0].match(/[QqTt]/)?(h=f,p=d):"t"===c[0]?(h=2*f-u,p=2*d-l):"q"===c[0]&&(h=2*f-h,p=2*d-p),u=h,l=p,e.quadraticCurveTo(h+r,p+n,o+r,s+n),d=s,h=(f=o)+a[1],p=d+a[2];break;case"T":o=a[1],s=a[2],h=2*f-h,p=2*d-p,e.quadraticCurveTo(h+r,p+n,o+r,s+n),f=o,d=s;break;case"a":render_drawArc(e,f+r,d+n,[a[1],a[2],a[3],a[4],a[5],a[6]+f+r,a[7]+d+n]),f+=a[6],d+=a[7];break;case"A":render_drawArc(e,f+r,d+n,[a[1],a[2],a[3],a[4],a[5],a[6]+r,a[7]+n]),f=a[6],d=a[7];break;case"z":case"Z":e.closePath()}c=a}};function render_drawArc(e,t,r,n){for(var i=function path_arc_segments(e,t,r,n,i,a,o,s,u){var l=mh.call(arguments);if(ph[l])return ph[l];var c=o*ch,f=Math.sin(c),d=Math.cos(c),h=d*(s-e)*.5+f*(u-t)*.5,p=d*(u-t)*.5-f*(s-e)*.5,g=h*h/((r=Math.abs(r))*r)+p*p/((n=Math.abs(n))*n);g>1&&(r*=g=Math.sqrt(g),n*=g);var m=d/r,v=f/r,y=-f/n,_=d/n,b=m*s+v*u,x=y*s+_*u,w=m*e+v*t,k=y*e+_*t,S=1/((w-b)*(w-b)+(k-x)*(k-x))-.25;S<0&&(S=0);var E=Math.sqrt(S);a==i&&(E=-E);var C=.5*(b+w)-E*(k-x),T=.5*(x+k)+E*(w-b),O=Math.atan2(x-T,b-C),A=Math.atan2(k-T,w-C)-O;A<0&&1===a?A+=dh:A>0&&0===a&&(A-=dh);for(var R=Math.ceil(Math.abs(A/(fh+.001))),D=[],P=0;P<R;++P){var j=O+P*A/R,M=O+(P+1)*A/R;D[P]=[C,T,j,M,r,n,f,d]}return ph[l]=D}(n[5],n[6],n[0],n[1],n[3],n[4],n[2],t,r),a=0;a<i.length;++a){var o=arc_bezier(i[a]);e.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5])}}var bh={circle:{draw:function draw(e,t){var r=Math.sqrt(t)/2;e.moveTo(r,0),e.arc(0,0,r,0,dh)}},cross:{draw:function draw(e,t){var r=Math.sqrt(t)/2,n=r/2.5;e.moveTo(-r,-n),e.lineTo(-r,n),e.lineTo(-n,n),e.lineTo(-n,r),e.lineTo(n,r),e.lineTo(n,n),e.lineTo(r,n),e.lineTo(r,-n),e.lineTo(n,-n),e.lineTo(n,-r),e.lineTo(-n,-r),e.lineTo(-n,-n),e.closePath()}},diamond:{draw:function draw(e,t){var r=Math.sqrt(t)/2;e.moveTo(-r,0),e.lineTo(0,-r),e.lineTo(r,0),e.lineTo(0,r),e.closePath()}},square:{draw:function draw(e,t){var r=Math.sqrt(t),n=-r/2;e.rect(n,n,r,r)}},arrow:{draw:function draw(e,t){var r=Math.sqrt(t)/2,n=r/7,i=r/2.5,a=r/8;e.moveTo(-n,r),e.lineTo(n,r),e.lineTo(n,-a),e.lineTo(i,-a),e.lineTo(0,-r),e.lineTo(-i,-a),e.lineTo(-n,-a),e.closePath()}},wedge:{draw:function draw(e,t){var r=Math.sqrt(t)/2,n=hh*r,i=n-.5773502691896257*r,a=r/4;e.moveTo(0,-n-i),e.lineTo(-a,n-i),e.lineTo(a,n-i),e.closePath()}},triangle:{draw:function draw(e,t){var r=Math.sqrt(t)/2,n=hh*r,i=n-.5773502691896257*r;e.moveTo(0,-n-i),e.lineTo(-r,n-i),e.lineTo(r,n-i),e.closePath()}},"triangle-up":{draw:function draw(e,t){var r=Math.sqrt(t)/2,n=hh*r;e.moveTo(0,-n),e.lineTo(-r,n),e.lineTo(r,n),e.closePath()}},"triangle-down":{draw:function draw(e,t){var r=Math.sqrt(t)/2,n=hh*r;e.moveTo(0,n),e.lineTo(-r,-n),e.lineTo(r,-n),e.closePath()}},"triangle-right":{draw:function draw(e,t){var r=Math.sqrt(t)/2,n=hh*r;e.moveTo(n,0),e.lineTo(-n,-r),e.lineTo(-n,r),e.closePath()}},"triangle-left":{draw:function draw(e,t){var r=Math.sqrt(t)/2,n=hh*r;e.moveTo(-n,0),e.lineTo(n,-r),e.lineTo(n,r),e.closePath()}},stroke:{draw:function draw(e,t){var r=Math.sqrt(t)/2;e.moveTo(-r,0),e.lineTo(r,0)}}};function path_symbols_symbols(e){return Object(V.v)(bh,e)?bh[e]:function symbols_customSymbol(e){if(!Object(V.v)(xh,e)){var t=lh(e);xh[e]={draw:function draw(e,r){_h(e,t,0,0,Math.sqrt(r)/2)}}}return xh[e]}(e)}var xh={};function rectangle_rectangleX(e){return e.x}function rectangle_rectangleY(e){return e.y}function rectangle_rectangleWidth(e){return e.width}function rectangle_rectangleHeight(e){return e.height}function path_rectangle_constant(e){return function(){return e}}var wh=function(){var e=rectangle_rectangleX,t=rectangle_rectangleY,r=rectangle_rectangleWidth,n=rectangle_rectangleHeight,i=path_rectangle_constant(0),a=null;function rectangle(o,s,u){var l,c=null!=s?s:+e.call(this,o),f=null!=u?u:+t.call(this,o),d=+r.call(this,o),h=+n.call(this,o),p=+i.call(this,o);if(a||(a=l=yn()),p<=0)a.rect(c,f,d,h);else{var g=c+d,m=f+h;a.moveTo(c+p,f),a.lineTo(g-p,f),a.quadraticCurveTo(g,f,g,f+p),a.lineTo(g,m-p),a.quadraticCurveTo(g,m,g-p,m),a.lineTo(c+p,m),a.quadraticCurveTo(c,m,c,m-p),a.lineTo(c,f+p),a.quadraticCurveTo(c,f,c+p,f),a.closePath()}if(l)return a=null,l+""||null}return rectangle.x=function(t){return arguments.length?(e="function"===typeof t?t:path_rectangle_constant(+t),rectangle):e},rectangle.y=function(e){return arguments.length?(t="function"===typeof e?e:path_rectangle_constant(+e),rectangle):t},rectangle.width=function(e){return arguments.length?(r="function"===typeof e?e:path_rectangle_constant(+e),rectangle):r},rectangle.height=function(e){return arguments.length?(n="function"===typeof e?e:path_rectangle_constant(+e),rectangle):n},rectangle.cornerRadius=function(e){return arguments.length?(i="function"===typeof e?e:path_rectangle_constant(+e),rectangle):i},rectangle.context=function(e){return arguments.length?(a=null==e?null:e,rectangle):a},rectangle},kh=function(){var e,t,r,n,i,a,o,s,u=null;function point(e,t,r){var n=r/2;if(i){var l=o-t,c=e-a;if(l||c){var f=Math.sqrt(l*l+c*c),d=(l/=f)*s,h=(c/=f)*s,p=Math.atan2(c,l);u.moveTo(a-d,o-h),u.lineTo(e-l*n,t-c*n),u.arc(e,t,n,p-Math.PI,p),u.lineTo(a+d,o+h),u.arc(a,o,s,p,p+Math.PI)}else u.arc(e,t,n,0,dh);u.closePath()}else i=1;a=e,o=t,s=n}function trail(a){var o,s,l,c=a.length,f=!1;for(null==u&&(u=l=yn()),o=0;o<=c;++o)!(o<c&&n(s=a[o],o,a))===f&&(f=!f)&&(i=0),f&&point(+e(s,o,a),+t(s,o,a),+r(s,o,a));if(l)return u=null,l+""||null}return trail.x=function(t){return arguments.length?(e=t,trail):e},trail.y=function(e){return arguments.length?(t=e,trail):t},trail.size=function(e){return arguments.length?(r=e,trail):r},trail.defined=function(e){return arguments.length?(n=e,trail):n},trail.context=function(e){return arguments.length?(u=null==e?null:e,trail):u},trail};function path_shapes_x(e){return e.x||0}function path_shapes_y(e){return e.y||0}function path_shapes_cr(e){return e.cornerRadius||0}function path_shapes_def(e){return!(!1===e.defined)}var Sh=Dn().startAngle((function path_shapes_sa(e){return e.startAngle||0})).endAngle((function path_shapes_ea(e){return e.endAngle||0})).padAngle((function path_shapes_pa(e){return e.padAngle||0})).innerRadius((function shapes_ir(e){return e.innerRadius||0})).outerRadius((function path_shapes_or(e){return e.outerRadius||0})).cornerRadius(path_shapes_cr),Eh=Mn().x(path_shapes_x).y1(path_shapes_y).y0((function shapes_yh(e){return(e.y||0)+(e.height||0)})).defined(path_shapes_def),Ch=Mn().y(path_shapes_y).x1(path_shapes_x).x0((function shapes_xw(e){return(e.x||0)+(e.width||0)})).defined(path_shapes_def),Th=jn().x(path_shapes_x).y(path_shapes_y).defined(path_shapes_def),Oh=wh().x(path_shapes_x).y(path_shapes_y).width((function path_shapes_w(e){return e.width||0})).height((function path_shapes_h(e){return e.height||0})).cornerRadius(path_shapes_cr),Ah=Ln().type((function path_shapes_type(e){return path_symbols_symbols(e.shape||"circle")})).size((function path_shapes_size(e){return null==e.size?64:e.size})),Rh=kh().x(path_shapes_x).y(path_shapes_y).defined(path_shapes_def).size((function shapes_ts(e){return e.size||1}));function path_shapes_rectangle(e,t,r,n){return Oh.context(e)(t,r,n)}var Dh,Ph=function(e,t){return t.stroke&&0!==t.opacity&&0!==t.strokeOpacity&&e.expand(null!=t.strokeWidth?+t.strokeWidth:1),e},jh=dh-1e-8;function bound_boundContext_context(e){return Dh=e,bound_boundContext_context}function bound_boundContext_noop(){}function bound_boundContext_add(e,t){Dh.add(e,t)}bound_boundContext_context.beginPath=bound_boundContext_noop,bound_boundContext_context.closePath=bound_boundContext_noop,bound_boundContext_context.moveTo=bound_boundContext_add,bound_boundContext_context.lineTo=bound_boundContext_add,bound_boundContext_context.rect=function(e,t,r,n){bound_boundContext_add(e,t),bound_boundContext_add(e+r,t+n)},bound_boundContext_context.quadraticCurveTo=function(e,t,r,n){bound_boundContext_add(e,t),bound_boundContext_add(r,n)},bound_boundContext_context.bezierCurveTo=function(e,t,r,n,i,a){bound_boundContext_add(e,t),bound_boundContext_add(r,n),bound_boundContext_add(i,a)},bound_boundContext_context.arc=function(e,t,r,n,i,a){if(Math.abs(i-n)>jh)return bound_boundContext_add(e-r,t-r),void bound_boundContext_add(e+r,t+r);var o,s,u,l,c=1/0,f=-1/0,d=1/0,h=-1/0;function update(e){u=r*Math.cos(e),l=r*Math.sin(e),u<c&&(c=u),u>f&&(f=u),l<d&&(d=l),l>h&&(h=l)}if(update(n),update(i),i!==n)if((n%=dh)<0&&(n+=dh),(i%=dh)<0&&(i+=dh),i<n&&(a=!a,o=n,n=i,i=o),a)for(i-=dh,o=n-n%fh,s=0;s<4&&o>i;++s,o-=fh)update(o);else for(o=n-n%fh+fh,s=0;s<4&&o<i;++s,o+=fh)update(o);bound_boundContext_add(e+c,t+d),bound_boundContext_add(e+f,t+h)};var Mh=(Mh=domCanvas(1,1))?Mh.getContext("2d"):null,Fh=new Bounds_Bounds;function intersect_intersectPath(e){return function(t,r){if(!Mh)return!0;e(Mh,t),Fh.clear().union(t.bounds).intersect(r).round();for(var n=Fh.x1,i=Fh.y1,a=Fh.x2,o=Fh.y2,s=i;s<=o;++s)for(var u=n;u<=a;++u)if(Mh.isPointInPath(u,s))return!0;return!1}}function intersect_intersectPoint(e,t){return t.contains(e.x||0,e.y||0)}function intersect_intersectRect(e,t){var r=e.x||0,n=e.y||0,i=e.width||0,a=e.height||0;return t.intersects(Fh.set(r,n,r+i,n+a))}function intersect_intersectRule(e,t){var r=e.x||0,n=e.y||0;return intersect_intersectBoxLine(t,r,n,null!=e.x2?e.x2:r,null!=e.y2?e.y2:n)}function intersect_intersectBoxLine(e,t,r,n,i){var a,o,s,u,l=e.x1,c=e.y1,f=e.x2,d=e.y2,h=n-t,p=i-r,g=0,m=1;for(u=0;u<4;++u){if(0===u&&(a=-h,o=-(l-t)),1===u&&(a=h,o=f-t),2===u&&(a=-p,o=-(c-r)),3===u&&(a=p,o=d-r),Math.abs(a)<1e-10&&o<0)return!1;if(s=o/a,a<0){if(s>m)return!1;s>g&&(g=s)}else if(a>0){if(s<g)return!1;s<m&&(m=s)}}return!0}var Ih=function(e,t,r){return Gradient_isGradient(r)?function(e,t,r){for(var n=r.width(),i=r.height(),a=t.stops,o=a.length,s="radial"===t.gradient?e.createRadialGradient(r.x1+(t.x1||.5)*n,r.y1+(t.y1||.5)*i,Math.max(n,i)*(t.r1||0),r.x1+(t.x2||.5)*n,r.y1+(t.y2||.5)*i,Math.max(n,i)*(t.r2||.5)):e.createLinearGradient(r.x1+(t.x1||0)*n,r.y1+(t.y1||0)*i,r.x1+(t.x2||1)*n,r.y1+(t.y2||0)*i),u=0;u<o;++u)s.addColorStop(a[u].offset,a[u].color);return s}(e,r,t.bounds):r},Lh=function(e,t,r){return(r*=null==t.fillOpacity?1:t.fillOpacity)>0&&(e.globalAlpha=r,e.fillStyle=Ih(e,t,t.fill),!0)},Nh=[],Bh=function(e,t,r){var n=null!=(n=t.strokeWidth)?n:1;return!(n<=0)&&((r*=null==t.strokeOpacity?1:t.strokeOpacity)>0&&(e.globalAlpha=r,e.strokeStyle=Ih(e,t,t.stroke),e.lineWidth=n,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||Nh),e.lineDashOffset=t.strokeDashOffset||0),!0))};function util_visit_compare(e,t){return e.zindex-t.zindex||e.index-t.index}function visit_zorder(e){if(!e.zdirty)return e.zitems;var t,r,n,i=e.items,a=[];for(r=0,n=i.length;r<n;++r)(t=i[r]).index=r,t.zindex&&a.push(t);return e.zdirty=!1,e.zitems=a.sort(util_visit_compare)}function util_visit_visit(e,t){var r,n,i=e.items;if(i&&i.length){var a=visit_zorder(e);if(a&&a.length){for(r=0,n=i.length;r<n;++r)i[r].zindex||t(i[r]);i=a}for(r=0,n=i.length;r<n;++r)t(i[r])}}function visit_pickVisit(e,t){var r,n,i=e.items;if(!i||!i.length)return null;var a=visit_zorder(e);for(a&&a.length&&(i=a),n=i.length;--n>=0;)if(r=t(i[n]))return r;if(i===a)for(n=(i=e.items).length;--n>=0;)if(!i[n].zindex&&(r=t(i[n])))return r;return null}function draw_drawAll(e){return function(t,r,n){util_visit_visit(r,(function(r){n&&!n.intersects(r.bounds)||draw_drawPath(e,t,r,r)}))}}function draw_drawPath(e,t,r,n){var i=null==r.opacity?1:r.opacity;0!==i&&(e(t,n)||(r.fill&&Lh(t,r,i)&&t.fill(),r.stroke&&Bh(t,r,i)&&t.stroke()))}function canvas_pick_pick(e){return e=e||V.eb,function(t,r,n,i,a,o){return n*=t.pixelRatio,i*=t.pixelRatio,visit_pickVisit(r,(function(r){var s=r.bounds;if((!s||s.contains(a,o))&&s)return e(t,r,n,i,a,o)?r:void 0}))}}function pick_hitPath(e,t){return function(r,n,i,a){var o,s,u=Array.isArray(n)?n[0]:n,l=null==t?u.fill:t,c=u.stroke&&r.isPointInStroke;return c&&(o=u.strokeWidth,s=u.strokeCap,r.lineWidth=null!=o?o:1,r.lineCap=null!=s?s:"butt"),!e(r,n)&&(l&&r.isPointInPath(i,a)||c&&r.isPointInStroke(i,a))}}function pick_pickPath(e){return canvas_pick_pick(pick_hitPath(e))}function svg_transform_translate(e,t){return"translate("+e+","+t+")"}function svg_transform_rotate(e){return"rotate("+e+")"}function transform_translateItem(e){return svg_transform_translate(e.x||0,e.y||0)}var Uh=function(e,t,r){function draw(e,r){var n=r.x||0,i=r.y||0,a=r.angle||0;e.translate(n,i),a&&e.rotate(a*=ch),e.beginPath(),t(e,r),a&&e.rotate(-a),e.translate(-n,-i)}return{type:e,tag:"path",nested:!1,attr:function attr(e,r){e("transform",function transform_transformItem(e){return svg_transform_translate(e.x||0,e.y||0)+(e.angle?" "+svg_transform_rotate(e.angle):"")}(r)),e("d",t(null,r))},bound:function bound(e,r){var n=r.x||0,i=r.y||0;return t(bound_boundContext_context(e),r),Ph(e,r).translate(n,i),r.angle&&e.rotate(r.angle*ch,n,i),e},draw:draw_drawAll(draw),pick:pick_pickPath(draw),isect:r||intersect_intersectPath(draw)}},zh=Uh("arc",(function path_shapes_arc(e,t){return Sh.context(e)(t)}));var qh=function(e,t,r){function draw(e,r){e.beginPath(),t(e,r)}var n,i=pick_hitPath(draw);return{type:e,tag:"path",nested:!0,attr:function attr(e,r){var n=r.mark.items;n.length&&e("d",t(null,n))},bound:function bound(e,r){var n=r.items;return 0===n.length?e:(t(bound_boundContext_context(e),n),Ph(e,n[0]))},draw:(n=draw,function(e,t,r){!t.items.length||r&&!r.intersects(t.bounds)||draw_drawPath(n,e,t.items[0],t.items)}),pick:function pick(e,t,r,n,a,o){var s=t.items,u=t.bounds;return!s||!s.length||u&&!u.contains(a,o)?null:(r*=e.pixelRatio,n*=e.pixelRatio,i(e,s,r,n)?s[0]:null)},isect:intersect_intersectPoint,tip:r}},Wh=qh("area",(function path_shapes_area(e,t){var r=t[0],n=r.interpolate||"linear";return("horizontal"===r.orient?Ch:Eh).curve(curves_curves(n,r.orient,r.tension)).context(e)(t)}),(function pickPath_pickArea(e,t){for(var r,n,i="horizontal"===e[0].orient?t[1]:t[0],a="horizontal"===e[0].orient?"y":"x",o=e.length,s=1/0;--o>=0;)!1!==e[o].defined&&(n=Math.abs(e[o][a]-i))<s&&(s=n,r=e[o]);return r})),Gh=1;function clip_resetSVGClipId(){Gh=1}var Hh=function(e,t,r){var n=t.clip,i=e._defs,a=t.clip_id||(t.clip_id="clip"+Gh++),o=i.clipping[a]||(i.clipping[a]={id:a});return Object(V.D)(n)?o.path=n(null):(o.width=r.width||0,o.height=r.height||0),"url(#"+a+")"},Vh=.5;function group_backgroundPath(e,t){var r=t.stroke?Vh:0;e.beginPath(),path_shapes_rectangle(e,t,r,r)}var Yh=pick_hitPath(group_backgroundPath);var $h={type:"group",tag:"g",nested:!1,attr:function marks_group_attr(e,t){e("transform",transform_translateItem(t))},bound:function marks_group_bound(e,t){if(!t.clip&&t.items)for(var r=t.items,n=0,i=r.length;n<i;++n)e.union(r[n].bounds);return(t.clip||t.width||t.height)&&!t.noBound&&e.add(0,0).add(t.width||0,t.height||0),Ph(e,t),e.translate(t.x||0,t.y||0)},draw:function marks_group_draw(e,t,r){var n=this;util_visit_visit(t,(function(t){var i,a=t.x||0,o=t.y||0,s=t.width||0,u=t.height||0;e.save(),e.translate(a,o),(t.stroke||t.fill)&&(i=null==t.opacity?1:t.opacity)>0&&(group_backgroundPath(e,t),t.fill&&Lh(e,t,i)&&e.fill(),t.stroke&&Bh(e,t,i)&&e.stroke()),t.clip&&(e.beginPath(),e.rect(0,0,s,u),e.clip()),r&&r.translate(-a,-o),util_visit_visit(t,(function(t){n.draw(e,t,r)})),r&&r.translate(a,o),e.restore()}))},pick:function marks_group_pick(e,t,r,n,i,a){if(t.bounds&&!t.bounds.contains(i,a)||!t.items)return null;var o=this,s=r*e.pixelRatio,u=n*e.pixelRatio;return visit_pickVisit(t,(function(l){var c,f,d,h;if(!(h=l.bounds)||h.contains(i,a))return f=l.x||0,d=l.y||0,e.save(),e.translate(f,d),f=i-f,d=a-d,!(c=visit_pickVisit(l,(function(e){return function group_pickMark(e,t,r){return(!1!==e.interactive||"group"===e.marktype)&&e.bounds&&e.bounds.contains(t,r)}(e,f,d)?o.pick(e,r,n,f,d):null})))&&!1!==t.interactive&&(l.fill||l.stroke)&&Yh(e,l,s,u)&&(c=l),e.restore(),c||null}))},isect:intersect_intersectRect,background:function group_background(e,t){var r=t.stroke?Vh:0;e("class","background"),e("d",path_shapes_rectangle(null,t,r,r))},foreground:function group_foreground(e,t,r){e("clip-path",t.clip?Hh(r,t,t):null)}};function image_getImage(e,t){var r=e.image;return r&&r.url===e.url||(r={loaded:!1,width:0,height:0},t.loadImage(e.url).then((function(t){e.image=t,e.image.url=e.url}))),r}function image_imageXOffset(e,t){return"center"===e?t/2:"right"===e?t:0}function image_imageYOffset(e,t){return"middle"===e?t/2:"bottom"===e?t:0}var Xh={type:"image",tag:"image",nested:!1,attr:function marks_image_attr(e,t,r){var n=image_getImage(t,r),i=t.x||0,a=t.y||0,o=(null!=t.width?t.width:n.width)||0,s=(null!=t.height?t.height:n.height)||0,u=!1===t.aspect?"none":"xMidYMid";i-=image_imageXOffset(t.align,o),a-=image_imageYOffset(t.baseline,s),e("href",n.src||"","http://www.w3.org/1999/xlink","xlink:href"),e("transform",svg_transform_translate(i,a)),e("width",o),e("height",s),e("preserveAspectRatio",u)},bound:function marks_image_bound(e,t){var r=t.image,n=t.x||0,i=t.y||0,a=(null!=t.width?t.width:r&&r.width)||0,o=(null!=t.height?t.height:r&&r.height)||0;return n-=image_imageXOffset(t.align,a),i-=image_imageYOffset(t.baseline,o),e.set(n,i,n+a,i+o)},draw:function marks_image_draw(e,t,r){var n=this;util_visit_visit(t,(function(t){if(!r||r.intersects(t.bounds)){var i,a,o,s,u=image_getImage(t,n),l=t.x||0,c=t.y||0,f=(null!=t.width?t.width:u.width)||0,d=(null!=t.height?t.height:u.height)||0;l-=image_imageXOffset(t.align,f),c-=image_imageYOffset(t.baseline,d),!1!==t.aspect&&(a=u.width/u.height,o=t.width/t.height,a===a&&o===o&&a!==o&&(o<a?(c+=(d-(s=f/a))/2,d=s):(l+=(f-(s=d*a))/2,f=s))),u.loaded&&(e.globalAlpha=null!=(i=t.opacity)?i:1,e.drawImage(u,l,c,f,d))}}))},pick:canvas_pick_pick(),isect:V.eb,get:image_getImage,xOffset:image_imageXOffset,yOffset:image_imageYOffset},Kh=qh("line",(function path_shapes_line(e,t){var r=t[0],n=r.interpolate||"linear";return Th.curve(curves_curves(n,r.orient,r.tension)).context(e)(t)}),(function pickPath_pickLine(e,t){for(var r,n,i=Math.pow(e[0].strokeWidth||1,2),a=e.length;--a>=0;)if(!1!==e[a].defined&&(r=e[a].x-t[0])*r+(n=e[a].y-t[1])*n<i)return e[a];return null}));function src_marks_path_path(e,t){var r=t.path;if(null==r)return!0;var n=t.pathCache;n&&n.path===r||((t.pathCache=n=lh(r)).path=r),_h(e,n,t.x,t.y)}var Jh={type:"path",tag:"path",nested:!1,attr:function marks_path_attr(e,t){e("transform",transform_translateItem(t)),e("d",t.path)},bound:function marks_path_bound(e,t){return src_marks_path_path(bound_boundContext_context(e),t)?e.set(0,0,0,0):Ph(e,t)},draw:draw_drawAll(src_marks_path_path),pick:pick_pickPath(src_marks_path_path),isect:intersect_intersectPath(src_marks_path_path)};function marks_rect_draw(e,t){e.beginPath(),path_shapes_rectangle(e,t)}var Qh={type:"rect",tag:"path",nested:!1,attr:function marks_rect_attr(e,t){e("d",path_shapes_rectangle(null,t))},bound:function marks_rect_bound(e,t){var r,n;return Ph(e.set(r=t.x||0,n=t.y||0,r+t.width||0,n+t.height||0),t)},draw:draw_drawAll(marks_rect_draw),pick:pick_pickPath(marks_rect_draw),isect:intersect_intersectRect};function marks_rule_path(e,t,r){var n,i,a,o;return!(!t.stroke||!Bh(e,t,r))&&(n=t.x||0,i=t.y||0,a=null!=t.x2?t.x2:n,o=null!=t.y2?t.y2:i,e.beginPath(),e.moveTo(n,i),e.lineTo(a,o),!0)}var Zh,ep={type:"rule",tag:"line",nested:!1,attr:function marks_rule_attr(e,t){e("transform",transform_translateItem(t)),e("x2",null!=t.x2?t.x2-(t.x||0):0),e("y2",null!=t.y2?t.y2-(t.y||0):0)},bound:function marks_rule_bound(e,t){var r,n;return Ph(e.set(r=t.x||0,n=t.y||0,null!=t.x2?t.x2:r,null!=t.y2?t.y2:n),t)},draw:function marks_rule_draw(e,t,r){util_visit_visit(t,(function(t){if(!r||r.intersects(t.bounds)){var n=null==t.opacity?1:t.opacity;n&&marks_rule_path(e,t,n)&&e.stroke()}}))},pick:canvas_pick_pick((function marks_rule_hit(e,t,r,n){return!!e.isPointInStroke&&(marks_rule_path(e,t,1)&&e.isPointInStroke(r,n))})),isect:intersect_intersectRule},tp=Uh("shape",(function path_shapes_shape(e,t){return(t.mark.shape||t.shape).context(e)(t)})),rp=Uh("symbol",(function path_shapes_symbol(e,t){return Ah.context(e)(t)}),intersect_intersectPoint),np={height:util_text_fontSize,measureWidth:text_measureWidth,estimateWidth:text_estimateWidth,width:text_estimateWidth,canvas:text_useCanvas};function text_estimateWidth(e){return Zh=util_text_fontSize(e),text_estimate(text_textValue(e))}function text_estimate(e){return~~(.8*e.length*Zh)}function text_measureWidth(e){return util_text_fontSize(e)<=0?0:(Mh.font=util_text_font(e),util_text_measure(text_textValue(e)))}function util_text_measure(e){return Mh.measureText(e).width}function util_text_fontSize(e){return null!=e.fontSize?e.fontSize:11}function text_useCanvas(e){np.width=e&&Mh?text_measureWidth:text_estimateWidth}function text_textValue(e){var t=e.text;return null==t?"":e.limit>0?function text_truncate(e){var t,r=+e.limit,n=e.text+"";np.width===text_measureWidth?(Mh.font=util_text_font(e),t=util_text_measure):(Zh=util_text_fontSize(e),t=text_estimate);if(t(n)<r)return n;var i,a=e.ellipsis||"\u2026",o="rtl"===e.dir,s=0,u=n.length;if(r-=t(a),o){for(;s<u;)i=s+u>>>1,t(n.slice(i))>r?s=i+1:u=i;return a+n.slice(s)}for(;s<u;)i=1+(s+u>>>1),t(n.slice(0,i))<r?s=i:u=i-1;return n.slice(0,s)+a}(e):t+""}function text_fontFamily(e,t){var r=e.font;return(t&&r?String(r).replace(/"/g,"'"):r)||"sans-serif"}function util_text_font(e,t){return(e.fontStyle?e.fontStyle+" ":"")+(e.fontVariant?e.fontVariant+" ":"")+(e.fontWeight?e.fontWeight+" ":"")+util_text_fontSize(e)+"px "+text_fontFamily(e,t)}function util_text_offset(e){var t=e.baseline,r=util_text_fontSize(e);return Math.round("top"===t?.79*r:"middle"===t?.3*r:"bottom"===t?-.21*r:0)}text_useCanvas(!0);var ip={left:"start",center:"middle",right:"end"},ap=new Bounds_Bounds;function text_anchorPoint(e){var t,r=e.x||0,n=e.y||0,i=e.radius||0;return i&&(t=(e.theta||0)-fh,r+=i*Math.cos(t),n+=i*Math.sin(t)),ap.x1=r,ap.y1=n,ap}function marks_text_bound(e,t,r){var n,i=np.height(t),a=t.align,o=text_anchorPoint(t),s=o.x1,u=o.y1,l=t.dx||0,c=(t.dy||0)+util_text_offset(t)-Math.round(.8*i);if(n=np.width(t),"center"===a?l-=n/2:"right"===a&&(l-=n),e.set(l+=s,c+=u,l+n,c+i),t.angle&&!r)e.rotate(t.angle*ch,s,u);else if(2===r)return e.rotatedPoints(t.angle*ch,s,u);return e}var op={arc:zh,area:Wh,group:$h,image:Xh,line:Kh,path:Jh,rect:Qh,rule:ep,shape:tp,symbol:rp,text:{type:"text",tag:"text",nested:!1,attr:function marks_text_attr(e,t){var r,n=t.dx||0,i=(t.dy||0)+util_text_offset(t),a=text_anchorPoint(t),o=a.x1,s=a.y1,u=t.angle||0;e("text-anchor",ip[t.align]||"start"),u?(r=svg_transform_translate(o,s)+" "+svg_transform_rotate(u),(n||i)&&(r+=" "+svg_transform_translate(n,i))):r=svg_transform_translate(o+n,s+i),e("transform",r)},bound:marks_text_bound,draw:function marks_text_draw(e,t,r){util_visit_visit(t,(function(t){var n,i,a,o,s;r&&!r.intersects(t.bounds)||(s=text_textValue(t))&&(0===(n=null==t.opacity?1:t.opacity)||t.fontSize<=0||(e.font=util_text_font(t),e.textAlign=t.align||"left",a=(i=text_anchorPoint(t)).x1,o=i.y1,t.angle&&(e.save(),e.translate(a,o),e.rotate(t.angle*ch),a=o=0),a+=t.dx||0,o+=(t.dy||0)+util_text_offset(t),t.fill&&Lh(e,t,n)&&e.fillText(s,a,o),t.stroke&&Bh(e,t,n)&&e.strokeText(s,a,o),t.angle&&e.restore()))}))},pick:canvas_pick_pick((function marks_text_hit(e,t,r,n,i,a){if(t.fontSize<=0)return!1;if(!t.angle)return!0;var o=text_anchorPoint(t),s=o.x1,u=o.y1,l=marks_text_bound(ap,t,1),c=-t.angle*ch,f=Math.cos(c),d=Math.sin(c),h=f*i-d*a+(s-f*s+d*u),p=d*i+f*a+(u-d*s-f*u);return l.contains(h,p)})),isect:function text_intersectText(e,t){var r=marks_text_bound(ap,e,2);return intersect_intersectBoxLine(t,r[0],r[1],r[2],r[3])||intersect_intersectBoxLine(t,r[0],r[1],r[4],r[5])||intersect_intersectBoxLine(t,r[4],r[5],r[6],r[7])||intersect_intersectBoxLine(t,r[2],r[3],r[6],r[7])}},trail:qh("trail",(function path_shapes_trail(e,t){return Rh.context(e)(t)}),(function pickPath_pickTrail(e,t){for(var r,n,i=e.length;--i>=0;)if(!1!==e[i].defined&&(r=e[i].x-t[0])*r+(n=e[i].y-t[1])*n<(r=e[i].size||1)*r)return e[i];return null}))},sp=function(e,t,r){var n=op[e.mark.marktype],i=t||n.bound;return n.nested&&(e=e.mark),i(e.bounds||(e.bounds=new Bounds_Bounds),e,r)},up={mark:null},lp=function(e,t,r){var n,i,a,o,s=op[e.marktype],u=s.bound,l=e.items,c=l&&l.length;if(s.nested)return c?a=l[0]:(up.mark=e,a=up),o=sp(a,u,r),t=t&&t.union(o)||o;if(t=t||e.bounds&&e.bounds.clear()||new Bounds_Bounds,c)for(n=0,i=l.length;n<i;++n)t.union(sp(l[n],u,r));return e.bounds=t},cp=["marktype","name","role","interactive","clip","items","zindex","x","y","width","height","align","baseline","fill","fillOpacity","opacity","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","startAngle","endAngle","innerRadius","outerRadius","cornerRadius","padAngle","interpolate","tension","orient","defined","url","path","x2","y2","size","shape","text","angle","theta","radius","dx","dy","font","fontSize","fontWeight","fontStyle","fontVariant"];function serialize_sceneToJSON(e,t){return JSON.stringify(e,cp,t)}function serialize_sceneFromJSON(e){return function util_serialize_initialize(e){var t,r,n,i=e.marktype,a=e.items;if(a)for(r=0,n=a.length;r<n;++r)t=i?"mark":"group",a[r][t]=e,a[r].zindex&&(a[r][t].zdirty=!0),"group"===(i||t)&&util_serialize_initialize(a[r]);i&&lp(e);return e}("string"===typeof e?JSON.parse(e):e)}function Scenegraph_Scenegraph(e){arguments.length?this.root=serialize_sceneFromJSON(e):(this.root=Scenegraph_createMark({marktype:"group",name:"root",role:"frame"}),this.root.items=[new GroupItem_GroupItem(this.root)])}var fp=Scenegraph_Scenegraph.prototype;function Scenegraph_createMark(e,t){return{bounds:new Bounds_Bounds,clip:!!e.clip,group:t,interactive:!1!==e.interactive,items:[],marktype:e.marktype,name:e.name||void 0,role:e.role||void 0,zindex:e.zindex||0}}function dom_domCreate(e,t,r){return!e&&"undefined"!==typeof document&&document.createElement&&(e=document),e?r?e.createElementNS(r,t):e.createElement(t):null}function dom_domFind(e,t){t=t.toLowerCase();for(var r=e.childNodes,n=0,i=r.length;n<i;++n)if(r[n].tagName.toLowerCase()===t)return r[n]}function dom_domChild(e,t,r,n){var i,a=e.childNodes[t];return a&&a.tagName.toLowerCase()===r.toLowerCase()||(i=a||null,a=dom_domCreate(e.ownerDocument,r,n),e.insertBefore(a,i)),a}function dom_domClear(e,t){for(var r=e.childNodes,n=r.length;n>t;)e.removeChild(r[--n]);return e}function dom_cssClass(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}fp.toJSON=function(e){return serialize_sceneToJSON(this.root,e||0)},fp.mark=function(e,t,r){var n=Scenegraph_createMark(e,t=t||this.root.items[0]);return t.items[r]=n,n.zindex&&(n.group.zdirty=!0),n};var dp=function(e,t){var r=t.getBoundingClientRect();return[e.clientX-r.left-(t.clientLeft||0),e.clientY-r.top-(t.clientTop||0)]};function src_Handler_Handler(e,t){this._active=null,this._handlers={},this._loader=e||eh(),this._tooltip=t||Handler_defaultTooltip}function Handler_defaultTooltip(e,t,r,n){e.element().setAttribute("title",n||"")}var hp=src_Handler_Handler.prototype;function src_Renderer_Renderer(e){this._el=null,this._bgcolor=null,this._loader=new ResourceLoader_ResourceLoader(e)}hp.initialize=function(e,t,r){return this._el=e,this._obj=r||null,this.origin(t)},hp.element=function(){return this._el},hp.canvas=function(){return this._el&&this._el.firstChild},hp.origin=function(e){return arguments.length?(this._origin=e||[0,0],this):this._origin.slice()},hp.scene=function(e){return arguments.length?(this._scene=e,this):this._scene},hp.on=function(){},hp.off=function(){},hp._handlerIndex=function(e,t,r){for(var n=e?e.length:0;--n>=0;)if(e[n].type===t&&(!r||e[n].handler===r))return n;return-1},hp.handlers=function(e){var t,r=this._handlers,n=[];if(e)n.push.apply(n,r[this.eventName(e)]);else for(t in r)n.push.apply(n,r[t]);return n},hp.eventName=function(e){var t=e.indexOf(".");return t<0?e:e.slice(0,t)},hp.handleHref=function(e,t,r){this._loader.sanitize(r,{context:"href"}).then((function(t){var r=new MouseEvent(e.type,e),n=dom_domCreate(null,"a");for(var i in t)n.setAttribute(i,t[i]);n.dispatchEvent(r)})).catch((function(){}))},hp.handleTooltip=function(e,t,r){if(t&&null!=t.tooltip){t=function(e,t,r,n){var i,a,o=e&&e.mark;if(o&&(i=op[o.marktype]).tip){for((a=dp(t,r))[0]-=n[0],a[1]-=n[1];e=e.mark.group;)a[0]-=e.x||0,a[1]-=e.y||0;e=i.tip(o.items,a)}return e}(t,e,this.canvas(),this._origin);var n=r&&t&&t.tooltip||null;this._tooltip.call(this._obj,this,e,t,n)}},hp.getItemBoundingClientRect=function(e){if(t=this.canvas()){for(var t,r=t.getBoundingClientRect(),n=this._origin,i=e.bounds,a=i.x1+n[0]+r.left,o=i.y1+n[1]+r.top,s=i.width(),u=i.height();e.mark&&(e=e.mark.group);)a+=e.x||0,o+=e.y||0;return{x:a,y:o,width:s,height:u,left:a,top:o,right:a+s,bottom:o+u}}};var pp=src_Renderer_Renderer.prototype;pp.initialize=function(e,t,r,n,i){return this._el=e,this.resize(t,r,n,i)},pp.element=function(){return this._el},pp.canvas=function(){return this._el&&this._el.firstChild},pp.background=function(e){return 0===arguments.length?this._bgcolor:(this._bgcolor=e,this)},pp.resize=function(e,t,r,n){return this._width=e,this._height=t,this._origin=r||[0,0],this._scale=n||1,this},pp.dirty=function(){},pp.render=function(e){var t=this;return t._call=function(){t._render(e)},t._call(),t._call=null,t},pp._render=function(){},pp.renderAsync=function(e){var t=this.render(e);return this._ready?this._ready.then((function(){return t})):Promise.resolve(t)},pp._load=function(e,t){var r=this,n=r._loader[e](t);if(!r._ready){var i=r._call;r._ready=r._loader.ready().then((function(e){e&&i(),r._ready=null}))}return n},pp.sanitizeURL=function(e){return this._load("sanitizeURL",e)},pp.loadImage=function(e){return this._load("loadImage",e)};var gp="mouseout";function CanvasHandler_CanvasHandler(e,t){src_Handler_Handler.call(this,e,t),this._down=null,this._touch=null,this._first=!0}var mp=Object(V.y)(CanvasHandler_CanvasHandler,src_Handler_Handler);function CanvasHandler_move(e,t,r){return function(n){var i=this._active,a=this.pickEvent(n);a===i?this.fire(e,n):(i&&i.exit||this.fire(r,n),this._active=a,this.fire(t,n),this.fire(e,n))}}function CanvasHandler_inactive(e){return function(t){this.fire(e,t),this._active=null}}mp.initialize=function(e,t,r){var n=this._canvas=e&&dom_domFind(e,"canvas");if(n){var i=this;this.events.forEach((function(e){n.addEventListener(e,(function(t){mp[e]?mp[e].call(i,t):i.fire(e,t)}))}))}return src_Handler_Handler.prototype.initialize.call(this,e,t,r)},mp.canvas=function(){return this._canvas},mp.context=function(){return this._canvas.getContext("2d")},mp.events=["keydown","keypress","keyup","dragenter","dragleave","dragover","mousedown","mouseup","mousemove","mouseout","mouseover","click","dblclick","wheel","mousewheel","touchstart","touchmove","touchend"],mp.DOMMouseScroll=function(e){this.fire("mousewheel",e)},mp.mousemove=CanvasHandler_move("mousemove","mouseover","mouseout"),mp.dragover=CanvasHandler_move("dragover","dragenter","dragleave"),mp.mouseout=CanvasHandler_inactive("mouseout"),mp.dragleave=CanvasHandler_inactive("dragleave"),mp.mousedown=function(e){this._down=this._active,this.fire("mousedown",e)},mp.click=function(e){this._down===this._active&&(this.fire("click",e),this._down=null)},mp.touchstart=function(e){this._touch=this.pickEvent(e.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire("touchstart",e,!0)},mp.touchmove=function(e){this.fire("touchmove",e,!0)},mp.touchend=function(e){this.fire("touchend",e,!0),this._touch=null},mp.fire=function(e,t,r){var n,i,a=r?this._touch:this._active,o=this._handlers[e];if(t.vegaType=e,"click"===e&&a&&a.href?this.handleHref(t,a,a.href):"mousemove"!==e&&e!==gp||this.handleTooltip(t,a,e!==gp),o)for(n=0,i=o.length;n<i;++n)o[n].handler.call(this._obj,t,a)},mp.on=function(e,t){var r=this.eventName(e),n=this._handlers;return this._handlerIndex(n[r],e,t)<0&&(n[r]||(n[r]=[])).push({type:e,handler:t}),this},mp.off=function(e,t){var r=this.eventName(e),n=this._handlers[r],i=this._handlerIndex(n,e,t);return i>=0&&n.splice(i,1),this},mp.pickEvent=function(e){var t=dp(e,this._canvas),r=this._origin;return this.pick(this._scene,t[0],t[1],t[0]-r[0],t[1]-r[1])},mp.pick=function(e,t,r,n,i){var a=this.context();return op[e.marktype].pick.call(this,a,e,t,r,n,i)};var vp=function resize_devicePixelRatio(){return"undefined"!==typeof window&&window.devicePixelRatio||1}();function CanvasRenderer_CanvasRenderer(e){src_Renderer_Renderer.call(this,e),this._redraw=!1,this._dirty=new Bounds_Bounds}var yp=Object(V.y)(CanvasRenderer_CanvasRenderer,src_Renderer_Renderer),_p=src_Renderer_Renderer.prototype,bp=new Bounds_Bounds;function SVGHandler_SVGHandler(e,t){src_Handler_Handler.call(this,e,t);var r=this;r._hrefHandler=SVGHandler_listener(r,(function(e,t){t&&t.href&&r.handleHref(e,t,t.href)})),r._tooltipHandler=SVGHandler_listener(r,(function(e,t){r.handleTooltip(e,t,e.type!==gp)}))}yp.initialize=function(e,t,r,n,i,a){return this._options=a,this._canvas=domCanvas(1,1,a&&a.type),e&&(dom_domClear(e,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),_p.initialize.call(this,e,t,r,n,i)},yp.resize=function(e,t,r,n){return _p.resize.call(this,e,t,r,n),function(e,t,r,n,i,a){var o,s="undefined"!==typeof HTMLElement&&e instanceof HTMLElement&&null!=e.parentNode,u=e.getContext("2d"),l=s?vp:i;for(o in e.width=t*l,e.height=r*l,a)u[o]=a[o];s&&1!==l&&(e.style.width=t+"px",e.style.height=r+"px"),u.pixelRatio=l,u.setTransform(l,0,0,l,l*n[0],l*n[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options&&this._options.context),this._redraw=!0,this},yp.canvas=function(){return this._canvas},yp.context=function(){return this._canvas?this._canvas.getContext("2d"):null},yp.dirty=function(e){var t=function src_CanvasRenderer_translate(e,t){if(null==t)return e;for(var r=bp.clear().union(e);null!=t;t=t.mark.group)r.translate(t.x||0,t.y||0);return r}(e.bounds,e.mark.group);this._dirty.union(t)},yp._render=function(e){var t=this.context(),r=this._origin,n=this._width,i=this._height,a=this._dirty;return t.save(),this._redraw||a.empty()?(this._redraw=!1,a=null):a=function CanvasRenderer_clipToBounds(e,t,r){return t.expand(1).round(),t.translate(-r[0]%1,-r[1]%1),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}(t,a,r),this.clear(-r[0],-r[1],n,i),this.draw(t,e,a),t.restore(),this._dirty.clear(),this},yp.draw=function(e,t,r){var n=op[t.marktype];t.clip&&function(e,t){var r=t.clip;if(e.save(),e.beginPath(),Object(V.D)(r))r(e);else{var n=t.group;e.rect(0,0,n.width||0,n.height||0)}e.clip()}(e,t),n.draw.call(this,e,t,r),t.clip&&e.restore()},yp.clear=function(e,t,r,n){var i=this.context();i.clearRect(e,t,r,n),null!=this._bgcolor&&(i.fillStyle=this._bgcolor,i.fillRect(e,t,r,n))};var xp=Object(V.y)(SVGHandler_SVGHandler,src_Handler_Handler);function SVGHandler_listener(e,t){return function(r){var n=r.target.__data__;r.vegaType=r.type,n=Array.isArray(n)?n[0]:n,t.call(e._obj,r,n)}}function tags_openTag(e,t,r){var n,i,a="<"+e;if(t)for(n in t)null!=(i=t[n])&&(a+=" "+n+'="'+i+'"');return r&&(a+=" "+r),a+">"}function tags_closeTag(e){return"</"+e+">"}xp.initialize=function(e,t,r){var n=this._svg;return n&&(n.removeEventListener("click",this._hrefHandler),n.removeEventListener("mousemove",this._tooltipHandler),n.removeEventListener(gp,this._tooltipHandler)),this._svg=n=e&&dom_domFind(e,"svg"),n&&(n.addEventListener("click",this._hrefHandler),n.addEventListener("mousemove",this._tooltipHandler),n.addEventListener(gp,this._tooltipHandler)),src_Handler_Handler.prototype.initialize.call(this,e,t,r)},xp.canvas=function(){return this._svg},xp.on=function(e,t){var r=this.eventName(e),n=this._handlers;if(this._handlerIndex(n[r],e,t)<0){var i={type:e,handler:t,listener:SVGHandler_listener(this,t)};(n[r]||(n[r]=[])).push(i),this._svg&&this._svg.addEventListener(r,i.listener)}return this},xp.off=function(e,t){var r=this.eventName(e),n=this._handlers[r],i=this._handlerIndex(n,e,t);return i>=0&&(this._svg&&this._svg.removeEventListener(r,n[i].listener),n.splice(i,1)),this};var wp={version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},kp={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",strokeCap:"stroke-linecap",strokeJoin:"stroke-linejoin",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeMiterLimit:"stroke-miterlimit",opacity:"opacity"},Sp=Object.keys(kp),Ep=wp.xmlns;function SVGRenderer_SVGRenderer(e){src_Renderer_Renderer.call(this,e),this._dirtyID=1,this._dirty=[],this._svg=null,this._root=null,this._defs=null}var Cp=Object(V.y)(SVGRenderer_SVGRenderer,src_Renderer_Renderer),Tp=src_Renderer_Renderer.prototype;function SVGRenderer_updateGradient(e,t,r){var n,i,a;if("radial"===t.gradient){var o=dom_domChild(e,r++,"pattern",Ep);o.setAttribute("id",nh+t.id),o.setAttribute("viewBox","0,0,1,1"),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("preserveAspectRatio","xMidYMid slice"),(o=dom_domChild(o,0,"rect",Ep)).setAttribute("width","1"),o.setAttribute("height","1"),o.setAttribute("fill","url("+src_SVGRenderer_href()+"#"+t.id+")"),(e=dom_domChild(e,r++,"radialGradient",Ep)).setAttribute("id",t.id),e.setAttribute("fx",t.x1),e.setAttribute("fy",t.y1),e.setAttribute("fr",t.r1),e.setAttribute("cx",t.x2),e.setAttribute("cy",t.y2),e.setAttribute("r",t.r2)}else(e=dom_domChild(e,r++,"linearGradient",Ep)).setAttribute("id",t.id),e.setAttribute("x1",t.x1),e.setAttribute("x2",t.x2),e.setAttribute("y1",t.y1),e.setAttribute("y2",t.y2);for(n=0,i=t.stops.length;n<i;++n)(a=dom_domChild(e,n,"stop",Ep)).setAttribute("offset",t.stops[n].offset),a.setAttribute("stop-color",t.stops[n].color);return dom_domClear(e,n),r}function SVGRenderer_updateClipping(e,t,r){var n;return(e=dom_domChild(e,r,"clipPath",Ep)).setAttribute("id",t.id),t.path?(n=dom_domChild(e,0,"path",Ep)).setAttribute("d",t.path):((n=dom_domChild(e,0,"rect",Ep)).setAttribute("x",0),n.setAttribute("y",0),n.setAttribute("width",t.width),n.setAttribute("height",t.height)),r+1}function SVGRenderer_dirtyParents(e,t){for(;e&&e.dirty!==t;e=e.mark.group){if(e.dirty=t,!e.mark||e.mark.dirty===t)return;e.mark.dirty=t}}function src_SVGRenderer_bind(e,t,r,n,i){var a,o=e._svg;if(!o&&(o=dom_domCreate(a=t.ownerDocument,n,Ep),e._svg=o,e.mark&&(o.__data__=e,o.__values__={fill:"default"},"g"===n))){var s=dom_domCreate(a,"path",Ep);s.setAttribute("class","background"),o.appendChild(s),s.__data__=e;var u=dom_domCreate(a,"g",Ep);o.appendChild(u),u.__data__=e}return(o.ownerSVGElement!==i||function SVGRenderer_hasSiblings(e){var t=e.mark||e.group;return t&&t.items.length>1}(e)&&o.previousSibling!==r)&&t.insertBefore(o,r?r.nextSibling:t.firstChild),o}Cp.initialize=function(e,t,r,n){return e&&(this._svg=dom_domChild(e,0,"svg",Ep),this._svg.setAttribute("class","marks"),dom_domClear(e,1),this._root=dom_domChild(this._svg,0,"g",Ep),dom_domClear(this._svg,1)),this._defs={gradient:{},clipping:{}},this.background(this._bgcolor),Tp.initialize.call(this,e,t,r,n)},Cp.background=function(e){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",e),Tp.background.apply(this,arguments)},Cp.resize=function(e,t,r,n){return Tp.resize.call(this,e,t,r,n),this._svg&&(this._svg.setAttribute("width",this._width*this._scale),this._svg.setAttribute("height",this._height*this._scale),this._svg.setAttribute("viewBox","0 0 "+this._width+" "+this._height),this._root.setAttribute("transform","translate("+this._origin+")")),this._dirty=[],this},Cp.canvas=function(){return this._svg},Cp.svg=function(){if(!this._svg)return null;var e={class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 "+this._width+" "+this._height};for(var t in wp)e[t]=wp[t];var r=this._bgcolor?tags_openTag("rect",{width:this._width,height:this._height,style:"fill: "+this._bgcolor+";"})+tags_closeTag("rect"):"";return tags_openTag("svg",e)+r+this._svg.innerHTML+tags_closeTag("svg")},Cp._render=function(e){return this._dirtyCheck()&&(this._dirtyAll&&this._resetDefs(),this.draw(this._root,e),dom_domClear(this._root,1)),this.updateDefs(),this._dirty=[],++this._dirtyID,this},Cp.updateDefs=function(){var e,t=this._svg,r=this._defs,n=r.el,i=0;for(e in r.gradient)n||(r.el=n=dom_domChild(t,0,"defs",Ep)),i=SVGRenderer_updateGradient(n,r.gradient[e],i);for(e in r.clipping)n||(r.el=n=dom_domChild(t,0,"defs",Ep)),i=SVGRenderer_updateClipping(n,r.clipping[e],i);n&&(0===i?(t.removeChild(n),r.el=null):dom_domClear(n,i))},Cp._resetDefs=function(){var e=this._defs;e.gradient={},e.clipping={}},Cp.dirty=function(e){e.dirty!==this._dirtyID&&(e.dirty=this._dirtyID,this._dirty.push(e))},Cp.isDirty=function(e){return this._dirtyAll||!e._svg||e.dirty===this._dirtyID},Cp._dirtyCheck=function(){this._dirtyAll=!0;var e=this._dirty;if(!e.length)return!0;var t,r,n,i,a,o,s,u=++this._dirtyID;for(a=0,o=e.length;a<o;++a)(r=(t=e[a]).mark).marktype!==n&&(n=r.marktype,i=op[n]),r.zdirty&&r.dirty!==u&&(this._dirtyAll=!1,SVGRenderer_dirtyParents(t,u),r.items.forEach((function(e){e.dirty=u}))),r.zdirty||(t.exit?(i.nested&&r.items.length?(s=r.items[0])._svg&&this._update(i,s._svg,s):t._svg&&(s=t._svg.parentNode)&&s.removeChild(t._svg),t._svg=null):(t=i.nested?r.items[0]:t)._update!==u&&(t._svg&&t._svg.ownerSVGElement?this._update(i,t._svg,t):(this._dirtyAll=!1,SVGRenderer_dirtyParents(t,u)),t._update=u));return!this._dirtyAll},Cp.draw=function(e,t,r){if(!this.isDirty(t))return t._svg;var n,i=this,a=this._svg,o=op[t.marktype],s=!1===t.interactive?"none":null,u="g"===o.tag,l=null,c=0;function process(e){var t=i.isDirty(e),r=src_SVGRenderer_bind(e,n,l,o.tag,a);t&&(i._update(o,r,e),u&&function src_SVGRenderer_recurse(e,t,r){t=t.lastChild;var n,i=0;util_visit_visit(r,(function(r){n=e.draw(t,r,n),++i})),dom_domClear(t,1+i)}(i,r,e)),l=r,++c}return(n=src_SVGRenderer_bind(t,e,r,"g",a)).setAttribute("class",dom_cssClass(t)),u||n.style.setProperty("pointer-events",s),t.clip?n.setAttribute("clip-path",Hh(i,t,t.group)):n.removeAttribute("clip-path"),o.nested?t.items.length&&process(t.items[0]):util_visit_visit(t,process),dom_domClear(n,c),n};var Op=null,Ap=null,Rp={group:function group(e,t,r){Ap=t.__values__,Op=t.childNodes[1],e.foreground(src_SVGRenderer_emit,r,this),Op=t.childNodes[0],e.background(src_SVGRenderer_emit,r,this);var n=!1===r.mark.interactive?"none":null;n!==Ap.events&&(Op.style.setProperty("pointer-events",n),Ap.events=n)},text:function text(e,t,r){var n;(n=text_textValue(r))!==Ap.text&&(t.textContent=n,Ap.text=n),SVGRenderer_setStyle(t,"font-family",text_fontFamily(r)),SVGRenderer_setStyle(t,"font-size",util_text_fontSize(r)+"px"),SVGRenderer_setStyle(t,"font-style",r.fontStyle),SVGRenderer_setStyle(t,"font-variant",r.fontVariant),SVGRenderer_setStyle(t,"font-weight",r.fontWeight)}};function SVGRenderer_setStyle(e,t,r){r!==Ap[t]&&(null==r?e.style.removeProperty(t):e.style.setProperty(t,r+""),Ap[t]=r)}function src_SVGRenderer_emit(e,t,r){t!==Ap[e]&&(null!=t?r?Op.setAttributeNS(r,e,t):Op.setAttribute(e,t):r?Op.removeAttributeNS(r,e):Op.removeAttribute(e),Ap[e]=t)}function src_SVGRenderer_href(){var e;return"undefined"===typeof window?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}function SVGStringRenderer_SVGStringRenderer(e){src_Renderer_Renderer.call(this,e),this._text={head:"",bg:"",root:"",foot:"",defs:"",body:""},this._defs={gradient:{},clipping:{}}}Cp._update=function(e,t,r){Op=t,Ap=t.__values__,e.attr(src_SVGRenderer_emit,r,this);var n=Rp[e.type];n&&n.call(this,e,t,r),this.style(Op,r)},Cp.style=function(e,t){var r,n,i,a,o;if(null!=t)for(r=0,n=Sp.length;r<n;++r)o=t[i=Sp[r]],"font"===i&&(o=text_fontFamily(t)),o!==Ap[i]&&(a=kp[i],null==o?"fill"===a?e.style.setProperty(a,"none"):e.style.removeProperty(a):(Gradient_isGradient(o)&&(o=Gradient_gradientRef(o,this._defs.gradient,src_SVGRenderer_href())),e.style.setProperty(a,o+"")),Ap[i]=o)};var Dp,Pp=Object(V.y)(SVGStringRenderer_SVGStringRenderer,src_Renderer_Renderer),jp=src_Renderer_Renderer.prototype;function src_SVGStringRenderer_emit(e,t,r,n){Dp[n||e]=t}function SVGStringRenderer_applyStyles(e,t,r,n){if(null==e)return"";var i,a,o,s,u,l="";for("bgrect"===r&&!1===t.interactive&&(l+="pointer-events: none; "),"text"===r&&(l+="font-family: "+text_fontFamily(e)+"; ",l+="font-size: "+util_text_fontSize(e)+"px; ",e.fontStyle&&(l+="font-style: "+e.fontStyle+"; "),e.fontVariant&&(l+="font-variant: "+e.fontVariant+"; "),e.fontWeight&&(l+="font-weight: "+e.fontWeight+"; ")),i=0,a=Sp.length;i<a;++i)o=Sp[i],s=kp[o],null==(u=e[o])?"fill"===s&&(l+="fill: none; "):"transparent"!==u||"fill"!==s&&"stroke"!==s?(Gradient_isGradient(u)&&(u=Gradient_gradientRef(u,n.gradient,"")),l+=s+": "+u+"; "):l+=s+": none; ";return l?'style="'+l.trim()+'"':null}Pp.resize=function(e,t,r,n){jp.resize.call(this,e,t,r,n);var i=this._origin,a=this._text,o={class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 "+this._width+" "+this._height};for(var s in wp)o[s]=wp[s];a.head=tags_openTag("svg",o);var u=this._bgcolor;return"transparent"!==u&&"none"!==u||(u=null),a.bg=u?tags_openTag("rect",{width:this._width,height:this._height,style:"fill: "+u+";"})+tags_closeTag("rect"):"",a.root=tags_openTag("g",{transform:"translate("+i+")"}),a.foot=tags_closeTag("g")+tags_closeTag("svg"),this},Pp.background=function(){var e=jp.background.apply(this,arguments);return arguments.length&&this._text.head&&this.resize(this._width,this._height,this._origin,this._scale),e},Pp.svg=function(){var e=this._text;return e.head+e.bg+e.defs+e.root+e.body+e.foot},Pp._render=function(e){return this._text.body=this.mark(e),this._text.defs=this.buildDefs(),this},Pp.buildDefs=function(){var e,t,r,n,i,a=this._defs,o="";for(t in a.gradient){for(i=(r=a.gradient[t]).stops,"radial"===r.gradient?(o+=tags_openTag(n="pattern",{id:nh+t,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),o+=tags_openTag("rect",{width:"1",height:"1",fill:"url(#"+t+")"})+tags_closeTag("rect"),o+=tags_closeTag(n),o+=tags_openTag(n="radialGradient",{id:t,fx:r.x1,fy:r.y1,fr:r.r1,cx:r.x2,cy:r.y2,r:r.r2})):o+=tags_openTag(n="linearGradient",{id:t,x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2}),e=0;e<i.length;++e)o+=tags_openTag("stop",{offset:i[e].offset,"stop-color":i[e].color})+tags_closeTag("stop");o+=tags_closeTag(n)}for(t in a.clipping)r=a.clipping[t],o+=tags_openTag("clipPath",{id:t}),r.path?o+=tags_openTag("path",{d:r.path})+tags_closeTag("path"):o+=tags_openTag("rect",{x:0,y:0,width:r.width,height:r.height})+tags_closeTag("rect"),o+=tags_closeTag("clipPath");return o.length>0?tags_openTag("defs")+o+tags_closeTag("defs"):""},Pp.attributes=function(e,t){return Dp={},e(src_SVGStringRenderer_emit,t,this),Dp},Pp.href=function(e){var t,r=this,n=e.href;if(n){if(t=r._hrefs&&r._hrefs[n])return t;r.sanitizeURL(n).then((function(e){e["xlink:href"]=e.href,e.href=null,(r._hrefs||(r._hrefs={}))[n]=e}))}return null},Pp.mark=function(e){var t,r=this,n=op[e.marktype],i=n.tag,a=this._defs,o="";function process(s){var u=r.href(s);u&&(o+=tags_openTag("a",u)),t="g"!==i?SVGStringRenderer_applyStyles(s,e,i,a):null,o+=tags_openTag(i,r.attributes(n.attr,s),t),"text"===i?o+=function SVGStringRenderer_escape_text(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}(text_textValue(s)):"g"===i&&(o+=tags_openTag("path",r.attributes(n.background,s),SVGStringRenderer_applyStyles(s,e,"bgrect",a))+tags_closeTag("path"),o+=tags_openTag("g",r.attributes(n.foreground,s))+r.markGroup(s)+tags_closeTag("g")),o+=tags_closeTag(i),u&&(o+=tags_closeTag("a"))}return"g"!==i&&!1===e.interactive&&(t='style="pointer-events: none;"'),o+=tags_openTag("g",{class:dom_cssClass(e),"clip-path":e.clip?Hh(r,e,e.group):null},t),n.nested?e.items&&e.items.length&&process(e.items[0]):util_visit_visit(e,process),o+tags_closeTag("g")},Pp.markGroup=function(e){var t=this,r="";return util_visit_visit(e,(function(e){r+=t.mark(e)})),r};var Mp={Canvas:"canvas",PNG:"png",SVG:"svg",None:"none"},Fp={};function modules_renderModule(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(Fp[e]=t,this):Fp[e]}function src_intersect_intersect(e,t,r){var n=[],i=(new Bounds_Bounds).union(t),a=e.marktype;return a?intersect_intersectMark(e,i,r,n):"group"===a?intersect_intersectGroup(e,i,r,n):Object(V.n)("Intersect scene must be mark node or group item.")}function intersect_intersectMark(e,t,r,n){if(function intersect_visitMark(e,t,r){return e.bounds&&t.intersects(e.bounds)&&("group"===e.marktype||!1!==e.interactive&&(!r||r(e)))}(e,t,r)){var i=e.items,a=e.marktype,o=i.length,s=0;if("group"===a)for(;s<o;++s)intersect_intersectGroup(i[s],t,r,n);else for(var u=op[a].isect;s<o;++s){var l=i[s];intersect_intersectItem(l,t,u)&&n.push(l)}}return n}function intersect_intersectGroup(e,t,r,n){r&&r(e.mark)&&intersect_intersectItem(e,t,op.group.isect)&&n.push(e);var i=e.items,a=i&&i.length;if(a){var o=e.x||0,s=e.y||0;t.translate(-o,-s);for(var u=0;u<a;++u)intersect_intersectMark(i[u],t,r,n);t.translate(o,s)}return n}function intersect_intersectItem(e,t,r){var n=e.bounds;return t.encloses(n)||t.intersects(n)&&r(e,t)}Fp.canvas=Fp.png={renderer:CanvasRenderer_CanvasRenderer,headless:CanvasRenderer_CanvasRenderer,handler:CanvasHandler_CanvasHandler},Fp.svg={renderer:SVGRenderer_SVGRenderer,headless:SVGStringRenderer_SVGStringRenderer,handler:SVGHandler_SVGHandler},Fp.none={};var Ip=new Bounds_Bounds,Lp=function(e){var t=e.clip;if(Object(V.D)(t))t(bound_boundContext_context(Ip.clear()));else{if(!t)return;Ip.set(0,0,e.group.width,e.group.height)}e.bounds.intersect(Ip)},Np=1e-9;function equal_sceneEqual(e,t,r){return e===t||("path"===r?equal_pathEqual(e,t):e instanceof Date&&t instanceof Date?+e===+t:Object(V.E)(e)&&Object(V.E)(t)?Math.abs(e-t)<=Np:e&&t&&(Object(V.F)(e)||Object(V.F)(t))?null!=e&&null!=t&&function equal_objectEqual(e,t){var r,n,i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(i.sort(),a.sort(),n=i.length-1;n>=0;n--)if(i[n]!=a[n])return!1;for(n=i.length-1;n>=0;n--)if(r=i[n],!equal_sceneEqual(e[r],t[r],r))return!1;return typeof e===typeof t}(e,t):e==t)}function equal_pathEqual(e,t){return equal_sceneEqual(lh(e),lh(t))}var Bp=function(e){var t=e._signals.cursor;t||(e._signals.cursor=t=e.add({user:"default",item:null})),e.on(e.events("view","mousemove"),t,(function(e,r){var n=t.value,i=n?Object(V.H)(n)?n:n.user:"default",a=r.item&&r.item.cursor||null;return n&&i===n.user&&a==n.item?n:{user:i,item:a}})),e.add(null,(function(e){var t=e.cursor,r=this.value;return Object(V.H)(t)||(r=t.item,t=t.user),function setCursor(e){"undefined"!==typeof document&&document.body&&(document.body.style.cursor=e)}(t&&"default"!==t?t:r||t),r}),{cursor:t})};function dataref(e,t){var r=e._runtime.data;return Object(V.v)(r,t)||Object(V.n)("Unrecognized data set: "+t),r[t]}function change(e,t){isChangeSet(t)||Object(V.n)("Second argument to changes must be a changeset.");var r=dataref(this,e);return r.modified=!0,this.pulse(r.input,t)}function render_size_width(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function render_size_height(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function render_size_offset(e){var t=e.padding(),r=e._origin;return[t.left+r[0],t.top+r[1]]}function resizeRenderer(e){var t=render_size_offset(e),r=render_size_width(e),n=render_size_height(e);e._renderer.background(e._background),e._renderer.resize(r,n,t),e._handler.origin(t),e._resizeListeners.forEach((function(t){try{t(r,n)}catch(i){e.error(i)}}))}function src_Bounds_Bounds(e){this.clear(),e&&this.union(e)}var Up=src_Bounds_Bounds.prototype;Up.clone=function(){return new src_Bounds_Bounds(this)},Up.clear=function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},Up.empty=function(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},Up.equals=function(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},Up.set=function(e,t,r,n){return r<e?(this.x2=e,this.x1=r):(this.x1=e,this.x2=r),n<t?(this.y2=t,this.y1=n):(this.y1=t,this.y2=n),this},Up.add=function(e,t){return e<this.x1&&(this.x1=e),t<this.y1&&(this.y1=t),e>this.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},Up.expand=function(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},Up.round=function(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},Up.translate=function(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},Up.rotate=function(e,t,r){var n=this.rotatedPoints(e,t,r);return this.clear().add(n[0],n[1]).add(n[2],n[3]).add(n[4],n[5]).add(n[6],n[7])},Up.rotatedPoints=function(e,t,r){var n=this.x1,i=this.y1,a=this.x2,o=this.y2,s=Math.cos(e),u=Math.sin(e),l=t-t*s+r*u,c=r-t*u-r*s;return[s*n-u*i+l,u*n+s*i+c,s*n-u*o+l,u*n+s*o+c,s*a-u*i+l,u*a+s*i+c,s*a-u*o+l,u*a+s*o+c]},Up.union=function(e){return e.x1<this.x1&&(this.x1=e.x1),e.y1<this.y1&&(this.y1=e.y1),e.x2>this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},Up.intersect=function(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2<this.x2&&(this.x2=e.x2),e.y2<this.y2&&(this.y2=e.y2),this},Up.encloses=function(e){return e&&this.x1<=e.x1&&this.x2>=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},Up.alignsWith=function(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},Up.intersects=function(e){return e&&!(this.x2<e.x1||this.x1>e.x2||this.y2<e.y1||this.y1>e.y2)},Up.contains=function(e,t){return!(e<this.x1||e>this.x2||t<this.y1||t>this.y2)},Up.width=function(){return this.x2-this.x1},Up.height=function(){return this.y2-this.y1};var zp=0,qp="p_";function src_Gradient_isGradient(e){return e&&e.gradient}function src_Gradient_gradientRef(e,t,r){var n=e.id,i=e.gradient,a="radial"===i?qp:"";return n||(n=e.id="gradient_"+zp++,"radial"===i?(e.x1=vega_scenegraph_src_Gradient_get(e.x1,.5),e.y1=vega_scenegraph_src_Gradient_get(e.y1,.5),e.r1=vega_scenegraph_src_Gradient_get(e.r1,0),e.x2=vega_scenegraph_src_Gradient_get(e.x2,.5),e.y2=vega_scenegraph_src_Gradient_get(e.y2,.5),e.r2=vega_scenegraph_src_Gradient_get(e.r2,.5),a=qp):(e.x1=vega_scenegraph_src_Gradient_get(e.x1,0),e.y1=vega_scenegraph_src_Gradient_get(e.y1,0),e.x2=vega_scenegraph_src_Gradient_get(e.x2,1),e.y2=vega_scenegraph_src_Gradient_get(e.y2,0))),t[n]=e,"url("+(r||"")+"#"+a+n+")"}function vega_scenegraph_src_Gradient_get(e,t){return null!=e?e:t}function src_Item_Item(e){this.mark=e,this.bounds=this.bounds||new src_Bounds_Bounds}function src_GroupItem_GroupItem(e){src_Item_Item.call(this,e),this.items=this.items||[]}Object(V.y)(src_GroupItem_GroupItem,src_Item_Item);var Wp=/^([A-Za-z]+:)?\/\//,Gp=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,Hp=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,Vp="file://";function vega_view_node_modules_vega_loader_src_loader_load(e,t){return node_modules_vega_view_node_modules_vega_loader_src_loader_load.apply(this,arguments)}function node_modules_vega_view_node_modules_vega_loader_src_loader_load(){return(node_modules_vega_view_node_modules_vega_loader_src_loader_load=Object(Y.a)(A.a.mark((function _callee2(e,t){var r,n;return A.a.wrap((function _callee2$(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,this.sanitize(e,t);case 2:return r=i.sent,n=r.href,i.abrupt("return",r.localFile?this.file(n):this.http(n,t));case 5:case"end":return i.stop()}}),_callee2,this)})))).apply(this,arguments)}function vega_view_node_modules_vega_loader_src_loader_sanitize(e,t){return node_modules_vega_view_node_modules_vega_loader_src_loader_sanitize.apply(this,arguments)}function node_modules_vega_view_node_modules_vega_loader_src_loader_sanitize(){return(node_modules_vega_view_node_modules_vega_loader_src_loader_sanitize=Object(Y.a)(A.a.mark((function _callee3(e,t){var r,n,i,a,o,s,u;return A.a.wrap((function _callee3$(l){for(;;)switch(l.prev=l.next){case 0:return t=Object(V.o)({},this.options,t),r=this.fileAccess,n={href:null},s=Gp.test(e.replace(Hp,"")),null!=e&&"string"===typeof e&&s||Object(V.n)("Sanitize failure, invalid URI: "+Object(V.X)(e)),u=Wp.test(e),(o=t.baseURL)&&!u&&(e.startsWith("/")||"/"===o[o.length-1]||(e="/"+e),e=o+e),a=(i=e.startsWith(Vp))||"file"===t.mode||"http"!==t.mode&&!u&&r,i?e=e.slice(Vp.length):e.startsWith("//")&&("file"===t.defaultProtocol?(e=e.slice(2),a=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(n,"localFile",{value:!!a}),n.href=e,t.target&&(n.target=t.target+""),t.rel&&(n.rel=t.rel+""),l.abrupt("return",n);case 13:case"end":return l.stop()}}),_callee3,this)})))).apply(this,arguments)}function vega_loader_src_loader_fileLoader(e){return e?function(t){return new Promise((function(r,n){e.readFile(t,(function(e,t){e?n(e):r(t)}))}))}:vega_view_node_modules_vega_loader_src_loader_fileReject}function vega_view_node_modules_vega_loader_src_loader_fileReject(){return node_modules_vega_view_node_modules_vega_loader_src_loader_fileReject.apply(this,arguments)}function node_modules_vega_view_node_modules_vega_loader_src_loader_fileReject(){return(node_modules_vega_view_node_modules_vega_loader_src_loader_fileReject=Object(Y.a)(A.a.mark((function _callee4(){return A.a.wrap((function _callee4$(e){for(;;)switch(e.prev=e.next){case 0:Object(V.n)("No file system access.");case 1:case"end":return e.stop()}}),_callee4)})))).apply(this,arguments)}function vega_loader_src_loader_httpLoader(e){return e?function(){var t=Object(Y.a)(A.a.mark((function _callee(t,r){var n,i,a;return A.a.wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:return n=Object(V.o)({},this.options.http,r),i=r&&r.response,o.next=4,e(t,n);case 4:return a=o.sent,o.abrupt("return",a.ok?Object(V.D)(a[i])?a[i]():a.text():Object(V.n)(a.status+""+a.statusText));case 6:case"end":return o.stop()}}),_callee,this)})));return function(e,r){return t.apply(this,arguments)}}():vega_view_node_modules_vega_loader_src_loader_httpReject}function vega_view_node_modules_vega_loader_src_loader_httpReject(){return node_modules_vega_view_node_modules_vega_loader_src_loader_httpReject.apply(this,arguments)}function node_modules_vega_view_node_modules_vega_loader_src_loader_httpReject(){return(node_modules_vega_view_node_modules_vega_loader_src_loader_httpReject=Object(Y.a)(A.a.mark((function _callee5(){return A.a.wrap((function _callee5$(e){for(;;)switch(e.prev=e.next){case 0:Object(V.n)("No HTTP fetch method available.");case 1:case"end":return e.stop()}}),_callee5)})))).apply(this,arguments)}V.Y,V.ab,V.ab,V.Z,V.cb,V.x;function src_formats_dsv_delimitedFormat(e){var t=function parse(t,r){var n={delimiter:e};return vega_loader_src_formats_dsv_dsv(t,r?Object(V.o)(r,n):n)};return t.responseType="text",t}function vega_loader_src_formats_dsv_dsv(e,t){return t.header&&(e=t.header.map(V.X).join(t.delimiter)+"\n"+e),me(t.delimiter).parse(e+"")}vega_loader_src_formats_dsv_dsv.responseType="text";var Yp=r(90),$p={interior:function interior(e,t){return e!==t},exterior:function exterior(e,t){return e===t}};function src_formats_topojson_topojson(e,t){var r,n,i,a;return e=Object(Yp.a)(e,t),t&&t.feature?(r=ke,i=t.feature):t&&t.mesh?(r=Ee,i=t.mesh,a=$p[t.filter]):Object(V.n)("Missing TopoJSON feature or mesh parameter."),(n=(n=e.objects[i])?r(e,n,a):Object(V.n)("Invalid TopoJSON object: "+i))&&n.features||[n]}src_formats_topojson_topojson.responseType="json";src_formats_dsv_delimitedFormat(","),src_formats_dsv_delimitedFormat("\t"),Yp.a;var Xp=function(e,t){return function(r){return{options:r||{},sanitize:vega_view_node_modules_vega_loader_src_loader_sanitize,load:vega_view_node_modules_vega_loader_src_loader_load,fileAccess:!!t,file:vega_loader_src_loader_fileLoader(t),http:vega_loader_src_loader_httpLoader(e)}}}("undefined"!==typeof fetch&&fetch,null);function src_ResourceLoader_ResourceLoader(e){this._pending=0,this._loader=e||Xp()}var Kp=src_ResourceLoader_ResourceLoader.prototype;function src_ResourceLoader_increment(e){e._pending+=1}function src_ResourceLoader_decrement(e){e._pending-=1}Kp.pending=function(){return this._pending},Kp.sanitizeURL=function(e){var t=this;return src_ResourceLoader_increment(t),t._loader.sanitize(e,{context:"href"}).then((function(e){return src_ResourceLoader_decrement(t),e})).catch((function(){return src_ResourceLoader_decrement(t),null}))},Kp.loadImage=function(e){var t=this,r=domImage();return src_ResourceLoader_increment(t),t._loader.sanitize(e,{context:"image"}).then((function(e){var n=e.href;if(!n||!r)throw{url:n};var i=new r;return i.onload=function(){src_ResourceLoader_decrement(t),i.loaded=!0},i.onerror=function(){src_ResourceLoader_decrement(t),i.loaded=!1},i.src=n,i})).catch((function(e){return src_ResourceLoader_decrement(t),{loaded:!1,width:0,height:0,src:e&&e.url||""}}))},Kp.ready=function(){var e=this;return new Promise((function(t){!function poll(r){e.pending()?setTimeout((function(){poll(!0)}),10):t(r)}(!1)}))};var Jp={basis:{curve:Bn},"basis-closed":{curve:Un},"basis-open":{curve:zn},bundle:{curve:qn,tension:"beta",value:.85},cardinal:{curve:Wn,tension:"tension",value:0},"cardinal-open":{curve:Hn,tension:"tension",value:0},"cardinal-closed":{curve:Gn,tension:"tension",value:0},"catmull-rom":{curve:Vn,tension:"alpha",value:.5},"catmull-rom-closed":{curve:Yn,tension:"alpha",value:.5},"catmull-rom-open":{curve:$n,tension:"alpha",value:.5},linear:{curve:Pn},"linear-closed":{curve:Xn},monotone:{horizontal:monotoneY,vertical:monotoneX},natural:{curve:Kn},step:{curve:Jn},"step-after":{curve:stepAfter},"step-before":{curve:stepBefore}};function path_curves_curves(e,t,r){var n=Object(V.v)(Jp,e)&&Jp[e],i=null;return n&&(i=n.curve||n[t||"vertical"],n.tension&&null!=r&&(i=i[n.tension](r))),i}var Qp={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},Zp=[/([MLHVCSQTAZmlhvcsqtaz])/g,/###/,/(\d)([-+])/g,/\s|,|###/],eg=function(e){var t,r,n,i,a,o,s,u,l,c,f,d=[];for(u=0,c=(t=e.slice().replace(Zp[0],"###$1").split(Zp[1]).slice(1)).length;u<c;++u){for(n=(r=t[u]).slice(1).trim().replace(Zp[2],"$1###$2").split(Zp[3]),i=[o=r.charAt(0)],l=0,f=n.length;l<f;++l)(a=+n[l])===a&&i.push(a);if(s=Qp[o.toLowerCase()],i.length-1>s)for(l=1,f=i.length;l<f;l+=s)d.push([o].concat(i.slice(l,l+s)));else d.push(i)}return d},tg=Math.PI/180,rg=Math.PI/2,ng=2*Math.PI,ig=Math.sqrt(3)/2,ag={},og={},sg=[].join;function path_arc_bezier(e){var t=sg.call(e);if(og[t])return og[t];var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],c=l*o,f=-u*s,d=u*o,h=l*s,p=Math.cos(i),g=Math.sin(i),m=Math.cos(a),v=Math.sin(a),y=.5*(a-i),_=Math.sin(.5*y),b=8/3*_*_/Math.sin(y),x=r+p-b*g,w=n+g+b*p,k=r+m,S=n+v,E=k+b*v,C=S-b*m;return og[t]=[c*x+f*w,d*x+h*w,c*E+f*C,d*E+h*C,c*k+f*S,d*k+h*S]}var ug=["l",0,0,0,0,0,0,0];function src_path_render_scale(e,t){var r=ug[0]=e[0];if("a"===r||"A"===r)ug[1]=t*e[1],ug[2]=t*e[2],ug[3]=e[3],ug[4]=e[4],ug[5]=e[5],ug[6]=t*e[6],ug[7]=t*e[7];else for(var n=1,i=e.length;n<i;++n)ug[n]=t*e[n];return ug}var lg=function(e,t,r,n,i){var a,o,s,u,l,c=null,f=0,d=0,h=0,p=0;null==r&&(r=0),null==n&&(n=0),null==i&&(i=1),e.beginPath&&e.beginPath();for(var g=0,m=t.length;g<m;++g){switch(a=t[g],1!==i&&(a=src_path_render_scale(a,i)),a[0]){case"l":f+=a[1],d+=a[2],e.lineTo(f+r,d+n);break;case"L":f=a[1],d=a[2],e.lineTo(f+r,d+n);break;case"h":f+=a[1],e.lineTo(f+r,d+n);break;case"H":f=a[1],e.lineTo(f+r,d+n);break;case"v":d+=a[1],e.lineTo(f+r,d+n);break;case"V":d=a[1],e.lineTo(f+r,d+n);break;case"m":f+=a[1],d+=a[2],e.moveTo(f+r,d+n);break;case"M":f=a[1],d=a[2],e.moveTo(f+r,d+n);break;case"c":o=f+a[5],s=d+a[6],h=f+a[3],p=d+a[4],e.bezierCurveTo(f+a[1]+r,d+a[2]+n,h+r,p+n,o+r,s+n),f=o,d=s;break;case"C":f=a[5],d=a[6],h=a[3],p=a[4],e.bezierCurveTo(a[1]+r,a[2]+n,h+r,p+n,f+r,d+n);break;case"s":o=f+a[3],s=d+a[4],h=2*f-h,p=2*d-p,e.bezierCurveTo(h+r,p+n,f+a[1]+r,d+a[2]+n,o+r,s+n),h=f+a[1],p=d+a[2],f=o,d=s;break;case"S":o=a[3],s=a[4],h=2*f-h,p=2*d-p,e.bezierCurveTo(h+r,p+n,a[1]+r,a[2]+n,o+r,s+n),f=o,d=s,h=a[1],p=a[2];break;case"q":o=f+a[3],s=d+a[4],h=f+a[1],p=d+a[2],e.quadraticCurveTo(h+r,p+n,o+r,s+n),f=o,d=s;break;case"Q":o=a[3],s=a[4],e.quadraticCurveTo(a[1]+r,a[2]+n,o+r,s+n),f=o,d=s,h=a[1],p=a[2];break;case"t":o=f+a[1],s=d+a[2],null===c[0].match(/[QqTt]/)?(h=f,p=d):"t"===c[0]?(h=2*f-u,p=2*d-l):"q"===c[0]&&(h=2*f-h,p=2*d-p),u=h,l=p,e.quadraticCurveTo(h+r,p+n,o+r,s+n),d=s,h=(f=o)+a[1],p=d+a[2];break;case"T":o=a[1],s=a[2],h=2*f-h,p=2*d-p,e.quadraticCurveTo(h+r,p+n,o+r,s+n),f=o,d=s;break;case"a":path_render_drawArc(e,f+r,d+n,[a[1],a[2],a[3],a[4],a[5],a[6]+f+r,a[7]+d+n]),f+=a[6],d+=a[7];break;case"A":path_render_drawArc(e,f+r,d+n,[a[1],a[2],a[3],a[4],a[5],a[6]+r,a[7]+n]),f=a[6],d=a[7];break;case"z":case"Z":e.closePath()}c=a}};function path_render_drawArc(e,t,r,n){for(var i=function src_path_arc_segments(e,t,r,n,i,a,o,s,u){var l=sg.call(arguments);if(ag[l])return ag[l];var c=o*tg,f=Math.sin(c),d=Math.cos(c),h=d*(s-e)*.5+f*(u-t)*.5,p=d*(u-t)*.5-f*(s-e)*.5,g=h*h/((r=Math.abs(r))*r)+p*p/((n=Math.abs(n))*n);g>1&&(r*=g=Math.sqrt(g),n*=g);var m=d/r,v=f/r,y=-f/n,_=d/n,b=m*s+v*u,x=y*s+_*u,w=m*e+v*t,k=y*e+_*t,S=1/((w-b)*(w-b)+(k-x)*(k-x))-.25;S<0&&(S=0);var E=Math.sqrt(S);a==i&&(E=-E);var C=.5*(b+w)-E*(k-x),T=.5*(x+k)+E*(w-b),O=Math.atan2(x-T,b-C),A=Math.atan2(k-T,w-C)-O;A<0&&1===a?A+=ng:A>0&&0===a&&(A-=ng);for(var R=Math.ceil(Math.abs(A/(rg+.001))),D=[],P=0;P<R;++P){var j=O+P*A/R,M=O+(P+1)*A/R;D[P]=[C,T,j,M,r,n,f,d]}return ag[l]=D}(n[5],n[6],n[0],n[1],n[3],n[4],n[2],t,r),a=0;a<i.length;++a){var o=path_arc_bezier(i[a]);e.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5])}}var cg={circle:{draw:function draw(e,t){var r=Math.sqrt(t)/2;e.moveTo(r,0),e.arc(0,0,r,0,ng)}},cross:{draw:function draw(e,t){var r=Math.sqrt(t)/2,n=r/2.5;e.moveTo(-r,-n),e.lineTo(-r,n),e.lineTo(-n,n),e.lineTo(-n,r),e.lineTo(n,r),e.lineTo(n,n),e.lineTo(r,n),e.lineTo(r,-n),e.lineTo(n,-n),e.lineTo(n,-r),e.lineTo(-n,-r),e.lineTo(-n,-n),e.closePath()}},diamond:{draw:function draw(e,t){var r=Math.sqrt(t)/2;e.moveTo(-r,0),e.lineTo(0,-r),e.lineTo(r,0),e.lineTo(0,r),e.closePath()}},square:{draw:function draw(e,t){var r=Math.sqrt(t),n=-r/2;e.rect(n,n,r,r)}},arrow:{draw:function draw(e,t){var r=Math.sqrt(t)/2,n=r/7,i=r/2.5,a=r/8;e.moveTo(-n,r),e.lineTo(n,r),e.lineTo(n,-a),e.lineTo(i,-a),e.lineTo(0,-r),e.lineTo(-i,-a),e.lineTo(-n,-a),e.closePath()}},wedge:{draw:function draw(e,t){var r=Math.sqrt(t)/2,n=ig*r,i=n-.5773502691896257*r,a=r/4;e.moveTo(0,-n-i),e.lineTo(-a,n-i),e.lineTo(a,n-i),e.closePath()}},triangle:{draw:function draw(e,t){var r=Math.sqrt(t)/2,n=ig*r,i=n-.5773502691896257*r;e.moveTo(0,-n-i),e.lineTo(-r,n-i),e.lineTo(r,n-i),e.closePath()}},"triangle-up":{draw:function draw(e,t){var r=Math.sqrt(t)/2,n=ig*r;e.moveTo(0,-n),e.lineTo(-r,n),e.lineTo(r,n),e.closePath()}},"triangle-down":{draw:function draw(e,t){var r=Math.sqrt(t)/2,n=ig*r;e.moveTo(0,n),e.lineTo(-r,-n),e.lineTo(r,-n),e.closePath()}},"triangle-right":{draw:function draw(e,t){var r=Math.sqrt(t)/2,n=ig*r;e.moveTo(n,0),e.lineTo(-n,-r),e.lineTo(-n,r),e.closePath()}},"triangle-left":{draw:function draw(e,t){var r=Math.sqrt(t)/2,n=ig*r;e.moveTo(-n,0),e.lineTo(n,-r),e.lineTo(n,r),e.closePath()}},stroke:{draw:function draw(e,t){var r=Math.sqrt(t)/2;e.moveTo(-r,0),e.lineTo(r,0)}}};function src_path_symbols_symbols(e){return Object(V.v)(cg,e)?cg[e]:function path_symbols_customSymbol(e){if(!Object(V.v)(fg,e)){var t=eg(e);fg[e]={draw:function draw(e,r){lg(e,t,0,0,Math.sqrt(r)/2)}}}return fg[e]}(e)}var fg={};function path_rectangle_rectangleX(e){return e.x}function path_rectangle_rectangleY(e){return e.y}function path_rectangle_rectangleWidth(e){return e.width}function path_rectangle_rectangleHeight(e){return e.height}function src_path_rectangle_constant(e){return function(){return e}}function src_path_shapes_x(e){return e.x||0}function src_path_shapes_y(e){return e.y||0}function src_path_shapes_cr(e){return e.cornerRadius||0}function src_path_shapes_def(e){return!(!1===e.defined)}var dg=Dn().startAngle((function src_path_shapes_sa(e){return e.startAngle||0})).endAngle((function src_path_shapes_ea(e){return e.endAngle||0})).padAngle((function src_path_shapes_pa(e){return e.padAngle||0})).innerRadius((function path_shapes_ir(e){return e.innerRadius||0})).outerRadius((function src_path_shapes_or(e){return e.outerRadius||0})).cornerRadius(src_path_shapes_cr),hg=Mn().x(src_path_shapes_x).y1(src_path_shapes_y).y0((function path_shapes_yh(e){return(e.y||0)+(e.height||0)})).defined(src_path_shapes_def),pg=Mn().y(src_path_shapes_y).x1(src_path_shapes_x).x0((function path_shapes_xw(e){return(e.x||0)+(e.width||0)})).defined(src_path_shapes_def),gg=jn().x(src_path_shapes_x).y(src_path_shapes_y).defined(src_path_shapes_def),mg=function(){var e=path_rectangle_rectangleX,t=path_rectangle_rectangleY,r=path_rectangle_rectangleWidth,n=path_rectangle_rectangleHeight,i=src_path_rectangle_constant(0),a=null;function rectangle(o,s,u){var l,c=null!=s?s:+e.call(this,o),f=null!=u?u:+t.call(this,o),d=+r.call(this,o),h=+n.call(this,o),p=+i.call(this,o);if(a||(a=l=yn()),p<=0)a.rect(c,f,d,h);else{var g=c+d,m=f+h;a.moveTo(c+p,f),a.lineTo(g-p,f),a.quadraticCurveTo(g,f,g,f+p),a.lineTo(g,m-p),a.quadraticCurveTo(g,m,g-p,m),a.lineTo(c+p,m),a.quadraticCurveTo(c,m,c,m-p),a.lineTo(c,f+p),a.quadraticCurveTo(c,f,c+p,f),a.closePath()}if(l)return a=null,l+""||null}return rectangle.x=function(t){return arguments.length?(e="function"===typeof t?t:src_path_rectangle_constant(+t),rectangle):e},rectangle.y=function(e){return arguments.length?(t="function"===typeof e?e:src_path_rectangle_constant(+e),rectangle):t},rectangle.width=function(e){return arguments.length?(r="function"===typeof e?e:src_path_rectangle_constant(+e),rectangle):r},rectangle.height=function(e){return arguments.length?(n="function"===typeof e?e:src_path_rectangle_constant(+e),rectangle):n},rectangle.cornerRadius=function(e){return arguments.length?(i="function"===typeof e?e:src_path_rectangle_constant(+e),rectangle):i},rectangle.context=function(e){return arguments.length?(a=null==e?null:e,rectangle):a},rectangle}().x(src_path_shapes_x).y(src_path_shapes_y).width((function src_path_shapes_w(e){return e.width||0})).height((function src_path_shapes_h(e){return e.height||0})).cornerRadius(src_path_shapes_cr),vg=Ln().type((function src_path_shapes_type(e){return src_path_symbols_symbols(e.shape||"circle")})).size((function src_path_shapes_size(e){return null==e.size?64:e.size})),yg=function(){var e,t,r,n,i,a,o,s,u=null;function point(e,t,r){var n=r/2;if(i){var l=o-t,c=e-a;if(l||c){var f=Math.sqrt(l*l+c*c),d=(l/=f)*s,h=(c/=f)*s,p=Math.atan2(c,l);u.moveTo(a-d,o-h),u.lineTo(e-l*n,t-c*n),u.arc(e,t,n,p-Math.PI,p),u.lineTo(a+d,o+h),u.arc(a,o,s,p,p+Math.PI)}else u.arc(e,t,n,0,ng);u.closePath()}else i=1;a=e,o=t,s=n}function trail(a){var o,s,l,c=a.length,f=!1;for(null==u&&(u=l=yn()),o=0;o<=c;++o)!(o<c&&n(s=a[o],o,a))===f&&(f=!f)&&(i=0),f&&point(+e(s,o,a),+t(s,o,a),+r(s,o,a));if(l)return u=null,l+""||null}return trail.x=function(t){return arguments.length?(e=t,trail):e},trail.y=function(e){return arguments.length?(t=e,trail):t},trail.size=function(e){return arguments.length?(r=e,trail):r},trail.defined=function(e){return arguments.length?(n=e,trail):n},trail.context=function(e){return arguments.length?(u=null==e?null:e,trail):u},trail}().x(src_path_shapes_x).y(src_path_shapes_y).defined(src_path_shapes_def).size((function path_shapes_ts(e){return e.size||1}));function src_path_shapes_rectangle(e,t,r,n){return mg.context(e)(t,r,n)}var _g,bg=function(e,t){return t.stroke&&0!==t.opacity&&0!==t.strokeOpacity&&e.expand(null!=t.strokeWidth?+t.strokeWidth:1),e},xg=ng-1e-8;function src_bound_boundContext_context(e){return _g=e,src_bound_boundContext_context}function src_bound_boundContext_noop(){}function src_bound_boundContext_add(e,t){_g.add(e,t)}src_bound_boundContext_context.beginPath=src_bound_boundContext_noop,src_bound_boundContext_context.closePath=src_bound_boundContext_noop,src_bound_boundContext_context.moveTo=src_bound_boundContext_add,src_bound_boundContext_context.lineTo=src_bound_boundContext_add,src_bound_boundContext_context.rect=function(e,t,r,n){src_bound_boundContext_add(e,t),src_bound_boundContext_add(e+r,t+n)},src_bound_boundContext_context.quadraticCurveTo=function(e,t,r,n){src_bound_boundContext_add(e,t),src_bound_boundContext_add(r,n)},src_bound_boundContext_context.bezierCurveTo=function(e,t,r,n,i,a){src_bound_boundContext_add(e,t),src_bound_boundContext_add(r,n),src_bound_boundContext_add(i,a)},src_bound_boundContext_context.arc=function(e,t,r,n,i,a){if(Math.abs(i-n)>xg)return src_bound_boundContext_add(e-r,t-r),void src_bound_boundContext_add(e+r,t+r);var o,s,u,l,c=1/0,f=-1/0,d=1/0,h=-1/0;function update(e){u=r*Math.cos(e),l=r*Math.sin(e),u<c&&(c=u),u>f&&(f=u),l<d&&(d=l),l>h&&(h=l)}if(update(n),update(i),i!==n)if((n%=ng)<0&&(n+=ng),(i%=ng)<0&&(i+=ng),i<n&&(a=!a,o=n,n=i,i=o),a)for(i-=ng,o=n-n%rg,s=0;s<4&&o>i;++s,o-=rg)update(o);else for(o=n-n%rg+rg,s=0;s<4&&o<i;++s,o+=rg)update(o);src_bound_boundContext_add(e+c,t+d),src_bound_boundContext_add(e+f,t+h)};var wg=(wg=domCanvas(1,1))?wg.getContext("2d"):null,kg=new src_Bounds_Bounds;function util_intersect_intersectPath(e){return function(t,r){if(!wg)return!0;e(wg,t),kg.clear().union(t.bounds).intersect(r).round();for(var n=kg.x1,i=kg.y1,a=kg.x2,o=kg.y2,s=i;s<=o;++s)for(var u=n;u<=a;++u)if(wg.isPointInPath(u,s))return!0;return!1}}function util_intersect_intersectPoint(e,t){return t.contains(e.x||0,e.y||0)}function util_intersect_intersectRect(e,t){var r=e.x||0,n=e.y||0,i=e.width||0,a=e.height||0;return t.intersects(kg.set(r,n,r+i,n+a))}function util_intersect_intersectBoxLine(e,t,r,n,i){var a,o,s,u,l=e.x1,c=e.y1,f=e.x2,d=e.y2,h=n-t,p=i-r,g=0,m=1;for(u=0;u<4;++u){if(0===u&&(a=-h,o=-(l-t)),1===u&&(a=h,o=f-t),2===u&&(a=-p,o=-(c-r)),3===u&&(a=p,o=d-r),Math.abs(a)<1e-10&&o<0)return!1;if(s=o/a,a<0){if(s>m)return!1;s>g&&(g=s)}else if(a>0){if(s<g)return!1;s<m&&(m=s)}}return!0}var Sg=function(e,t,r){return src_Gradient_isGradient(r)?function(e,t,r){for(var n=r.width(),i=r.height(),a=t.stops,o=a.length,s="radial"===t.gradient?e.createRadialGradient(r.x1+(t.x1||.5)*n,r.y1+(t.y1||.5)*i,Math.max(n,i)*(t.r1||0),r.x1+(t.x2||.5)*n,r.y1+(t.y2||.5)*i,Math.max(n,i)*(t.r2||.5)):e.createLinearGradient(r.x1+(t.x1||0)*n,r.y1+(t.y1||0)*i,r.x1+(t.x2||1)*n,r.y1+(t.y2||0)*i),u=0;u<o;++u)s.addColorStop(a[u].offset,a[u].color);return s}(e,r,t.bounds):r},Eg=function(e,t,r){return(r*=null==t.fillOpacity?1:t.fillOpacity)>0&&(e.globalAlpha=r,e.fillStyle=Sg(e,t,t.fill),!0)},Cg=[],Tg=function(e,t,r){var n=null!=(n=t.strokeWidth)?n:1;return!(n<=0)&&((r*=null==t.strokeOpacity?1:t.strokeOpacity)>0&&(e.globalAlpha=r,e.strokeStyle=Sg(e,t,t.stroke),e.lineWidth=n,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||Cg),e.lineDashOffset=t.strokeDashOffset||0),!0))};function src_util_visit_compare(e,t){return e.zindex-t.zindex||e.index-t.index}function util_visit_zorder(e){if(!e.zdirty)return e.zitems;var t,r,n,i=e.items,a=[];for(r=0,n=i.length;r<n;++r)(t=i[r]).index=r,t.zindex&&a.push(t);return e.zdirty=!1,e.zitems=a.sort(src_util_visit_compare)}function src_util_visit_visit(e,t){var r,n,i=e.items;if(i&&i.length){var a=util_visit_zorder(e);if(a&&a.length){for(r=0,n=i.length;r<n;++r)i[r].zindex||t(i[r]);i=a}for(r=0,n=i.length;r<n;++r)t(i[r])}}function util_visit_pickVisit(e,t){var r,n,i=e.items;if(!i||!i.length)return null;var a=util_visit_zorder(e);for(a&&a.length&&(i=a),n=i.length;--n>=0;)if(r=t(i[n]))return r;if(i===a)for(n=(i=e.items).length;--n>=0;)if(!i[n].zindex&&(r=t(i[n])))return r;return null}function canvas_draw_drawAll(e){return function(t,r,n){src_util_visit_visit(r,(function(r){n&&!n.intersects(r.bounds)||canvas_draw_drawPath(e,t,r,r)}))}}function canvas_draw_drawPath(e,t,r,n){var i=null==r.opacity?1:r.opacity;0!==i&&(e(t,n)||(r.fill&&Eg(t,r,i)&&t.fill(),r.stroke&&Tg(t,r,i)&&t.stroke()))}function util_canvas_pick_pick(e){return e=e||V.eb,function(t,r,n,i,a,o){return n*=t.pixelRatio,i*=t.pixelRatio,util_visit_pickVisit(r,(function(r){var s=r.bounds;if((!s||s.contains(a,o))&&s)return e(t,r,n,i,a,o)?r:void 0}))}}function canvas_pick_hitPath(e,t){return function(r,n,i,a){var o,s,u=Array.isArray(n)?n[0]:n,l=null==t?u.fill:t,c=u.stroke&&r.isPointInStroke;return c&&(o=u.strokeWidth,s=u.strokeCap,r.lineWidth=null!=o?o:1,r.lineCap=null!=s?s:"butt"),!e(r,n)&&(l&&r.isPointInPath(i,a)||c&&r.isPointInStroke(i,a))}}function canvas_pick_pickPath(e){return util_canvas_pick_pick(canvas_pick_hitPath(e))}function util_svg_transform_translate(e,t){return"translate("+e+","+t+")"}function util_svg_transform_rotate(e){return"rotate("+e+")"}function svg_transform_translateItem(e){return util_svg_transform_translate(e.x||0,e.y||0)}var Og=function(e,t,r){function draw(e,r){var n=r.x||0,i=r.y||0,a=r.angle||0;e.translate(n,i),a&&e.rotate(a*=tg),e.beginPath(),t(e,r),a&&e.rotate(-a),e.translate(-n,-i)}return{type:e,tag:"path",nested:!1,attr:function attr(e,r){e("transform",function svg_transform_transformItem(e){return util_svg_transform_translate(e.x||0,e.y||0)+(e.angle?" "+util_svg_transform_rotate(e.angle):"")}(r)),e("d",t(null,r))},bound:function bound(e,r){var n=r.x||0,i=r.y||0;return t(src_bound_boundContext_context(e),r),bg(e,r).translate(n,i),r.angle&&e.rotate(r.angle*tg,n,i),e},draw:canvas_draw_drawAll(draw),pick:canvas_pick_pickPath(draw),isect:r||util_intersect_intersectPath(draw)}},Ag=Og("arc",(function src_path_shapes_arc(e,t){return dg.context(e)(t)}));var Rg=function(e,t,r){function draw(e,r){e.beginPath(),t(e,r)}var n,i=canvas_pick_hitPath(draw);return{type:e,tag:"path",nested:!0,attr:function attr(e,r){var n=r.mark.items;n.length&&e("d",t(null,n))},bound:function bound(e,r){var n=r.items;return 0===n.length?e:(t(src_bound_boundContext_context(e),n),bg(e,n[0]))},draw:(n=draw,function(e,t,r){!t.items.length||r&&!r.intersects(t.bounds)||canvas_draw_drawPath(n,e,t.items[0],t.items)}),pick:function pick(e,t,r,n,a,o){var s=t.items,u=t.bounds;return!s||!s.length||u&&!u.contains(a,o)?null:(r*=e.pixelRatio,n*=e.pixelRatio,i(e,s,r,n)?s[0]:null)},isect:util_intersect_intersectPoint,tip:r}},Dg=Rg("area",(function src_path_shapes_area(e,t){var r=t[0],n=r.interpolate||"linear";return("horizontal"===r.orient?pg:hg).curve(path_curves_curves(n,r.orient,r.tension)).context(e)(t)}),(function util_pickPath_pickArea(e,t){for(var r,n,i="horizontal"===e[0].orient?t[1]:t[0],a="horizontal"===e[0].orient?"y":"x",o=e.length,s=1/0;--o>=0;)!1!==e[o].defined&&(n=Math.abs(e[o][a]-i))<s&&(s=n,r=e[o]);return r})),Pg=1;var jg=function(e,t,r){var n=t.clip,i=e._defs,a=t.clip_id||(t.clip_id="clip"+Pg++),o=i.clipping[a]||(i.clipping[a]={id:a});return Object(V.D)(n)?o.path=n(null):(o.width=r.width||0,o.height=r.height||0),"url(#"+a+")"},Mg=.5;function marks_group_backgroundPath(e,t){var r=t.stroke?Mg:0;e.beginPath(),src_path_shapes_rectangle(e,t,r,r)}var Fg=canvas_pick_hitPath(marks_group_backgroundPath);var Ig={type:"group",tag:"g",nested:!1,attr:function src_marks_group_attr(e,t){e("transform",svg_transform_translateItem(t))},bound:function src_marks_group_bound(e,t){if(!t.clip&&t.items)for(var r=t.items,n=0,i=r.length;n<i;++n)e.union(r[n].bounds);return(t.clip||t.width||t.height)&&!t.noBound&&e.add(0,0).add(t.width||0,t.height||0),bg(e,t),e.translate(t.x||0,t.y||0)},draw:function src_marks_group_draw(e,t,r){var n=this;src_util_visit_visit(t,(function(t){var i,a=t.x||0,o=t.y||0,s=t.width||0,u=t.height||0;e.save(),e.translate(a,o),(t.stroke||t.fill)&&(i=null==t.opacity?1:t.opacity)>0&&(marks_group_backgroundPath(e,t),t.fill&&Eg(e,t,i)&&e.fill(),t.stroke&&Tg(e,t,i)&&e.stroke()),t.clip&&(e.beginPath(),e.rect(0,0,s,u),e.clip()),r&&r.translate(-a,-o),src_util_visit_visit(t,(function(t){n.draw(e,t,r)})),r&&r.translate(a,o),e.restore()}))},pick:function src_marks_group_pick(e,t,r,n,i,a){if(t.bounds&&!t.bounds.contains(i,a)||!t.items)return null;var o=this,s=r*e.pixelRatio,u=n*e.pixelRatio;return util_visit_pickVisit(t,(function(l){var c,f,d,h;if(!(h=l.bounds)||h.contains(i,a))return f=l.x||0,d=l.y||0,e.save(),e.translate(f,d),f=i-f,d=a-d,!(c=util_visit_pickVisit(l,(function(e){return function marks_group_pickMark(e,t,r){return(!1!==e.interactive||"group"===e.marktype)&&e.bounds&&e.bounds.contains(t,r)}(e,f,d)?o.pick(e,r,n,f,d):null})))&&!1!==t.interactive&&(l.fill||l.stroke)&&Fg(e,l,s,u)&&(c=l),e.restore(),c||null}))},isect:util_intersect_intersectRect,background:function marks_group_background(e,t){var r=t.stroke?Mg:0;e("class","background"),e("d",src_path_shapes_rectangle(null,t,r,r))},foreground:function marks_group_foreground(e,t,r){e("clip-path",t.clip?jg(r,t,t):null)}};function marks_image_getImage(e,t){var r=e.image;return r&&r.url===e.url||(r={loaded:!1,width:0,height:0},t.loadImage(e.url).then((function(t){e.image=t,e.image.url=e.url}))),r}function marks_image_imageXOffset(e,t){return"center"===e?t/2:"right"===e?t:0}function marks_image_imageYOffset(e,t){return"middle"===e?t/2:"bottom"===e?t:0}var Lg={type:"image",tag:"image",nested:!1,attr:function src_marks_image_attr(e,t,r){var n=marks_image_getImage(t,r),i=t.x||0,a=t.y||0,o=(null!=t.width?t.width:n.width)||0,s=(null!=t.height?t.height:n.height)||0,u=!1===t.aspect?"none":"xMidYMid";i-=marks_image_imageXOffset(t.align,o),a-=marks_image_imageYOffset(t.baseline,s),e("href",n.src||"","http://www.w3.org/1999/xlink","xlink:href"),e("transform",util_svg_transform_translate(i,a)),e("width",o),e("height",s),e("preserveAspectRatio",u)},bound:function src_marks_image_bound(e,t){var r=t.image,n=t.x||0,i=t.y||0,a=(null!=t.width?t.width:r&&r.width)||0,o=(null!=t.height?t.height:r&&r.height)||0;return n-=marks_image_imageXOffset(t.align,a),i-=marks_image_imageYOffset(t.baseline,o),e.set(n,i,n+a,i+o)},draw:function src_marks_image_draw(e,t,r){var n=this;src_util_visit_visit(t,(function(t){if(!r||r.intersects(t.bounds)){var i,a,o,s,u=marks_image_getImage(t,n),l=t.x||0,c=t.y||0,f=(null!=t.width?t.width:u.width)||0,d=(null!=t.height?t.height:u.height)||0;l-=marks_image_imageXOffset(t.align,f),c-=marks_image_imageYOffset(t.baseline,d),!1!==t.aspect&&(a=u.width/u.height,o=t.width/t.height,a===a&&o===o&&a!==o&&(o<a?(c+=(d-(s=f/a))/2,d=s):(l+=(f-(s=d*a))/2,f=s))),u.loaded&&(e.globalAlpha=null!=(i=t.opacity)?i:1,e.drawImage(u,l,c,f,d))}}))},pick:util_canvas_pick_pick(),isect:V.eb,get:marks_image_getImage,xOffset:marks_image_imageXOffset,yOffset:marks_image_imageYOffset},Ng=Rg("line",(function src_path_shapes_line(e,t){var r=t[0],n=r.interpolate||"linear";return gg.curve(path_curves_curves(n,r.orient,r.tension)).context(e)(t)}),(function util_pickPath_pickLine(e,t){for(var r,n,i=Math.pow(e[0].strokeWidth||1,2),a=e.length;--a>=0;)if(!1!==e[a].defined&&(r=e[a].x-t[0])*r+(n=e[a].y-t[1])*n<i)return e[a];return null}));function vega_scenegraph_src_marks_path_path(e,t){var r=t.path;if(null==r)return!0;var n=t.pathCache;n&&n.path===r||((t.pathCache=n=eg(r)).path=r),lg(e,n,t.x,t.y)}var Bg={type:"path",tag:"path",nested:!1,attr:function src_marks_path_attr(e,t){e("transform",svg_transform_translateItem(t)),e("d",t.path)},bound:function src_marks_path_bound(e,t){return vega_scenegraph_src_marks_path_path(src_bound_boundContext_context(e),t)?e.set(0,0,0,0):bg(e,t)},draw:canvas_draw_drawAll(vega_scenegraph_src_marks_path_path),pick:canvas_pick_pickPath(vega_scenegraph_src_marks_path_path),isect:util_intersect_intersectPath(vega_scenegraph_src_marks_path_path)};function src_marks_rect_draw(e,t){e.beginPath(),src_path_shapes_rectangle(e,t)}var Ug={type:"rect",tag:"path",nested:!1,attr:function src_marks_rect_attr(e,t){e("d",src_path_shapes_rectangle(null,t))},bound:function src_marks_rect_bound(e,t){var r,n;return bg(e.set(r=t.x||0,n=t.y||0,r+t.width||0,n+t.height||0),t)},draw:canvas_draw_drawAll(src_marks_rect_draw),pick:canvas_pick_pickPath(src_marks_rect_draw),isect:util_intersect_intersectRect};function src_marks_rule_path(e,t,r){var n,i,a,o;return!(!t.stroke||!Tg(e,t,r))&&(n=t.x||0,i=t.y||0,a=null!=t.x2?t.x2:n,o=null!=t.y2?t.y2:i,e.beginPath(),e.moveTo(n,i),e.lineTo(a,o),!0)}var zg,qg={type:"rule",tag:"line",nested:!1,attr:function src_marks_rule_attr(e,t){e("transform",svg_transform_translateItem(t)),e("x2",null!=t.x2?t.x2-(t.x||0):0),e("y2",null!=t.y2?t.y2-(t.y||0):0)},bound:function src_marks_rule_bound(e,t){var r,n;return bg(e.set(r=t.x||0,n=t.y||0,null!=t.x2?t.x2:r,null!=t.y2?t.y2:n),t)},draw:function src_marks_rule_draw(e,t,r){src_util_visit_visit(t,(function(t){if(!r||r.intersects(t.bounds)){var n=null==t.opacity?1:t.opacity;n&&src_marks_rule_path(e,t,n)&&e.stroke()}}))},pick:util_canvas_pick_pick((function src_marks_rule_hit(e,t,r,n){return!!e.isPointInStroke&&(src_marks_rule_path(e,t,1)&&e.isPointInStroke(r,n))})),isect:function util_intersect_intersectRule(e,t){var r=e.x||0,n=e.y||0;return util_intersect_intersectBoxLine(t,r,n,null!=e.x2?e.x2:r,null!=e.y2?e.y2:n)}},Wg=Og("shape",(function src_path_shapes_shape(e,t){return(t.mark.shape||t.shape).context(e)(t)})),Gg=Og("symbol",(function src_path_shapes_symbol(e,t){return vg.context(e)(t)}),util_intersect_intersectPoint),Hg={height:src_util_text_fontSize,measureWidth:util_text_measureWidth,estimateWidth:util_text_estimateWidth,width:util_text_estimateWidth,canvas:util_text_useCanvas};function util_text_estimateWidth(e){return zg=src_util_text_fontSize(e),util_text_estimate(util_text_textValue(e))}function util_text_estimate(e){return~~(.8*e.length*zg)}function util_text_measureWidth(e){return src_util_text_fontSize(e)<=0?0:(wg.font=src_util_text_font(e),src_util_text_measure(util_text_textValue(e)))}function src_util_text_measure(e){return wg.measureText(e).width}function src_util_text_fontSize(e){return null!=e.fontSize?e.fontSize:11}function util_text_useCanvas(e){Hg.width=e&&wg?util_text_measureWidth:util_text_estimateWidth}function util_text_textValue(e){var t=e.text;return null==t?"":e.limit>0?function util_text_truncate(e){var t,r=+e.limit,n=e.text+"";Hg.width===util_text_measureWidth?(wg.font=src_util_text_font(e),t=src_util_text_measure):(zg=src_util_text_fontSize(e),t=util_text_estimate);if(t(n)<r)return n;var i,a=e.ellipsis||"\u2026",o="rtl"===e.dir,s=0,u=n.length;if(r-=t(a),o){for(;s<u;)i=s+u>>>1,t(n.slice(i))>r?s=i+1:u=i;return a+n.slice(s)}for(;s<u;)i=1+(s+u>>>1),t(n.slice(0,i))<r?s=i:u=i-1;return n.slice(0,s)+a}(e):t+""}function util_text_fontFamily(e,t){var r=e.font;return(t&&r?String(r).replace(/"/g,"'"):r)||"sans-serif"}function src_util_text_font(e,t){return(e.fontStyle?e.fontStyle+" ":"")+(e.fontVariant?e.fontVariant+" ":"")+(e.fontWeight?e.fontWeight+" ":"")+src_util_text_fontSize(e)+"px "+util_text_fontFamily(e,t)}function src_util_text_offset(e){var t=e.baseline,r=src_util_text_fontSize(e);return Math.round("top"===t?.79*r:"middle"===t?.3*r:"bottom"===t?-.21*r:0)}util_text_useCanvas(!0);var Vg={left:"start",center:"middle",right:"end"},Yg=new src_Bounds_Bounds;function marks_text_anchorPoint(e){var t,r=e.x||0,n=e.y||0,i=e.radius||0;return i&&(t=(e.theta||0)-rg,r+=i*Math.cos(t),n+=i*Math.sin(t)),Yg.x1=r,Yg.y1=n,Yg}function src_marks_text_bound(e,t,r){var n,i=Hg.height(t),a=t.align,o=marks_text_anchorPoint(t),s=o.x1,u=o.y1,l=t.dx||0,c=(t.dy||0)+src_util_text_offset(t)-Math.round(.8*i);if(n=Hg.width(t),"center"===a?l-=n/2:"right"===a&&(l-=n),e.set(l+=s,c+=u,l+n,c+i),t.angle&&!r)e.rotate(t.angle*tg,s,u);else if(2===r)return e.rotatedPoints(t.angle*tg,s,u);return e}var $g={arc:Ag,area:Dg,group:Ig,image:Lg,line:Ng,path:Bg,rect:Ug,rule:qg,shape:Wg,symbol:Gg,text:{type:"text",tag:"text",nested:!1,attr:function src_marks_text_attr(e,t){var r,n=t.dx||0,i=(t.dy||0)+src_util_text_offset(t),a=marks_text_anchorPoint(t),o=a.x1,s=a.y1,u=t.angle||0;e("text-anchor",Vg[t.align]||"start"),u?(r=util_svg_transform_translate(o,s)+" "+util_svg_transform_rotate(u),(n||i)&&(r+=" "+util_svg_transform_translate(n,i))):r=util_svg_transform_translate(o+n,s+i),e("transform",r)},bound:src_marks_text_bound,draw:function src_marks_text_draw(e,t,r){src_util_visit_visit(t,(function(t){var n,i,a,o,s;r&&!r.intersects(t.bounds)||(s=util_text_textValue(t))&&(0===(n=null==t.opacity?1:t.opacity)||t.fontSize<=0||(e.font=src_util_text_font(t),e.textAlign=t.align||"left",a=(i=marks_text_anchorPoint(t)).x1,o=i.y1,t.angle&&(e.save(),e.translate(a,o),e.rotate(t.angle*tg),a=o=0),a+=t.dx||0,o+=(t.dy||0)+src_util_text_offset(t),t.fill&&Eg(e,t,n)&&e.fillText(s,a,o),t.stroke&&Tg(e,t,n)&&e.strokeText(s,a,o),t.angle&&e.restore()))}))},pick:util_canvas_pick_pick((function src_marks_text_hit(e,t,r,n,i,a){if(t.fontSize<=0)return!1;if(!t.angle)return!0;var o=marks_text_anchorPoint(t),s=o.x1,u=o.y1,l=src_marks_text_bound(Yg,t,1),c=-t.angle*tg,f=Math.cos(c),d=Math.sin(c),h=f*i-d*a+(s-f*s+d*u),p=d*i+f*a+(u-d*s-f*u);return l.contains(h,p)})),isect:function marks_text_intersectText(e,t){var r=src_marks_text_bound(Yg,e,2);return util_intersect_intersectBoxLine(t,r[0],r[1],r[2],r[3])||util_intersect_intersectBoxLine(t,r[0],r[1],r[4],r[5])||util_intersect_intersectBoxLine(t,r[4],r[5],r[6],r[7])||util_intersect_intersectBoxLine(t,r[2],r[3],r[6],r[7])}},trail:Rg("trail",(function src_path_shapes_trail(e,t){return yg.context(e)(t)}),(function util_pickPath_pickTrail(e,t){for(var r,n,i=e.length;--i>=0;)if(!1!==e[i].defined&&(r=e[i].x-t[0])*r+(n=e[i].y-t[1])*n<(r=e[i].size||1)*r)return e[i];return null}))},Xg=function(e,t,r){var n=$g[e.mark.marktype],i=t||n.bound;return n.nested&&(e=e.mark),i(e.bounds||(e.bounds=new src_Bounds_Bounds),e,r)},Kg={mark:null},Jg=function(e,t,r){var n,i,a,o,s=$g[e.marktype],u=s.bound,l=e.items,c=l&&l.length;if(s.nested)return c?a=l[0]:(Kg.mark=e,a=Kg),o=Xg(a,u,r),t=t&&t.union(o)||o;if(t=t||e.bounds&&e.bounds.clear()||new src_Bounds_Bounds,c)for(n=0,i=l.length;n<i;++n)t.union(Xg(l[n],u,r));return e.bounds=t},Qg=["marktype","name","role","interactive","clip","items","zindex","x","y","width","height","align","baseline","fill","fillOpacity","opacity","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","startAngle","endAngle","innerRadius","outerRadius","cornerRadius","padAngle","interpolate","tension","orient","defined","url","path","x2","y2","size","shape","text","angle","theta","radius","dx","dy","font","fontSize","fontWeight","fontStyle","fontVariant"];function util_serialize_sceneFromJSON(e){return function src_util_serialize_initialize(e){var t,r,n,i=e.marktype,a=e.items;if(a)for(r=0,n=a.length;r<n;++r)t=i?"mark":"group",a[r][t]=e,a[r].zindex&&(a[r][t].zdirty=!0),"group"===(i||t)&&src_util_serialize_initialize(a[r]);i&&Jg(e);return e}("string"===typeof e?JSON.parse(e):e)}function src_Scenegraph_Scenegraph(e){arguments.length?this.root=util_serialize_sceneFromJSON(e):(this.root=src_Scenegraph_createMark({marktype:"group",name:"root",role:"frame"}),this.root.items=[new src_GroupItem_GroupItem(this.root)])}var Zg=src_Scenegraph_Scenegraph.prototype;function src_Scenegraph_createMark(e,t){return{bounds:new src_Bounds_Bounds,clip:!!e.clip,group:t,interactive:!1!==e.interactive,items:[],marktype:e.marktype,name:e.name||void 0,role:e.role||void 0,zindex:e.zindex||0}}function util_dom_domCreate(e,t,r){return!e&&"undefined"!==typeof document&&document.createElement&&(e=document),e?r?e.createElementNS(r,t):e.createElement(t):null}function util_dom_domFind(e,t){t=t.toLowerCase();for(var r=e.childNodes,n=0,i=r.length;n<i;++n)if(r[n].tagName.toLowerCase()===t)return r[n]}function util_dom_domChild(e,t,r,n){var i,a=e.childNodes[t];return a&&a.tagName.toLowerCase()===r.toLowerCase()||(i=a||null,a=util_dom_domCreate(e.ownerDocument,r,n),e.insertBefore(a,i)),a}function util_dom_domClear(e,t){for(var r=e.childNodes,n=r.length;n>t;)e.removeChild(r[--n]);return e}function util_dom_cssClass(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}Zg.toJSON=function(e){return function util_serialize_sceneToJSON(e,t){return JSON.stringify(e,Qg,t)}(this.root,e||0)},Zg.mark=function(e,t,r){var n=src_Scenegraph_createMark(e,t=t||this.root.items[0]);return t.items[r]=n,n.zindex&&(n.group.zdirty=!0),n};var em=function(e,t){var r=t.getBoundingClientRect();return[e.clientX-r.left-(t.clientLeft||0),e.clientY-r.top-(t.clientTop||0)]};function vega_scenegraph_src_Handler_Handler(e,t){this._active=null,this._handlers={},this._loader=e||Xp(),this._tooltip=t||src_Handler_defaultTooltip}function src_Handler_defaultTooltip(e,t,r,n){e.element().setAttribute("title",n||"")}var tm=vega_scenegraph_src_Handler_Handler.prototype;function vega_scenegraph_src_Renderer_Renderer(e){this._el=null,this._bgcolor=null,this._loader=new src_ResourceLoader_ResourceLoader(e)}tm.initialize=function(e,t,r){return this._el=e,this._obj=r||null,this.origin(t)},tm.element=function(){return this._el},tm.canvas=function(){return this._el&&this._el.firstChild},tm.origin=function(e){return arguments.length?(this._origin=e||[0,0],this):this._origin.slice()},tm.scene=function(e){return arguments.length?(this._scene=e,this):this._scene},tm.on=function(){},tm.off=function(){},tm._handlerIndex=function(e,t,r){for(var n=e?e.length:0;--n>=0;)if(e[n].type===t&&(!r||e[n].handler===r))return n;return-1},tm.handlers=function(e){var t,r=this._handlers,n=[];if(e)n.push.apply(n,r[this.eventName(e)]);else for(t in r)n.push.apply(n,r[t]);return n},tm.eventName=function(e){var t=e.indexOf(".");return t<0?e:e.slice(0,t)},tm.handleHref=function(e,t,r){this._loader.sanitize(r,{context:"href"}).then((function(t){var r=new MouseEvent(e.type,e),n=util_dom_domCreate(null,"a");for(var i in t)n.setAttribute(i,t[i]);n.dispatchEvent(r)})).catch((function(){}))},tm.handleTooltip=function(e,t,r){if(t&&null!=t.tooltip){t=function(e,t,r,n){var i,a,o=e&&e.mark;if(o&&(i=$g[o.marktype]).tip){for((a=em(t,r))[0]-=n[0],a[1]-=n[1];e=e.mark.group;)a[0]-=e.x||0,a[1]-=e.y||0;e=i.tip(o.items,a)}return e}(t,e,this.canvas(),this._origin);var n=r&&t&&t.tooltip||null;this._tooltip.call(this._obj,this,e,t,n)}},tm.getItemBoundingClientRect=function(e){if(t=this.canvas()){for(var t,r=t.getBoundingClientRect(),n=this._origin,i=e.bounds,a=i.x1+n[0]+r.left,o=i.y1+n[1]+r.top,s=i.width(),u=i.height();e.mark&&(e=e.mark.group);)a+=e.x||0,o+=e.y||0;return{x:a,y:o,width:s,height:u,left:a,top:o,right:a+s,bottom:o+u}}};var rm=vega_scenegraph_src_Renderer_Renderer.prototype;rm.initialize=function(e,t,r,n,i){return this._el=e,this.resize(t,r,n,i)},rm.element=function(){return this._el},rm.canvas=function(){return this._el&&this._el.firstChild},rm.background=function(e){return 0===arguments.length?this._bgcolor:(this._bgcolor=e,this)},rm.resize=function(e,t,r,n){return this._width=e,this._height=t,this._origin=r||[0,0],this._scale=n||1,this},rm.dirty=function(){},rm.render=function(e){var t=this;return t._call=function(){t._render(e)},t._call(),t._call=null,t},rm._render=function(){},rm.renderAsync=function(e){var t=this.render(e);return this._ready?this._ready.then((function(){return t})):Promise.resolve(t)},rm._load=function(e,t){var r=this,n=r._loader[e](t);if(!r._ready){var i=r._call;r._ready=r._loader.ready().then((function(e){e&&i(),r._ready=null}))}return n},rm.sanitizeURL=function(e){return this._load("sanitizeURL",e)},rm.loadImage=function(e){return this._load("loadImage",e)};var nm="mouseout";function src_CanvasHandler_CanvasHandler(e,t){vega_scenegraph_src_Handler_Handler.call(this,e,t),this._down=null,this._touch=null,this._first=!0}var im=Object(V.y)(src_CanvasHandler_CanvasHandler,vega_scenegraph_src_Handler_Handler);function src_CanvasHandler_move(e,t,r){return function(n){var i=this._active,a=this.pickEvent(n);a===i?this.fire(e,n):(i&&i.exit||this.fire(r,n),this._active=a,this.fire(t,n),this.fire(e,n))}}function src_CanvasHandler_inactive(e){return function(t){this.fire(e,t),this._active=null}}im.initialize=function(e,t,r){var n=this._canvas=e&&util_dom_domFind(e,"canvas");if(n){var i=this;this.events.forEach((function(e){n.addEventListener(e,(function(t){im[e]?im[e].call(i,t):i.fire(e,t)}))}))}return vega_scenegraph_src_Handler_Handler.prototype.initialize.call(this,e,t,r)},im.canvas=function(){return this._canvas},im.context=function(){return this._canvas.getContext("2d")},im.events=["keydown","keypress","keyup","dragenter","dragleave","dragover","mousedown","mouseup","mousemove","mouseout","mouseover","click","dblclick","wheel","mousewheel","touchstart","touchmove","touchend"],im.DOMMouseScroll=function(e){this.fire("mousewheel",e)},im.mousemove=src_CanvasHandler_move("mousemove","mouseover","mouseout"),im.dragover=src_CanvasHandler_move("dragover","dragenter","dragleave"),im.mouseout=src_CanvasHandler_inactive("mouseout"),im.dragleave=src_CanvasHandler_inactive("dragleave"),im.mousedown=function(e){this._down=this._active,this.fire("mousedown",e)},im.click=function(e){this._down===this._active&&(this.fire("click",e),this._down=null)},im.touchstart=function(e){this._touch=this.pickEvent(e.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire("touchstart",e,!0)},im.touchmove=function(e){this.fire("touchmove",e,!0)},im.touchend=function(e){this.fire("touchend",e,!0),this._touch=null},im.fire=function(e,t,r){var n,i,a=r?this._touch:this._active,o=this._handlers[e];if(t.vegaType=e,"click"===e&&a&&a.href?this.handleHref(t,a,a.href):"mousemove"!==e&&e!==nm||this.handleTooltip(t,a,e!==nm),o)for(n=0,i=o.length;n<i;++n)o[n].handler.call(this._obj,t,a)},im.on=function(e,t){var r=this.eventName(e),n=this._handlers;return this._handlerIndex(n[r],e,t)<0&&(n[r]||(n[r]=[])).push({type:e,handler:t}),this},im.off=function(e,t){var r=this.eventName(e),n=this._handlers[r],i=this._handlerIndex(n,e,t);return i>=0&&n.splice(i,1),this},im.pickEvent=function(e){var t=em(e,this._canvas),r=this._origin;return this.pick(this._scene,t[0],t[1],t[0]-r[0],t[1]-r[1])},im.pick=function(e,t,r,n,i){var a=this.context();return $g[e.marktype].pick.call(this,a,e,t,r,n,i)};var am=function canvas_resize_devicePixelRatio(){return"undefined"!==typeof window&&window.devicePixelRatio||1}();function src_CanvasRenderer_CanvasRenderer(e){vega_scenegraph_src_Renderer_Renderer.call(this,e),this._redraw=!1,this._dirty=new src_Bounds_Bounds}var om=Object(V.y)(src_CanvasRenderer_CanvasRenderer,vega_scenegraph_src_Renderer_Renderer),sm=vega_scenegraph_src_Renderer_Renderer.prototype,um=new src_Bounds_Bounds;function src_SVGHandler_SVGHandler(e,t){vega_scenegraph_src_Handler_Handler.call(this,e,t);var r=this;r._hrefHandler=src_SVGHandler_listener(r,(function(e,t){t&&t.href&&r.handleHref(e,t,t.href)})),r._tooltipHandler=src_SVGHandler_listener(r,(function(e,t){r.handleTooltip(e,t,e.type!==nm)}))}om.initialize=function(e,t,r,n,i,a){return this._options=a,this._canvas=domCanvas(1,1,a&&a.type),e&&(util_dom_domClear(e,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),sm.initialize.call(this,e,t,r,n,i)},om.resize=function(e,t,r,n){return sm.resize.call(this,e,t,r,n),function(e,t,r,n,i,a){var o,s="undefined"!==typeof HTMLElement&&e instanceof HTMLElement&&null!=e.parentNode,u=e.getContext("2d"),l=s?am:i;for(o in e.width=t*l,e.height=r*l,a)u[o]=a[o];s&&1!==l&&(e.style.width=t+"px",e.style.height=r+"px"),u.pixelRatio=l,u.setTransform(l,0,0,l,l*n[0],l*n[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options&&this._options.context),this._redraw=!0,this},om.canvas=function(){return this._canvas},om.context=function(){return this._canvas?this._canvas.getContext("2d"):null},om.dirty=function(e){var t=function vega_scenegraph_src_CanvasRenderer_translate(e,t){if(null==t)return e;for(var r=um.clear().union(e);null!=t;t=t.mark.group)r.translate(t.x||0,t.y||0);return r}(e.bounds,e.mark.group);this._dirty.union(t)},om._render=function(e){var t=this.context(),r=this._origin,n=this._width,i=this._height,a=this._dirty;return t.save(),this._redraw||a.empty()?(this._redraw=!1,a=null):a=function src_CanvasRenderer_clipToBounds(e,t,r){return t.expand(1).round(),t.translate(-r[0]%1,-r[1]%1),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}(t,a,r),this.clear(-r[0],-r[1],n,i),this.draw(t,e,a),t.restore(),this._dirty.clear(),this},om.draw=function(e,t,r){var n=$g[t.marktype];t.clip&&function(e,t){var r=t.clip;if(e.save(),e.beginPath(),Object(V.D)(r))r(e);else{var n=t.group;e.rect(0,0,n.width||0,n.height||0)}e.clip()}(e,t),n.draw.call(this,e,t,r),t.clip&&e.restore()},om.clear=function(e,t,r,n){var i=this.context();i.clearRect(e,t,r,n),null!=this._bgcolor&&(i.fillStyle=this._bgcolor,i.fillRect(e,t,r,n))};var lm=Object(V.y)(src_SVGHandler_SVGHandler,vega_scenegraph_src_Handler_Handler);function src_SVGHandler_listener(e,t){return function(r){var n=r.target.__data__;r.vegaType=r.type,n=Array.isArray(n)?n[0]:n,t.call(e._obj,r,n)}}function util_tags_openTag(e,t,r){var n,i,a="<"+e;if(t)for(n in t)null!=(i=t[n])&&(a+=" "+n+'="'+i+'"');return r&&(a+=" "+r),a+">"}function util_tags_closeTag(e){return"</"+e+">"}lm.initialize=function(e,t,r){var n=this._svg;return n&&(n.removeEventListener("click",this._hrefHandler),n.removeEventListener("mousemove",this._tooltipHandler),n.removeEventListener(nm,this._tooltipHandler)),this._svg=n=e&&util_dom_domFind(e,"svg"),n&&(n.addEventListener("click",this._hrefHandler),n.addEventListener("mousemove",this._tooltipHandler),n.addEventListener(nm,this._tooltipHandler)),vega_scenegraph_src_Handler_Handler.prototype.initialize.call(this,e,t,r)},lm.canvas=function(){return this._svg},lm.on=function(e,t){var r=this.eventName(e),n=this._handlers;if(this._handlerIndex(n[r],e,t)<0){var i={type:e,handler:t,listener:src_SVGHandler_listener(this,t)};(n[r]||(n[r]=[])).push(i),this._svg&&this._svg.addEventListener(r,i.listener)}return this},lm.off=function(e,t){var r=this.eventName(e),n=this._handlers[r],i=this._handlerIndex(n,e,t);return i>=0&&(this._svg&&this._svg.removeEventListener(r,n[i].listener),n.splice(i,1)),this};var cm={version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},fm={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",strokeCap:"stroke-linecap",strokeJoin:"stroke-linejoin",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeMiterLimit:"stroke-miterlimit",opacity:"opacity"},dm=Object.keys(fm),hm=cm.xmlns;function src_SVGRenderer_SVGRenderer(e){vega_scenegraph_src_Renderer_Renderer.call(this,e),this._dirtyID=1,this._dirty=[],this._svg=null,this._root=null,this._defs=null}var pm=Object(V.y)(src_SVGRenderer_SVGRenderer,vega_scenegraph_src_Renderer_Renderer),gm=vega_scenegraph_src_Renderer_Renderer.prototype;function src_SVGRenderer_updateGradient(e,t,r){var n,i,a;if("radial"===t.gradient){var o=util_dom_domChild(e,r++,"pattern",hm);o.setAttribute("id",qp+t.id),o.setAttribute("viewBox","0,0,1,1"),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("preserveAspectRatio","xMidYMid slice"),(o=util_dom_domChild(o,0,"rect",hm)).setAttribute("width","1"),o.setAttribute("height","1"),o.setAttribute("fill","url("+vega_scenegraph_src_SVGRenderer_href()+"#"+t.id+")"),(e=util_dom_domChild(e,r++,"radialGradient",hm)).setAttribute("id",t.id),e.setAttribute("fx",t.x1),e.setAttribute("fy",t.y1),e.setAttribute("fr",t.r1),e.setAttribute("cx",t.x2),e.setAttribute("cy",t.y2),e.setAttribute("r",t.r2)}else(e=util_dom_domChild(e,r++,"linearGradient",hm)).setAttribute("id",t.id),e.setAttribute("x1",t.x1),e.setAttribute("x2",t.x2),e.setAttribute("y1",t.y1),e.setAttribute("y2",t.y2);for(n=0,i=t.stops.length;n<i;++n)(a=util_dom_domChild(e,n,"stop",hm)).setAttribute("offset",t.stops[n].offset),a.setAttribute("stop-color",t.stops[n].color);return util_dom_domClear(e,n),r}function src_SVGRenderer_updateClipping(e,t,r){var n;return(e=util_dom_domChild(e,r,"clipPath",hm)).setAttribute("id",t.id),t.path?(n=util_dom_domChild(e,0,"path",hm)).setAttribute("d",t.path):((n=util_dom_domChild(e,0,"rect",hm)).setAttribute("x",0),n.setAttribute("y",0),n.setAttribute("width",t.width),n.setAttribute("height",t.height)),r+1}function src_SVGRenderer_dirtyParents(e,t){for(;e&&e.dirty!==t;e=e.mark.group){if(e.dirty=t,!e.mark||e.mark.dirty===t)return;e.mark.dirty=t}}function vega_scenegraph_src_SVGRenderer_bind(e,t,r,n,i){var a,o=e._svg;if(!o&&(o=util_dom_domCreate(a=t.ownerDocument,n,hm),e._svg=o,e.mark&&(o.__data__=e,o.__values__={fill:"default"},"g"===n))){var s=util_dom_domCreate(a,"path",hm);s.setAttribute("class","background"),o.appendChild(s),s.__data__=e;var u=util_dom_domCreate(a,"g",hm);o.appendChild(u),u.__data__=e}return(o.ownerSVGElement!==i||function src_SVGRenderer_hasSiblings(e){var t=e.mark||e.group;return t&&t.items.length>1}(e)&&o.previousSibling!==r)&&t.insertBefore(o,r?r.nextSibling:t.firstChild),o}pm.initialize=function(e,t,r,n){return e&&(this._svg=util_dom_domChild(e,0,"svg",hm),this._svg.setAttribute("class","marks"),util_dom_domClear(e,1),this._root=util_dom_domChild(this._svg,0,"g",hm),util_dom_domClear(this._svg,1)),this._defs={gradient:{},clipping:{}},this.background(this._bgcolor),gm.initialize.call(this,e,t,r,n)},pm.background=function(e){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",e),gm.background.apply(this,arguments)},pm.resize=function(e,t,r,n){return gm.resize.call(this,e,t,r,n),this._svg&&(this._svg.setAttribute("width",this._width*this._scale),this._svg.setAttribute("height",this._height*this._scale),this._svg.setAttribute("viewBox","0 0 "+this._width+" "+this._height),this._root.setAttribute("transform","translate("+this._origin+")")),this._dirty=[],this},pm.canvas=function(){return this._svg},pm.svg=function(){if(!this._svg)return null;var e={class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 "+this._width+" "+this._height};for(var t in cm)e[t]=cm[t];var r=this._bgcolor?util_tags_openTag("rect",{width:this._width,height:this._height,style:"fill: "+this._bgcolor+";"})+util_tags_closeTag("rect"):"";return util_tags_openTag("svg",e)+r+this._svg.innerHTML+util_tags_closeTag("svg")},pm._render=function(e){return this._dirtyCheck()&&(this._dirtyAll&&this._resetDefs(),this.draw(this._root,e),util_dom_domClear(this._root,1)),this.updateDefs(),this._dirty=[],++this._dirtyID,this},pm.updateDefs=function(){var e,t=this._svg,r=this._defs,n=r.el,i=0;for(e in r.gradient)n||(r.el=n=util_dom_domChild(t,0,"defs",hm)),i=src_SVGRenderer_updateGradient(n,r.gradient[e],i);for(e in r.clipping)n||(r.el=n=util_dom_domChild(t,0,"defs",hm)),i=src_SVGRenderer_updateClipping(n,r.clipping[e],i);n&&(0===i?(t.removeChild(n),r.el=null):util_dom_domClear(n,i))},pm._resetDefs=function(){var e=this._defs;e.gradient={},e.clipping={}},pm.dirty=function(e){e.dirty!==this._dirtyID&&(e.dirty=this._dirtyID,this._dirty.push(e))},pm.isDirty=function(e){return this._dirtyAll||!e._svg||e.dirty===this._dirtyID},pm._dirtyCheck=function(){this._dirtyAll=!0;var e=this._dirty;if(!e.length)return!0;var t,r,n,i,a,o,s,u=++this._dirtyID;for(a=0,o=e.length;a<o;++a)(r=(t=e[a]).mark).marktype!==n&&(n=r.marktype,i=$g[n]),r.zdirty&&r.dirty!==u&&(this._dirtyAll=!1,src_SVGRenderer_dirtyParents(t,u),r.items.forEach((function(e){e.dirty=u}))),r.zdirty||(t.exit?(i.nested&&r.items.length?(s=r.items[0])._svg&&this._update(i,s._svg,s):t._svg&&(s=t._svg.parentNode)&&s.removeChild(t._svg),t._svg=null):(t=i.nested?r.items[0]:t)._update!==u&&(t._svg&&t._svg.ownerSVGElement?this._update(i,t._svg,t):(this._dirtyAll=!1,src_SVGRenderer_dirtyParents(t,u)),t._update=u));return!this._dirtyAll},pm.draw=function(e,t,r){if(!this.isDirty(t))return t._svg;var n,i=this,a=this._svg,o=$g[t.marktype],s=!1===t.interactive?"none":null,u="g"===o.tag,l=null,c=0;function process(e){var t=i.isDirty(e),r=vega_scenegraph_src_SVGRenderer_bind(e,n,l,o.tag,a);t&&(i._update(o,r,e),u&&function vega_scenegraph_src_SVGRenderer_recurse(e,t,r){t=t.lastChild;var n,i=0;src_util_visit_visit(r,(function(r){n=e.draw(t,r,n),++i})),util_dom_domClear(t,1+i)}(i,r,e)),l=r,++c}return(n=vega_scenegraph_src_SVGRenderer_bind(t,e,r,"g",a)).setAttribute("class",util_dom_cssClass(t)),u||n.style.setProperty("pointer-events",s),t.clip?n.setAttribute("clip-path",jg(i,t,t.group)):n.removeAttribute("clip-path"),o.nested?t.items.length&&process(t.items[0]):src_util_visit_visit(t,process),util_dom_domClear(n,c),n};var mm=null,vm=null,ym={group:function group(e,t,r){vm=t.__values__,mm=t.childNodes[1],e.foreground(vega_scenegraph_src_SVGRenderer_emit,r,this),mm=t.childNodes[0],e.background(vega_scenegraph_src_SVGRenderer_emit,r,this);var n=!1===r.mark.interactive?"none":null;n!==vm.events&&(mm.style.setProperty("pointer-events",n),vm.events=n)},text:function text(e,t,r){var n;(n=util_text_textValue(r))!==vm.text&&(t.textContent=n,vm.text=n),src_SVGRenderer_setStyle(t,"font-family",util_text_fontFamily(r)),src_SVGRenderer_setStyle(t,"font-size",src_util_text_fontSize(r)+"px"),src_SVGRenderer_setStyle(t,"font-style",r.fontStyle),src_SVGRenderer_setStyle(t,"font-variant",r.fontVariant),src_SVGRenderer_setStyle(t,"font-weight",r.fontWeight)}};function src_SVGRenderer_setStyle(e,t,r){r!==vm[t]&&(null==r?e.style.removeProperty(t):e.style.setProperty(t,r+""),vm[t]=r)}function vega_scenegraph_src_SVGRenderer_emit(e,t,r){t!==vm[e]&&(null!=t?r?mm.setAttributeNS(r,e,t):mm.setAttribute(e,t):r?mm.removeAttributeNS(r,e):mm.removeAttribute(e),vm[e]=t)}function vega_scenegraph_src_SVGRenderer_href(){var e;return"undefined"===typeof window?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}function src_SVGStringRenderer_SVGStringRenderer(e){vega_scenegraph_src_Renderer_Renderer.call(this,e),this._text={head:"",bg:"",root:"",foot:"",defs:"",body:""},this._defs={gradient:{},clipping:{}}}pm._update=function(e,t,r){mm=t,vm=t.__values__,e.attr(vega_scenegraph_src_SVGRenderer_emit,r,this);var n=ym[e.type];n&&n.call(this,e,t,r),this.style(mm,r)},pm.style=function(e,t){var r,n,i,a,o;if(null!=t)for(r=0,n=dm.length;r<n;++r)o=t[i=dm[r]],"font"===i&&(o=util_text_fontFamily(t)),o!==vm[i]&&(a=fm[i],null==o?"fill"===a?e.style.setProperty(a,"none"):e.style.removeProperty(a):(src_Gradient_isGradient(o)&&(o=src_Gradient_gradientRef(o,this._defs.gradient,vega_scenegraph_src_SVGRenderer_href())),e.style.setProperty(a,o+"")),vm[i]=o)};var _m,bm=Object(V.y)(src_SVGStringRenderer_SVGStringRenderer,vega_scenegraph_src_Renderer_Renderer),xm=vega_scenegraph_src_Renderer_Renderer.prototype;function vega_scenegraph_src_SVGStringRenderer_emit(e,t,r,n){_m[n||e]=t}function src_SVGStringRenderer_applyStyles(e,t,r,n){if(null==e)return"";var i,a,o,s,u,l="";for("bgrect"===r&&!1===t.interactive&&(l+="pointer-events: none; "),"text"===r&&(l+="font-family: "+util_text_fontFamily(e)+"; ",l+="font-size: "+src_util_text_fontSize(e)+"px; ",e.fontStyle&&(l+="font-style: "+e.fontStyle+"; "),e.fontVariant&&(l+="font-variant: "+e.fontVariant+"; "),e.fontWeight&&(l+="font-weight: "+e.fontWeight+"; ")),i=0,a=dm.length;i<a;++i)o=dm[i],s=fm[o],null==(u=e[o])?"fill"===s&&(l+="fill: none; "):"transparent"!==u||"fill"!==s&&"stroke"!==s?(src_Gradient_isGradient(u)&&(u=src_Gradient_gradientRef(u,n.gradient,"")),l+=s+": "+u+"; "):l+=s+": none; ";return l?'style="'+l.trim()+'"':null}bm.resize=function(e,t,r,n){xm.resize.call(this,e,t,r,n);var i=this._origin,a=this._text,o={class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 "+this._width+" "+this._height};for(var s in cm)o[s]=cm[s];a.head=util_tags_openTag("svg",o);var u=this._bgcolor;return"transparent"!==u&&"none"!==u||(u=null),a.bg=u?util_tags_openTag("rect",{width:this._width,height:this._height,style:"fill: "+u+";"})+util_tags_closeTag("rect"):"",a.root=util_tags_openTag("g",{transform:"translate("+i+")"}),a.foot=util_tags_closeTag("g")+util_tags_closeTag("svg"),this},bm.background=function(){var e=xm.background.apply(this,arguments);return arguments.length&&this._text.head&&this.resize(this._width,this._height,this._origin,this._scale),e},bm.svg=function(){var e=this._text;return e.head+e.bg+e.defs+e.root+e.body+e.foot},bm._render=function(e){return this._text.body=this.mark(e),this._text.defs=this.buildDefs(),this},bm.buildDefs=function(){var e,t,r,n,i,a=this._defs,o="";for(t in a.gradient){for(i=(r=a.gradient[t]).stops,"radial"===r.gradient?(o+=util_tags_openTag(n="pattern",{id:qp+t,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),o+=util_tags_openTag("rect",{width:"1",height:"1",fill:"url(#"+t+")"})+util_tags_closeTag("rect"),o+=util_tags_closeTag(n),o+=util_tags_openTag(n="radialGradient",{id:t,fx:r.x1,fy:r.y1,fr:r.r1,cx:r.x2,cy:r.y2,r:r.r2})):o+=util_tags_openTag(n="linearGradient",{id:t,x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2}),e=0;e<i.length;++e)o+=util_tags_openTag("stop",{offset:i[e].offset,"stop-color":i[e].color})+util_tags_closeTag("stop");o+=util_tags_closeTag(n)}for(t in a.clipping)r=a.clipping[t],o+=util_tags_openTag("clipPath",{id:t}),r.path?o+=util_tags_openTag("path",{d:r.path})+util_tags_closeTag("path"):o+=util_tags_openTag("rect",{x:0,y:0,width:r.width,height:r.height})+util_tags_closeTag("rect"),o+=util_tags_closeTag("clipPath");return o.length>0?util_tags_openTag("defs")+o+util_tags_closeTag("defs"):""},bm.attributes=function(e,t){return _m={},e(vega_scenegraph_src_SVGStringRenderer_emit,t,this),_m},bm.href=function(e){var t,r=this,n=e.href;if(n){if(t=r._hrefs&&r._hrefs[n])return t;r.sanitizeURL(n).then((function(e){e["xlink:href"]=e.href,e.href=null,(r._hrefs||(r._hrefs={}))[n]=e}))}return null},bm.mark=function(e){var t,r=this,n=$g[e.marktype],i=n.tag,a=this._defs,o="";function process(s){var u=r.href(s);u&&(o+=util_tags_openTag("a",u)),t="g"!==i?src_SVGStringRenderer_applyStyles(s,e,i,a):null,o+=util_tags_openTag(i,r.attributes(n.attr,s),t),"text"===i?o+=function src_SVGStringRenderer_escape_text(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}(util_text_textValue(s)):"g"===i&&(o+=util_tags_openTag("path",r.attributes(n.background,s),src_SVGStringRenderer_applyStyles(s,e,"bgrect",a))+util_tags_closeTag("path"),o+=util_tags_openTag("g",r.attributes(n.foreground,s))+r.markGroup(s)+util_tags_closeTag("g")),o+=util_tags_closeTag(i),u&&(o+=util_tags_closeTag("a"))}return"g"!==i&&!1===e.interactive&&(t='style="pointer-events: none;"'),o+=util_tags_openTag("g",{class:util_dom_cssClass(e),"clip-path":e.clip?jg(r,e,e.group):null},t),n.nested?e.items&&e.items.length&&process(e.items[0]):src_util_visit_visit(e,process),o+util_tags_closeTag("g")},bm.markGroup=function(e){var t=this,r="";return src_util_visit_visit(e,(function(e){r+=t.mark(e)})),r};var wm={Canvas:"canvas",PNG:"png",SVG:"svg",None:"none"},km={};function src_modules_renderModule(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(km[e]=t,this):km[e]}km.canvas=km.png={renderer:src_CanvasRenderer_CanvasRenderer,headless:src_CanvasRenderer_CanvasRenderer,handler:src_CanvasHandler_CanvasHandler},km.svg={renderer:src_SVGRenderer_SVGRenderer,headless:src_SVGStringRenderer_SVGStringRenderer,handler:src_SVGHandler_SVGHandler},km.none={};new src_Bounds_Bounds;var Sm=function(e,t,r){var n,i,a,o=e._renderer,s=o&&o.canvas();return s&&(a=render_size_offset(e),i=t.changedTouches?t.changedTouches[0]:t,(n=em(i,s))[0]-=a[0],n[1]-=a[1]),t.dataflow=e,t.item=r,t.vega=function extension(e,t,r){var n=t?"group"===t.mark.marktype?t:t.mark.group:null;function group(e){var r,i=n;if(e)for(r=t;r;r=r.mark.group)if(r.mark.name===e){i=r;break}return i&&i.mark&&i.mark.interactive?i:{}}function xy(e){if(!e)return r;Object(V.H)(e)&&(e=group(e));for(var t=r.slice();e;)t[0]-=e.x||0,t[1]-=e.y||0,e=e.mark&&e.mark.group;return t}return{view:Object(V.l)(e),item:Object(V.l)(t||{}),group:group,xy:xy,x:function x(e){return xy(e)[0]},y:function y(e){return xy(e)[1]}}}(e,r,n),t};var Em="view",Cm="timer",Tm="window",Om={trap:!1};function permit(e,t,r){var n=e._eventConfig&&e._eventConfig[t];return!(!1===n||Object(V.F)(n)&&!n[r])||(e.warn("Blocked ".concat(t," ").concat(r," event listener.")),!1)}function itemFilter(e){return e.item}function markTarget(e){return e.item.mark.source}function invoke(e){return function(t,r){return r.vega.view().changeset().encode(r.item,e)}}var Am=function(e,t,r){var n=document.createElement(e);for(var i in t)n.setAttribute(i,t[i]);return null!=r&&(n.textContent=r),n},Rm="vega-bind",Dm="vega-bind-name",Pm="vega-bind-radio",jm="vega-option-",Mm=function(e,t,r){if(t){var n=r.param,i=r.state;return i||(i=r.state={elements:null,active:!1,set:null,update:function update(t){t!==e.signal(n.signal)&&e.runAsync(null,(function(){i.source=!0,e.signal(n.signal,t)}))}},n.debounce&&(i.update=Object(V.m)(n.debounce,i.update))),function bind_generate(e,t,r,n){var i=Am("div",{class:Rm});i.appendChild(Am("span",{class:Dm},r.name||r.signal)),t.appendChild(i);var a=bind_form;switch(r.input){case"checkbox":a=bind_checkbox;break;case"select":a=bind_select;break;case"radio":a=bind_radio;break;case"range":a=bind_range}a(e,i,r,n)}(i,t,n,e.signal(n.signal)),i.active||(e.on(e._signals[n.signal],null,(function(){i.source?i.source=!1:i.set(e.signal(n.signal))})),i.active=!0),i}};function bind_form(e,t,r,n){var i=Am("input");for(var a in r)"signal"!==a&&"element"!==a&&i.setAttribute("input"===a?"type":a,r[a]);i.setAttribute("name",r.signal),i.value=n,t.appendChild(i),i.addEventListener("input",(function(){e.update(i.value)})),e.elements=[i],e.set=function(e){i.value=e}}function bind_checkbox(e,t,r,n){var i={type:"checkbox",name:r.signal};n&&(i.checked=!0);var a=Am("input",i);t.appendChild(a),a.addEventListener("change",(function(){e.update(a.checked)})),e.elements=[a],e.set=function(e){a.checked=!!e||null}}function bind_select(e,t,r,n){var i=Am("select",{name:r.signal});r.options.forEach((function(e){var t={value:e};valuesEqual(e,n)&&(t.selected=!0),i.appendChild(Am("option",t,e+""))})),t.appendChild(i),i.addEventListener("change",(function(){e.update(r.options[i.selectedIndex])})),e.elements=[i],e.set=function(e){for(var t=0,n=r.options.length;t<n;++t)if(valuesEqual(r.options[t],e))return void(i.selectedIndex=t)}}function bind_radio(e,t,r,n){var i=Am("span",{class:Pm});t.appendChild(i),e.elements=r.options.map((function(t){var a=jm+r.signal+"-"+t,o={id:a,type:"radio",name:r.signal,value:t};valuesEqual(t,n)&&(o.checked=!0);var s=Am("input",o);return s.addEventListener("change",(function(){e.update(t)})),i.appendChild(s),i.appendChild(Am("label",{for:a},t+"")),s})),e.set=function(t){for(var r=e.elements,n=0,i=r.length;n<i;++n)valuesEqual(r[n].value,t)&&(r[n].checked=!0)}}function bind_range(e,t,r,n){n=void 0!==n?n:(+r.max+ +r.min)/2;var i=null!=r.max?r.max:Math.max(100,+n)||100,a=r.min||Math.min(0,i,+n)||0,o=r.step||tickStep(a,i,100),s=Am("input",{type:"range",name:r.signal,min:a,max:i,step:o});s.value=n;var u=Am("label",{},+n);function update(){u.textContent=s.value,e.update(+s.value)}t.appendChild(s),t.appendChild(u),s.addEventListener("input",update),s.addEventListener("change",update),e.elements=[s],e.set=function(e){s.value=e,u.textContent=e}}function valuesEqual(e,t){return e===t||e+""===t+""}var Fm=function(e,t,r,n,i,a){return(t=t||new n(e.loader())).initialize(r,render_size_width(e),render_size_height(e),render_size_offset(e),i,a).background(e._background)},Im=function(e,t){return t?function(){try{t.apply(this,arguments)}catch(r){e.error(r)}}:null};function initialize_lookup(e,t){if("string"===typeof t){if("undefined"===typeof document)return e.error("DOM document instance not found."),null;if(!(t=document.querySelector(t)))return e.error("Signal bind element not found: "+t),null}if(t)try{t.innerHTML=""}catch(r){t=null,e.error(r)}return t}var Lm=function(e,t,r,n){return render_headless_ref.apply(this,arguments)};function render_headless_ref(){return(render_headless_ref=Object(Y.a)(A.a.mark((function _callee(e,t,r,n){var i,a;return A.a.wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:return i=src_modules_renderModule(t),(a=i&&i.headless)||Object(V.n)("Unrecognized renderer type: "+t),o.next=4,e.runAsync();case 4:return o.abrupt("return",Fm(e,null,null,a,r,n).renderAsync(e._scenegraph.root));case 5:case"end":return o.stop()}}),_callee)})))).apply(this,arguments)}function render_to_image_url_ref(){return(render_to_image_url_ref=Object(Y.a)(A.a.mark((function _callee(e,t){var r;return A.a.wrap((function _callee$(n){for(;;)switch(n.prev=n.next){case 0:return e!==wm.Canvas&&e!==wm.SVG&&e!==wm.PNG&&Object(V.n)("Unrecognized image type: "+e),n.next=3,Lm(this,e,t);case 3:return r=n.sent,n.abrupt("return",e===wm.SVG?toBlobURL(r.svg(),"image/svg+xml"):r.canvas().toDataURL("image/png"));case 5:case"end":return n.stop()}}),_callee,this)})))).apply(this,arguments)}function toBlobURL(e,t){var r=new Blob([e],{type:t});return window.URL.createObjectURL(r)}function render_to_canvas_ref(){return(render_to_canvas_ref=Object(Y.a)(A.a.mark((function _callee(e,t){var r;return A.a.wrap((function _callee$(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Lm(this,wm.Canvas,e,t);case 2:return r=n.sent,n.abrupt("return",r.canvas());case 4:case"end":return n.stop()}}),_callee,this)})))).apply(this,arguments)}function render_to_svg_ref(){return(render_to_svg_ref=Object(Y.a)(A.a.mark((function _callee(e){var t;return A.a.wrap((function _callee$(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,Lm(this,wm.SVG,e);case 2:return t=r.sent,r.abrupt("return",t.svg());case 4:case"end":return r.stop()}}),_callee,this)})))).apply(this,arguments)}var Nm,Bm,Um,zm,qm,Wm="RawCode",Gm="Literal",Hm="Property",Vm="Identifier",Ym="ArrayExpression",$m="BinaryExpression",Xm="CallExpression",Km="ConditionalExpression",Jm="LogicalExpression",Qm="MemberExpression",Zm="ObjectExpression",ev="UnaryExpression";function ASTNode(e){this.type=e}ASTNode.prototype.visit=function(e){var t,r,n;if(e(this))return 1;for(r=0,n=(t=function ast_children(e){switch(e.type){case Ym:return e.elements;case $m:case Jm:return[e.left,e.right];case Xm:var t=e.arguments.slice();return t.unshift(e.callee),t;case Km:return[e.test,e.consequent,e.alternate];case Qm:return[e.object,e.property];case Zm:return e.properties;case Hm:return[e.key,e.value];case ev:return[e.argument];case Vm:case Gm:case Wm:default:return[]}}(this)).length;r<n;++r)if(t[r].visit(e))return 1};var tv=1,rv=2,nv=3,iv=4,av=5,ov=6,sv=7,uv=8;(Nm={})[tv]="Boolean",Nm[rv]="<end>",Nm[nv]="Identifier",Nm[iv]="Keyword",Nm[av]="Null",Nm[ov]="Numeric",Nm[sv]="Punctuator",Nm[uv]="String",Nm[9]="RegularExpression";var lv="ArrayExpression",cv="BinaryExpression",fv="CallExpression",dv="ConditionalExpression",hv="Identifier",pv="Literal",gv="LogicalExpression",mv="MemberExpression",vv="ObjectExpression",yv="Property",_v="UnaryExpression",bv="Unexpected token %0",xv="Unexpected number",wv="Unexpected string",kv="Unexpected identifier",Sv="Unexpected reserved word",Ev="Unexpected end of input",Cv="Invalid regular expression",Tv="Invalid regular expression: missing /",Ov="Octal literals are not allowed in strict mode.",Av="Duplicate data property in object literal not allowed in strict mode",Rv="ILLEGAL",Dv="Disabled.",Pv=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),jv=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function assert(e,t){if(!e)throw new Error("ASSERT: "+t)}function isDecimalDigit(e){return e>=48&&e<=57}function isHexDigit(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function isOctalDigit(e){return"01234567".indexOf(e)>=0}function isWhiteSpace(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function isLineTerminator(e){return 10===e||13===e||8232===e||8233===e}function isIdentifierStart(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&Pv.test(String.fromCharCode(e))}function isIdentifierPart(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&jv.test(String.fromCharCode(e))}var Mv={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function skipComment(){for(var e;Um<zm&&(isWhiteSpace(e=Bm.charCodeAt(Um))||isLineTerminator(e));)++Um}function scanHexEscape(e){var t,r,n,i=0;for(r="u"===e?4:2,t=0;t<r;++t)Um<zm&&isHexDigit(Bm[Um])?(n=Bm[Um++],i=16*i+"0123456789abcdef".indexOf(n.toLowerCase())):throwError({},bv,Rv);return String.fromCharCode(i)}function scanUnicodeCodePointEscape(){var e,t,r,n;for(t=0,"}"===(e=Bm[Um])&&throwError({},bv,Rv);Um<zm&&isHexDigit(e=Bm[Um++]);)t=16*t+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||"}"!==e)&&throwError({},bv,Rv),t<=65535?String.fromCharCode(t):(r=55296+(t-65536>>10),n=56320+(t-65536&1023),String.fromCharCode(r,n))}function getEscapedIdentifier(){var e,t;for(e=Bm.charCodeAt(Um++),t=String.fromCharCode(e),92===e&&(117!==Bm.charCodeAt(Um)&&throwError({},bv,Rv),++Um,(e=scanHexEscape("u"))&&"\\"!==e&&isIdentifierStart(e.charCodeAt(0))||throwError({},bv,Rv),t=e);Um<zm&&isIdentifierPart(e=Bm.charCodeAt(Um));)++Um,t+=String.fromCharCode(e),92===e&&(t=t.substr(0,t.length-1),117!==Bm.charCodeAt(Um)&&throwError({},bv,Rv),++Um,(e=scanHexEscape("u"))&&"\\"!==e&&isIdentifierPart(e.charCodeAt(0))||throwError({},bv,Rv),t+=e);return t}function scanIdentifier(){var e,t;return e=Um,{type:1===(t=92===Bm.charCodeAt(Um)?getEscapedIdentifier():function getIdentifier(){var e,t;for(e=Um++;Um<zm;){if(92===(t=Bm.charCodeAt(Um)))return Um=e,getEscapedIdentifier();if(!isIdentifierPart(t))break;++Um}return Bm.slice(e,Um)}()).length?nv:Mv.hasOwnProperty(t)?iv:"null"===t?av:"true"===t||"false"===t?tv:nv,value:t,start:e,end:Um}}function scanPunctuator(){var e,t,r,n,i=Um,a=Bm.charCodeAt(Um),o=Bm[Um];switch(a){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++Um,{type:sv,value:String.fromCharCode(a),start:i,end:Um};default:if(61===(e=Bm.charCodeAt(Um+1)))switch(a){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return Um+=2,{type:sv,value:String.fromCharCode(a)+String.fromCharCode(e),start:i,end:Um};case 33:case 61:return Um+=2,61===Bm.charCodeAt(Um)&&++Um,{type:sv,value:Bm.slice(i,Um),start:i,end:Um}}}return">>>="===(n=Bm.substr(Um,4))?{type:sv,value:n,start:i,end:Um+=4}:">>>"===(r=n.substr(0,3))||"<<="===r||">>="===r?{type:sv,value:r,start:i,end:Um+=3}:o===(t=r.substr(0,2))[1]&&"+-<>&|".indexOf(o)>=0||"=>"===t?{type:sv,value:t,start:i,end:Um+=2}:"<>=!+-*%&|^/".indexOf(o)>=0?{type:sv,value:o,start:i,end:++Um}:void throwError({},bv,Rv)}function scanNumericLiteral(){var e,t,r;if(assert(isDecimalDigit((r=Bm[Um]).charCodeAt(0))||"."===r,"Numeric literal must start with a decimal digit or a decimal point"),t=Um,e="","."!==r){if(e=Bm[Um++],r=Bm[Um],"0"===e){if("x"===r||"X"===r)return++Um,function scanHexLiteral(e){for(var t="";Um<zm&&isHexDigit(Bm[Um]);)t+=Bm[Um++];return 0===t.length&&throwError({},bv,Rv),isIdentifierStart(Bm.charCodeAt(Um))&&throwError({},bv,Rv),{type:ov,value:parseInt("0x"+t,16),start:e,end:Um}}(t);if(isOctalDigit(r))return function scanOctalLiteral(e){for(var t="0"+Bm[Um++];Um<zm&&isOctalDigit(Bm[Um]);)t+=Bm[Um++];return(isIdentifierStart(Bm.charCodeAt(Um))||isDecimalDigit(Bm.charCodeAt(Um)))&&throwError({},bv,Rv),{type:ov,value:parseInt(t,8),octal:!0,start:e,end:Um}}(t);r&&isDecimalDigit(r.charCodeAt(0))&&throwError({},bv,Rv)}for(;isDecimalDigit(Bm.charCodeAt(Um));)e+=Bm[Um++];r=Bm[Um]}if("."===r){for(e+=Bm[Um++];isDecimalDigit(Bm.charCodeAt(Um));)e+=Bm[Um++];r=Bm[Um]}if("e"===r||"E"===r)if(e+=Bm[Um++],"+"!==(r=Bm[Um])&&"-"!==r||(e+=Bm[Um++]),isDecimalDigit(Bm.charCodeAt(Um)))for(;isDecimalDigit(Bm.charCodeAt(Um));)e+=Bm[Um++];else throwError({},bv,Rv);return isIdentifierStart(Bm.charCodeAt(Um))&&throwError({},bv,Rv),{type:ov,value:parseFloat(e),start:t,end:Um}}function scanRegExp(){var e,t,r,n;return qm=null,skipComment(),e=Um,t=function scanRegExpBody(){var e,t,r,n;for(assert("/"===(e=Bm[Um]),"Regular expression literal must start with a slash"),t=Bm[Um++],r=!1,n=!1;Um<zm;)if(t+=e=Bm[Um++],"\\"===e)isLineTerminator((e=Bm[Um++]).charCodeAt(0))&&throwError({},Tv),t+=e;else if(isLineTerminator(e.charCodeAt(0)))throwError({},Tv);else if(r)"]"===e&&(r=!1);else{if("/"===e){n=!0;break}"["===e&&(r=!0)}return n||throwError({},Tv),{value:t.substr(1,t.length-2),literal:t}}(),r=function scanRegExpFlags(){var e,t,r;for(t="",r="";Um<zm&&isIdentifierPart((e=Bm[Um]).charCodeAt(0));)++Um,"\\"===e&&Um<zm?throwError({},bv,Rv):(r+=e,t+=e);return r.search(/[^gimuy]/g)>=0&&throwError({},Cv,r),{value:r,literal:t}}(),n=function testRegExp(e,t){var r=e;t.indexOf("u")>=0&&(r=r.replace(/\\u\{([0-9a-fA-F]+)\}/g,(function(e,t){if(parseInt(t,16)<=1114111)return"x";throwError({},Cv)})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(r)}catch(n){throwError({},Cv)}try{return new RegExp(e,t)}catch(i){return null}}(t.value,r.value),{literal:t.literal+r.literal,value:n,regex:{pattern:t.value,flags:r.value},start:e,end:Um}}function advance(){var e;return skipComment(),Um>=zm?{type:rv,start:Um,end:Um}:isIdentifierStart(e=Bm.charCodeAt(Um))?scanIdentifier():40===e||41===e||59===e?scanPunctuator():39===e||34===e?function scanStringLiteral(){var e,t,r,n,i="",a=!1;for(assert("'"===(e=Bm[Um])||'"'===e,"String literal must starts with a quote"),t=Um,++Um;Um<zm;){if((r=Bm[Um++])===e){e="";break}if("\\"===r)if((r=Bm[Um++])&&isLineTerminator(r.charCodeAt(0)))"\r"===r&&"\n"===Bm[Um]&&++Um;else switch(r){case"u":case"x":"{"===Bm[Um]?(++Um,i+=scanUnicodeCodePointEscape()):i+=scanHexEscape(r);break;case"n":i+="\n";break;case"r":i+="\r";break;case"t":i+="\t";break;case"b":i+="\b";break;case"f":i+="\f";break;case"v":i+="\v";break;default:isOctalDigit(r)?(0!==(n="01234567".indexOf(r))&&(a=!0),Um<zm&&isOctalDigit(Bm[Um])&&(a=!0,n=8*n+"01234567".indexOf(Bm[Um++]),"0123".indexOf(r)>=0&&Um<zm&&isOctalDigit(Bm[Um])&&(n=8*n+"01234567".indexOf(Bm[Um++]))),i+=String.fromCharCode(n)):i+=r}else{if(isLineTerminator(r.charCodeAt(0)))break;i+=r}}return""!==e&&throwError({},bv,Rv),{type:uv,value:i,octal:a,start:t,end:Um}}():46===e?isDecimalDigit(Bm.charCodeAt(Um+1))?scanNumericLiteral():scanPunctuator():isDecimalDigit(e)?scanNumericLiteral():scanPunctuator()}function lex(){var e;return Um=(e=qm).end,qm=advance(),Um=e.end,e}function peek(){var e;e=Um,qm=advance(),Um=e}function finishBinaryExpression(e,t,r){var n=new ASTNode("||"===e||"&&"===e?gv:cv);return n.operator=e,n.left=t,n.right=r,n}function finishCallExpression(e,t){var r=new ASTNode(fv);return r.callee=e,r.arguments=t,r}function finishIdentifier(e){var t=new ASTNode(hv);return t.name=e,t}function finishLiteral(e){var t=new ASTNode(pv);return t.value=e.value,t.raw=Bm.slice(e.start,e.end),e.regex&&("//"===t.raw&&(t.raw="/(?:)/"),t.regex=e.regex),t}function finishMemberExpression(e,t,r){var n=new ASTNode(mv);return n.computed="["===e,n.object=t,n.property=r,n.computed||(r.member=!0),n}function finishProperty(e,t,r){var n=new ASTNode(yv);return n.key=t,n.value=r,n.kind=e,n}function throwError(e,t){var r,n=Array.prototype.slice.call(arguments,2),i=t.replace(/%(\d)/g,(function(e,t){return assert(t<n.length,"Message reference must be in range"),n[t]}));throw(r=new Error(i)).index=Um,r.description=i,r}function throwUnexpected(e){e.type===rv&&throwError(e,Ev),e.type===ov&&throwError(e,xv),e.type===uv&&throwError(e,wv),e.type===nv&&throwError(e,kv),e.type===iv&&throwError(e,Sv),throwError(e,bv,e.value)}function expect(e){var t=lex();t.type===sv&&t.value===e||throwUnexpected(t)}function parser_match(e){return qm.type===sv&&qm.value===e}function matchKeyword(e){return qm.type===iv&&qm.value===e}function parseArrayInitialiser(){var e=[];for(Um=qm.start,expect("[");!parser_match("]");)parser_match(",")?(lex(),e.push(null)):(e.push(parseConditionalExpression()),parser_match("]")||expect(","));return lex(),function finishArrayExpression(e){var t=new ASTNode(lv);return t.elements=e,t}(e)}function parseObjectPropertyKey(){var e;return Um=qm.start,(e=lex()).type===uv||e.type===ov?(e.octal&&throwError(e,Ov),finishLiteral(e)):finishIdentifier(e.value)}function parseObjectProperty(){var e,t,r;return Um=qm.start,(e=qm).type===nv?(r=parseObjectPropertyKey(),expect(":"),finishProperty("init",r,parseConditionalExpression())):e.type!==rv&&e.type!==sv?(t=parseObjectPropertyKey(),expect(":"),finishProperty("init",t,parseConditionalExpression())):void throwUnexpected(e)}function parseObjectInitialiser(){var e,t,r=[],n={},i=String;for(Um=qm.start,expect("{");!parser_match("}");)t="$"+((e=parseObjectProperty()).key.type===hv?e.key.name:i(e.key.value)),Object.prototype.hasOwnProperty.call(n,t)?throwError({},Av):n[t]=!0,r.push(e),parser_match("}")||expect(",");return expect("}"),function finishObjectExpression(e){var t=new ASTNode(vv);return t.properties=e,t}(r)}var Fv={if:1,this:1};function parsePrimaryExpression(){var e,t,r;if(parser_match("("))return function parseGroupExpression(){var e;return expect("("),e=parseExpression(),expect(")"),e}();if(parser_match("["))return parseArrayInitialiser();if(parser_match("{"))return parseObjectInitialiser();if(e=qm.type,Um=qm.start,e===nv||Fv[qm.value])r=finishIdentifier(lex().value);else if(e===uv||e===ov)qm.octal&&throwError(qm,Ov),r=finishLiteral(lex());else{if(e===iv)throw new Error(Dv);e===tv?((t=lex()).value="true"===t.value,r=finishLiteral(t)):e===av?((t=lex()).value=null,r=finishLiteral(t)):parser_match("/")||parser_match("/=")?(r=finishLiteral(scanRegExp()),peek()):throwUnexpected(lex())}return r}function parseArguments(){var e=[];if(expect("("),!parser_match(")"))for(;Um<zm&&(e.push(parseConditionalExpression()),!parser_match(")"));)expect(",");return expect(")"),e}function parseNonComputedProperty(){var e;return Um=qm.start,function isIdentifierName(e){return e.type===nv||e.type===iv||e.type===tv||e.type===av}(e=lex())||throwUnexpected(e),finishIdentifier(e.value)}function parseComputedMember(){var e;return expect("["),e=parseExpression(),expect("]"),e}function parsePostfixExpression(){var e=function parseLeftHandSideExpressionAllowCall(){var e;for(e=parsePrimaryExpression();;)if(parser_match("."))expect("."),e=finishMemberExpression(".",e,parseNonComputedProperty());else if(parser_match("("))e=finishCallExpression(e,parseArguments());else{if(!parser_match("["))break;e=finishMemberExpression("[",e,parseComputedMember())}return e}();if(qm.type===sv&&(parser_match("++")||parser_match("--")))throw new Error(Dv);return e}function parseUnaryExpression(){var e,t;if(qm.type!==sv&&qm.type!==iv)t=parsePostfixExpression();else{if(parser_match("++")||parser_match("--"))throw new Error(Dv);if(parser_match("+")||parser_match("-")||parser_match("~")||parser_match("!"))e=lex(),t=parseUnaryExpression(),t=function finishUnaryExpression(e,t){var r=new ASTNode(_v);return r.operator=e,r.argument=t,r.prefix=!0,r}(e.value,t);else{if(matchKeyword("delete")||matchKeyword("void")||matchKeyword("typeof"))throw new Error(Dv);t=parsePostfixExpression()}}return t}function binaryPrecedence(e){var t=0;if(e.type!==sv&&e.type!==iv)return 0;switch(e.value){case"||":t=1;break;case"&&":t=2;break;case"|":t=3;break;case"^":t=4;break;case"&":t=5;break;case"==":case"!=":case"===":case"!==":t=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11}return t}function parseConditionalExpression(){var e,t;return e=function parseBinaryExpression(){var e,t,r,n,i,a,o,s,u,l;if(e=qm,u=parseUnaryExpression(),0===(i=binaryPrecedence(n=qm)))return u;for(n.prec=i,lex(),t=[e,qm],a=[u,n,o=parseUnaryExpression()];(i=binaryPrecedence(qm))>0;){for(;a.length>2&&i<=a[a.length-2].prec;)o=a.pop(),s=a.pop().value,u=a.pop(),t.pop(),r=finishBinaryExpression(s,u,o),a.push(r);(n=lex()).prec=i,a.push(n),t.push(qm),r=parseUnaryExpression(),a.push(r)}for(r=a[l=a.length-1],t.pop();l>1;)t.pop(),r=finishBinaryExpression(a[l-1].value,a[l-2],r),l-=2;return r}(),parser_match("?")&&(lex(),t=parseConditionalExpression(),expect(":"),e=function finishConditionalExpression(e,t,r){var n=new ASTNode(dv);return n.test=e,n.consequent=t,n.alternate=r,n}(e,t,parseConditionalExpression())),e}function parseExpression(){var e=parseConditionalExpression();if(parser_match(","))throw new Error(Dv);return e}var Iv=function(e){Um=0,zm=(Bm=e).length,qm=null,peek();var t=parseExpression();if(qm.type!==rv)throw new Error("Unexpect token after expression.");return t},Lv={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"},Nv=function(e){function fn(t,r,n){return function(i){return function fncall(t,r,n,i){var a=e(r[0]);return n&&(a=n+"("+a+")",0===n.lastIndexOf("new ",0)&&(a="("+a+")")),a+"."+t+(i<0?"":0===i?"()":"("+r.slice(1).map(e).join(",")+")")}(t,i,r,n)}}var t="new Date";return{isNaN:"isNaN",isFinite:"isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function clamp(t){t.length<3&&Object(V.n)("Missing arguments to clamp function."),t.length>3&&Object(V.n)("Too many arguments to clamp function.");var r=t.map(e);return"Math.max("+r[1]+", Math.min("+r[2]+","+r[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:t,date:fn("getDate",t,0),day:fn("getDay",t,0),year:fn("getFullYear",t,0),month:fn("getMonth",t,0),hours:fn("getHours",t,0),minutes:fn("getMinutes",t,0),seconds:fn("getSeconds",t,0),milliseconds:fn("getMilliseconds",t,0),time:fn("getTime",t,0),timezoneoffset:fn("getTimezoneOffset",t,0),utcdate:fn("getUTCDate",t,0),utcday:fn("getUTCDay",t,0),utcyear:fn("getUTCFullYear",t,0),utcmonth:fn("getUTCMonth",t,0),utchours:fn("getUTCHours",t,0),utcminutes:fn("getUTCMinutes",t,0),utcseconds:fn("getUTCSeconds",t,0),utcmilliseconds:fn("getUTCMilliseconds",t,0),length:fn("length",null,-1),join:fn("join",null),indexof:fn("indexOf",null),lastindexof:fn("lastIndexOf",null),slice:fn("slice",null),reverse:function reverse(t){return"("+e(t[0])+").slice().reverse()"},parseFloat:"parseFloat",parseInt:"parseInt",upper:fn("toUpperCase","String",0),lower:fn("toLowerCase","String",0),substring:fn("substring","String"),split:fn("split","String"),replace:fn("replace","String"),trim:fn("trim","String",0),regexp:"RegExp",test:fn("test","RegExp"),if:function _if(t){t.length<3&&Object(V.n)("Missing arguments to if function."),t.length>3&&Object(V.n)("Too many arguments to if function.");var r=t.map(e);return"("+r[0]+"?"+r[1]+":"+r[2]+")"}}};var Bv="intersect",Uv="union",zv="E",qv="R",Wv="R-E",Gv="R-LE",Hv="R-RE",Vv="index:unit";function testPoint(e,t){for(var r,n,i=t.fields,a=t.values,o=i.length,s=0;s<o;++s)if((n=i[s]).getter=V.t.getter||Object(V.t)(n.field),r=n.getter(e),Object(V.C)(r)&&(r=Object(V.ab)(r)),Object(V.C)(a[s])&&(a[s]=Object(V.ab)(a[s])),Object(V.C)(a[s][0])&&(a[s]=a[s].map(V.ab)),n.type===zv){if(Object(V.A)(a[s])?a[s].indexOf(r)<0:r!==a[s])return!1}else if(n.type===qv){if(!Object(V.z)(r,a[s]))return!1}else if(n.type===Hv){if(!Object(V.z)(r,a[s],!0,!1))return!1}else if(n.type===Wv){if(!Object(V.z)(r,a[s],!1,!1))return!1}else if(n.type===Gv&&!Object(V.z)(r,a[s],!1,!0))return!1;return!0}var Yv={E_union:function E_union(e,t){if(!e.length)return t;for(var r=0,n=t.length;r<n;++r)e.indexOf(t[r])<0&&e.push(t[r]);return e},E_intersect:function E_intersect(e,t){return e.length?e.filter((function(e){return t.indexOf(e)>=0})):t},R_union:function R_union(e,t){var r=Object(V.ab)(t[0]),n=Object(V.ab)(t[1]);return r>n&&(r=t[1],n=t[0]),e.length?(e[0]>r&&(e[0]=r),e[1]<n&&(e[1]=n),e):[r,n]},R_intersect:function R_intersect(e,t){var r=Object(V.ab)(t[0]),n=Object(V.ab)(t[1]);return r>n&&(r=t[1],n=t[0]),e.length?n<e[0]||e[1]<r?[]:(e[0]<r&&(e[0]=r),e[1]>n&&(e[1]=n),e):[r,n]}},$v=":",Xv="@";function selectionVisitor(e,t,r,n){t[0].type!==Gm&&Object(V.n)("First argument to selection functions must be a string literal.");var i=t[0].value,a=t.length>=2&&Object(V.S)(t).value,o=Xv+"unit",s=$v+i;a!==Bv||Object(V.v)(n,o)||(n[o]=r.getData(i).indataRef(r,"unit")),Object(V.v)(n,s)||(n[s]=r.getData(i).tuplesRef())}function src_data_data(e){var t=this.context.data[e];return t?t.values.value:[]}var Kv={};function formatter(e,t,r){var n=e+":"+r,i=Kv[n];return i&&i[0]===t||(Kv[n]=i=[t,t(r)]),i[1]}function format_timeFormat(e,t){return formatter("timeFormat",tt,t)(e)}var Jv=new Date(2e3,0,1);function format_time(e,t,r){return Number.isInteger(e)&&Number.isInteger(t)?(Jv.setMonth(e),Jv.setDate(t),format_timeFormat(Jv,r)):""}function getScale(e,t){var r;return Object(V.D)(e)?e:Object(V.H)(e)?(r=t.scales[e])&&r.value:void 0}function geoMethod(e,t){return function(r,n,i){if(r){var a=getScale(r,(i||this).context);return a&&a.path[e](n)}return t(n)}}var Qv=geoMethod("area",(function(e){return Sl.reset(),wl(e,El),2*Sl})),Zv=geoMethod("bounds",(function(e){var t,r,n,i,a,o,s;if(Al=Ol=-(Cl=Tl=1/0),Ml=[],wl(e,Ll),r=Ml.length){for(Ml.sort(rangeCompare),t=1,a=[n=Ml[0]];t<r;++t)rangeContains(n,(i=Ml[t])[0])||rangeContains(n,i[1])?(bounds_angle(n[0],i[1])>bounds_angle(n[0],n[1])&&(n[1]=i[1]),bounds_angle(i[0],n[1])>bounds_angle(n[0],n[1])&&(n[0]=i[0])):a.push(n=i);for(o=-1/0,t=0,n=a[r=a.length-1];t<=r;n=i,++t)i=a[t],(s=bounds_angle(n[1],i[0]))>o&&(o=s,Cl=i[0],Ol=n[1])}return Ml=Fl=null,Cl===1/0||Tl===1/0?[[NaN,NaN],[NaN,NaN]]:[[Cl,Tl],[Ol,Al]]})),ey=geoMethod("centroid",(function(e){Nl=Bl=Ul=zl=ql=Wl=Gl=Hl=Vl=Yl=$l=0,wl(e,ec);var t=Vl,r=Yl,n=$l,i=t*t+r*r+n*n;return i<Ku&&(t=Wl,r=Gl,n=Hl,Bl<Xu&&(t=Ul,r=zl,n=ql),(i=t*t+r*r+n*n)<Ku)?[NaN,NaN]:[al(r,t)*tl,math_asin(n/hl(i))*tl]}));function vega_scenegraph_src_Bounds_Bounds(e){this.clear(),e&&this.union(e)}var ty=vega_scenegraph_src_Bounds_Bounds.prototype;ty.clone=function(){return new vega_scenegraph_src_Bounds_Bounds(this)},ty.clear=function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},ty.empty=function(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},ty.equals=function(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},ty.set=function(e,t,r,n){return r<e?(this.x2=e,this.x1=r):(this.x1=e,this.x2=r),n<t?(this.y2=t,this.y1=n):(this.y1=t,this.y2=n),this},ty.add=function(e,t){return e<this.x1&&(this.x1=e),t<this.y1&&(this.y1=t),e>this.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},ty.expand=function(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},ty.round=function(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},ty.translate=function(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},ty.rotate=function(e,t,r){var n=this.rotatedPoints(e,t,r);return this.clear().add(n[0],n[1]).add(n[2],n[3]).add(n[4],n[5]).add(n[6],n[7])},ty.rotatedPoints=function(e,t,r){var n=this.x1,i=this.y1,a=this.x2,o=this.y2,s=Math.cos(e),u=Math.sin(e),l=t-t*s+r*u,c=r-t*u-r*s;return[s*n-u*i+l,u*n+s*i+c,s*n-u*o+l,u*n+s*o+c,s*a-u*i+l,u*a+s*i+c,s*a-u*o+l,u*a+s*o+c]},ty.union=function(e){return e.x1<this.x1&&(this.x1=e.x1),e.y1<this.y1&&(this.y1=e.y1),e.x2>this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},ty.intersect=function(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2<this.x2&&(this.x2=e.x2),e.y2<this.y2&&(this.y2=e.y2),this},ty.encloses=function(e){return e&&this.x1<=e.x1&&this.x2>=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},ty.alignsWith=function(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},ty.intersects=function(e){return e&&!(this.x2<e.x1||this.x1>e.x2||this.y2<e.y1||this.y1>e.y2)},ty.contains=function(e,t){return!(e<this.x1||e>this.x2||t<this.y1||t>this.y2)},ty.width=function(){return this.x2-this.x1},ty.height=function(){return this.y2-this.y1};var ry=0,ny="p_";function vega_scenegraph_src_Gradient_isGradient(e){return e&&e.gradient}function vega_scenegraph_src_Gradient_gradientRef(e,t,r){var n=e.id,i=e.gradient,a="radial"===i?ny:"";return n||(n=e.id="gradient_"+ry++,"radial"===i?(e.x1=node_modules_vega_scenegraph_src_Gradient_get(e.x1,.5),e.y1=node_modules_vega_scenegraph_src_Gradient_get(e.y1,.5),e.r1=node_modules_vega_scenegraph_src_Gradient_get(e.r1,0),e.x2=node_modules_vega_scenegraph_src_Gradient_get(e.x2,.5),e.y2=node_modules_vega_scenegraph_src_Gradient_get(e.y2,.5),e.r2=node_modules_vega_scenegraph_src_Gradient_get(e.r2,.5),a=ny):(e.x1=node_modules_vega_scenegraph_src_Gradient_get(e.x1,0),e.y1=node_modules_vega_scenegraph_src_Gradient_get(e.y1,0),e.x2=node_modules_vega_scenegraph_src_Gradient_get(e.x2,1),e.y2=node_modules_vega_scenegraph_src_Gradient_get(e.y2,0))),t[n]=e,"url("+(r||"")+"#"+a+n+")"}function node_modules_vega_scenegraph_src_Gradient_get(e,t){return null!=e?e:t}function vega_scenegraph_src_Item_Item(e){this.mark=e,this.bounds=this.bounds||new vega_scenegraph_src_Bounds_Bounds}function vega_scenegraph_src_GroupItem_GroupItem(e){vega_scenegraph_src_Item_Item.call(this,e),this.items=this.items||[]}Object(V.y)(vega_scenegraph_src_GroupItem_GroupItem,vega_scenegraph_src_Item_Item);var iy=/^([A-Za-z]+:)?\/\//,ay=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,oy=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,sy="file://";function vega_functions_node_modules_vega_loader_src_loader_load(e,t){return node_modules_vega_functions_node_modules_vega_loader_src_loader_load.apply(this,arguments)}function node_modules_vega_functions_node_modules_vega_loader_src_loader_load(){return(node_modules_vega_functions_node_modules_vega_loader_src_loader_load=Object(Y.a)(A.a.mark((function _callee2(e,t){var r,n;return A.a.wrap((function _callee2$(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,this.sanitize(e,t);case 2:return r=i.sent,n=r.href,i.abrupt("return",r.localFile?this.file(n):this.http(n,t));case 5:case"end":return i.stop()}}),_callee2,this)})))).apply(this,arguments)}function vega_functions_node_modules_vega_loader_src_loader_sanitize(e,t){return node_modules_vega_functions_node_modules_vega_loader_src_loader_sanitize.apply(this,arguments)}function node_modules_vega_functions_node_modules_vega_loader_src_loader_sanitize(){return(node_modules_vega_functions_node_modules_vega_loader_src_loader_sanitize=Object(Y.a)(A.a.mark((function _callee3(e,t){var r,n,i,a,o,s,u;return A.a.wrap((function _callee3$(l){for(;;)switch(l.prev=l.next){case 0:return t=Object(V.o)({},this.options,t),r=this.fileAccess,n={href:null},s=ay.test(e.replace(oy,"")),null!=e&&"string"===typeof e&&s||Object(V.n)("Sanitize failure, invalid URI: "+Object(V.X)(e)),u=iy.test(e),(o=t.baseURL)&&!u&&(e.startsWith("/")||"/"===o[o.length-1]||(e="/"+e),e=o+e),a=(i=e.startsWith(sy))||"file"===t.mode||"http"!==t.mode&&!u&&r,i?e=e.slice(sy.length):e.startsWith("//")&&("file"===t.defaultProtocol?(e=e.slice(2),a=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(n,"localFile",{value:!!a}),n.href=e,t.target&&(n.target=t.target+""),t.rel&&(n.rel=t.rel+""),l.abrupt("return",n);case 13:case"end":return l.stop()}}),_callee3,this)})))).apply(this,arguments)}function node_modules_vega_loader_src_loader_fileLoader(e){return e?function(t){return new Promise((function(r,n){e.readFile(t,(function(e,t){e?n(e):r(t)}))}))}:vega_functions_node_modules_vega_loader_src_loader_fileReject}function vega_functions_node_modules_vega_loader_src_loader_fileReject(){return node_modules_vega_functions_node_modules_vega_loader_src_loader_fileReject.apply(this,arguments)}function node_modules_vega_functions_node_modules_vega_loader_src_loader_fileReject(){return(node_modules_vega_functions_node_modules_vega_loader_src_loader_fileReject=Object(Y.a)(A.a.mark((function _callee4(){return A.a.wrap((function _callee4$(e){for(;;)switch(e.prev=e.next){case 0:Object(V.n)("No file system access.");case 1:case"end":return e.stop()}}),_callee4)})))).apply(this,arguments)}function node_modules_vega_loader_src_loader_httpLoader(e){return e?function(){var t=Object(Y.a)(A.a.mark((function _callee(t,r){var n,i,a;return A.a.wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:return n=Object(V.o)({},this.options.http,r),i=r&&r.response,o.next=4,e(t,n);case 4:return a=o.sent,o.abrupt("return",a.ok?Object(V.D)(a[i])?a[i]():a.text():Object(V.n)(a.status+""+a.statusText));case 6:case"end":return o.stop()}}),_callee,this)})));return function(e,r){return t.apply(this,arguments)}}():vega_functions_node_modules_vega_loader_src_loader_httpReject}function vega_functions_node_modules_vega_loader_src_loader_httpReject(){return node_modules_vega_functions_node_modules_vega_loader_src_loader_httpReject.apply(this,arguments)}function node_modules_vega_functions_node_modules_vega_loader_src_loader_httpReject(){return(node_modules_vega_functions_node_modules_vega_loader_src_loader_httpReject=Object(Y.a)(A.a.mark((function _callee5(){return A.a.wrap((function _callee5$(e){for(;;)switch(e.prev=e.next){case 0:Object(V.n)("No HTTP fetch method available.");case 1:case"end":return e.stop()}}),_callee5)})))).apply(this,arguments)}V.Y,V.ab,V.ab,V.Z,V.cb,V.x;function vega_loader_src_formats_dsv_delimitedFormat(e){var t=function parse(t,r){var n={delimiter:e};return node_modules_vega_loader_src_formats_dsv_dsv(t,r?Object(V.o)(r,n):n)};return t.responseType="text",t}function node_modules_vega_loader_src_formats_dsv_dsv(e,t){return t.header&&(e=t.header.map(V.X).join(t.delimiter)+"\n"+e),me(t.delimiter).parse(e+"")}node_modules_vega_loader_src_formats_dsv_dsv.responseType="text";var uy=r(91),ly={interior:function interior(e,t){return e!==t},exterior:function exterior(e,t){return e===t}};function vega_loader_src_formats_topojson_topojson(e,t){var r,n,i,a;return e=Object(uy.a)(e,t),t&&t.feature?(r=ke,i=t.feature):t&&t.mesh?(r=Ee,i=t.mesh,a=ly[t.filter]):Object(V.n)("Missing TopoJSON feature or mesh parameter."),(n=(n=e.objects[i])?r(e,n,a):Object(V.n)("Invalid TopoJSON object: "+i))&&n.features||[n]}vega_loader_src_formats_topojson_topojson.responseType="json";vega_loader_src_formats_dsv_delimitedFormat(","),vega_loader_src_formats_dsv_delimitedFormat("\t"),uy.a;var cy=function(e,t){return function(r){return{options:r||{},sanitize:vega_functions_node_modules_vega_loader_src_loader_sanitize,load:vega_functions_node_modules_vega_loader_src_loader_load,fileAccess:!!t,file:node_modules_vega_loader_src_loader_fileLoader(t),http:node_modules_vega_loader_src_loader_httpLoader(e)}}}("undefined"!==typeof fetch&&fetch,null);function vega_scenegraph_src_ResourceLoader_ResourceLoader(e){this._pending=0,this._loader=e||cy()}var fy=vega_scenegraph_src_ResourceLoader_ResourceLoader.prototype;function vega_scenegraph_src_ResourceLoader_increment(e){e._pending+=1}function vega_scenegraph_src_ResourceLoader_decrement(e){e._pending-=1}fy.pending=function(){return this._pending},fy.sanitizeURL=function(e){var t=this;return vega_scenegraph_src_ResourceLoader_increment(t),t._loader.sanitize(e,{context:"href"}).then((function(e){return vega_scenegraph_src_ResourceLoader_decrement(t),e})).catch((function(){return vega_scenegraph_src_ResourceLoader_decrement(t),null}))},fy.loadImage=function(e){var t=this,r=domImage();return vega_scenegraph_src_ResourceLoader_increment(t),t._loader.sanitize(e,{context:"image"}).then((function(e){var n=e.href;if(!n||!r)throw{url:n};var i=new r;return i.onload=function(){vega_scenegraph_src_ResourceLoader_decrement(t),i.loaded=!0},i.onerror=function(){vega_scenegraph_src_ResourceLoader_decrement(t),i.loaded=!1},i.src=n,i})).catch((function(e){return vega_scenegraph_src_ResourceLoader_decrement(t),{loaded:!1,width:0,height:0,src:e&&e.url||""}}))},fy.ready=function(){var e=this;return new Promise((function(t){!function poll(r){e.pending()?setTimeout((function(){poll(!0)}),10):t(r)}(!1)}))};var dy={basis:{curve:Bn},"basis-closed":{curve:Un},"basis-open":{curve:zn},bundle:{curve:qn,tension:"beta",value:.85},cardinal:{curve:Wn,tension:"tension",value:0},"cardinal-open":{curve:Hn,tension:"tension",value:0},"cardinal-closed":{curve:Gn,tension:"tension",value:0},"catmull-rom":{curve:Vn,tension:"alpha",value:.5},"catmull-rom-closed":{curve:Yn,tension:"alpha",value:.5},"catmull-rom-open":{curve:$n,tension:"alpha",value:.5},linear:{curve:Pn},"linear-closed":{curve:Xn},monotone:{horizontal:monotoneY,vertical:monotoneX},natural:{curve:Kn},step:{curve:Jn},"step-after":{curve:stepAfter},"step-before":{curve:stepBefore}};function src_path_curves_curves(e,t,r){var n=Object(V.v)(dy,e)&&dy[e],i=null;return n&&(i=n.curve||n[t||"vertical"],n.tension&&null!=r&&(i=i[n.tension](r))),i}var hy={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},py=[/([MLHVCSQTAZmlhvcsqtaz])/g,/###/,/(\d)([-+])/g,/\s|,|###/],gy=function(e){var t,r,n,i,a,o,s,u,l,c,f,d=[];for(u=0,c=(t=e.slice().replace(py[0],"###$1").split(py[1]).slice(1)).length;u<c;++u){for(n=(r=t[u]).slice(1).trim().replace(py[2],"$1###$2").split(py[3]),i=[o=r.charAt(0)],l=0,f=n.length;l<f;++l)(a=+n[l])===a&&i.push(a);if(s=hy[o.toLowerCase()],i.length-1>s)for(l=1,f=i.length;l<f;l+=s)d.push([o].concat(i.slice(l,l+s)));else d.push(i)}return d},my=Math.PI/180,vy=Math.PI/2,yy=2*Math.PI,_y=Math.sqrt(3)/2,by={},wy={},ky=[].join;function src_path_arc_bezier(e){var t=ky.call(e);if(wy[t])return wy[t];var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],c=l*o,f=-u*s,d=u*o,h=l*s,p=Math.cos(i),g=Math.sin(i),m=Math.cos(a),v=Math.sin(a),y=.5*(a-i),_=Math.sin(.5*y),b=8/3*_*_/Math.sin(y),x=r+p-b*g,w=n+g+b*p,k=r+m,S=n+v,E=k+b*v,C=S-b*m;return wy[t]=[c*x+f*w,d*x+h*w,c*E+f*C,d*E+h*C,c*k+f*S,d*k+h*S]}var Sy=["l",0,0,0,0,0,0,0];function vega_scenegraph_src_path_render_scale(e,t){var r=Sy[0]=e[0];if("a"===r||"A"===r)Sy[1]=t*e[1],Sy[2]=t*e[2],Sy[3]=e[3],Sy[4]=e[4],Sy[5]=e[5],Sy[6]=t*e[6],Sy[7]=t*e[7];else for(var n=1,i=e.length;n<i;++n)Sy[n]=t*e[n];return Sy}var Ey=function(e,t,r,n,i){var a,o,s,u,l,c=null,f=0,d=0,h=0,p=0;null==r&&(r=0),null==n&&(n=0),null==i&&(i=1),e.beginPath&&e.beginPath();for(var g=0,m=t.length;g<m;++g){switch(a=t[g],1!==i&&(a=vega_scenegraph_src_path_render_scale(a,i)),a[0]){case"l":f+=a[1],d+=a[2],e.lineTo(f+r,d+n);break;case"L":f=a[1],d=a[2],e.lineTo(f+r,d+n);break;case"h":f+=a[1],e.lineTo(f+r,d+n);break;case"H":f=a[1],e.lineTo(f+r,d+n);break;case"v":d+=a[1],e.lineTo(f+r,d+n);break;case"V":d=a[1],e.lineTo(f+r,d+n);break;case"m":f+=a[1],d+=a[2],e.moveTo(f+r,d+n);break;case"M":f=a[1],d=a[2],e.moveTo(f+r,d+n);break;case"c":o=f+a[5],s=d+a[6],h=f+a[3],p=d+a[4],e.bezierCurveTo(f+a[1]+r,d+a[2]+n,h+r,p+n,o+r,s+n),f=o,d=s;break;case"C":f=a[5],d=a[6],h=a[3],p=a[4],e.bezierCurveTo(a[1]+r,a[2]+n,h+r,p+n,f+r,d+n);break;case"s":o=f+a[3],s=d+a[4],h=2*f-h,p=2*d-p,e.bezierCurveTo(h+r,p+n,f+a[1]+r,d+a[2]+n,o+r,s+n),h=f+a[1],p=d+a[2],f=o,d=s;break;case"S":o=a[3],s=a[4],h=2*f-h,p=2*d-p,e.bezierCurveTo(h+r,p+n,a[1]+r,a[2]+n,o+r,s+n),f=o,d=s,h=a[1],p=a[2];break;case"q":o=f+a[3],s=d+a[4],h=f+a[1],p=d+a[2],e.quadraticCurveTo(h+r,p+n,o+r,s+n),f=o,d=s;break;case"Q":o=a[3],s=a[4],e.quadraticCurveTo(a[1]+r,a[2]+n,o+r,s+n),f=o,d=s,h=a[1],p=a[2];break;case"t":o=f+a[1],s=d+a[2],null===c[0].match(/[QqTt]/)?(h=f,p=d):"t"===c[0]?(h=2*f-u,p=2*d-l):"q"===c[0]&&(h=2*f-h,p=2*d-p),u=h,l=p,e.quadraticCurveTo(h+r,p+n,o+r,s+n),d=s,h=(f=o)+a[1],p=d+a[2];break;case"T":o=a[1],s=a[2],h=2*f-h,p=2*d-p,e.quadraticCurveTo(h+r,p+n,o+r,s+n),f=o,d=s;break;case"a":src_path_render_drawArc(e,f+r,d+n,[a[1],a[2],a[3],a[4],a[5],a[6]+f+r,a[7]+d+n]),f+=a[6],d+=a[7];break;case"A":src_path_render_drawArc(e,f+r,d+n,[a[1],a[2],a[3],a[4],a[5],a[6]+r,a[7]+n]),f=a[6],d=a[7];break;case"z":case"Z":e.closePath()}c=a}};function src_path_render_drawArc(e,t,r,n){for(var i=function vega_scenegraph_src_path_arc_segments(e,t,r,n,i,a,o,s,u){var l=ky.call(arguments);if(by[l])return by[l];var c=o*my,f=Math.sin(c),d=Math.cos(c),h=d*(s-e)*.5+f*(u-t)*.5,p=d*(u-t)*.5-f*(s-e)*.5,g=h*h/((r=Math.abs(r))*r)+p*p/((n=Math.abs(n))*n);g>1&&(r*=g=Math.sqrt(g),n*=g);var m=d/r,v=f/r,y=-f/n,_=d/n,b=m*s+v*u,x=y*s+_*u,w=m*e+v*t,k=y*e+_*t,S=1/((w-b)*(w-b)+(k-x)*(k-x))-.25;S<0&&(S=0);var E=Math.sqrt(S);a==i&&(E=-E);var C=.5*(b+w)-E*(k-x),T=.5*(x+k)+E*(w-b),O=Math.atan2(x-T,b-C),A=Math.atan2(k-T,w-C)-O;A<0&&1===a?A+=yy:A>0&&0===a&&(A-=yy);for(var R=Math.ceil(Math.abs(A/(vy+.001))),D=[],P=0;P<R;++P){var j=O+P*A/R,M=O+(P+1)*A/R;D[P]=[C,T,j,M,r,n,f,d]}return by[l]=D}(n[5],n[6],n[0],n[1],n[3],n[4],n[2],t,r),a=0;a<i.length;++a){var o=src_path_arc_bezier(i[a]);e.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5])}}var Cy={circle:{draw:function draw(e,t){var r=Math.sqrt(t)/2;e.moveTo(r,0),e.arc(0,0,r,0,yy)}},cross:{draw:function draw(e,t){var r=Math.sqrt(t)/2,n=r/2.5;e.moveTo(-r,-n),e.lineTo(-r,n),e.lineTo(-n,n),e.lineTo(-n,r),e.lineTo(n,r),e.lineTo(n,n),e.lineTo(r,n),e.lineTo(r,-n),e.lineTo(n,-n),e.lineTo(n,-r),e.lineTo(-n,-r),e.lineTo(-n,-n),e.closePath()}},diamond:{draw:function draw(e,t){var r=Math.sqrt(t)/2;e.moveTo(-r,0),e.lineTo(0,-r),e.lineTo(r,0),e.lineTo(0,r),e.closePath()}},square:{draw:function draw(e,t){var r=Math.sqrt(t),n=-r/2;e.rect(n,n,r,r)}},arrow:{draw:function draw(e,t){var r=Math.sqrt(t)/2,n=r/7,i=r/2.5,a=r/8;e.moveTo(-n,r),e.lineTo(n,r),e.lineTo(n,-a),e.lineTo(i,-a),e.lineTo(0,-r),e.lineTo(-i,-a),e.lineTo(-n,-a),e.closePath()}},wedge:{draw:function draw(e,t){var r=Math.sqrt(t)/2,n=_y*r,i=n-.5773502691896257*r,a=r/4;e.moveTo(0,-n-i),e.lineTo(-a,n-i),e.lineTo(a,n-i),e.closePath()}},triangle:{draw:function draw(e,t){var r=Math.sqrt(t)/2,n=_y*r,i=n-.5773502691896257*r;e.moveTo(0,-n-i),e.lineTo(-r,n-i),e.lineTo(r,n-i),e.closePath()}},"triangle-up":{draw:function draw(e,t){var r=Math.sqrt(t)/2,n=_y*r;e.moveTo(0,-n),e.lineTo(-r,n),e.lineTo(r,n),e.closePath()}},"triangle-down":{draw:function draw(e,t){var r=Math.sqrt(t)/2,n=_y*r;e.moveTo(0,n),e.lineTo(-r,-n),e.lineTo(r,-n),e.closePath()}},"triangle-right":{draw:function draw(e,t){var r=Math.sqrt(t)/2,n=_y*r;e.moveTo(n,0),e.lineTo(-n,-r),e.lineTo(-n,r),e.closePath()}},"triangle-left":{draw:function draw(e,t){var r=Math.sqrt(t)/2,n=_y*r;e.moveTo(-n,0),e.lineTo(n,-r),e.lineTo(n,r),e.closePath()}},stroke:{draw:function draw(e,t){var r=Math.sqrt(t)/2;e.moveTo(-r,0),e.lineTo(r,0)}}};function vega_scenegraph_src_path_symbols_symbols(e){return Object(V.v)(Cy,e)?Cy[e]:function src_path_symbols_customSymbol(e){if(!Object(V.v)(Ty,e)){var t=gy(e);Ty[e]={draw:function draw(e,r){Ey(e,t,0,0,Math.sqrt(r)/2)}}}return Ty[e]}(e)}var Ty={};function src_path_rectangle_rectangleX(e){return e.x}function src_path_rectangle_rectangleY(e){return e.y}function src_path_rectangle_rectangleWidth(e){return e.width}function src_path_rectangle_rectangleHeight(e){return e.height}function vega_scenegraph_src_path_rectangle_constant(e){return function(){return e}}function vega_scenegraph_src_path_shapes_x(e){return e.x||0}function vega_scenegraph_src_path_shapes_y(e){return e.y||0}function vega_scenegraph_src_path_shapes_cr(e){return e.cornerRadius||0}function vega_scenegraph_src_path_shapes_def(e){return!(!1===e.defined)}var Oy=Dn().startAngle((function vega_scenegraph_src_path_shapes_sa(e){return e.startAngle||0})).endAngle((function vega_scenegraph_src_path_shapes_ea(e){return e.endAngle||0})).padAngle((function vega_scenegraph_src_path_shapes_pa(e){return e.padAngle||0})).innerRadius((function src_path_shapes_ir(e){return e.innerRadius||0})).outerRadius((function vega_scenegraph_src_path_shapes_or(e){return e.outerRadius||0})).cornerRadius(vega_scenegraph_src_path_shapes_cr),Ay=Mn().x(vega_scenegraph_src_path_shapes_x).y1(vega_scenegraph_src_path_shapes_y).y0((function src_path_shapes_yh(e){return(e.y||0)+(e.height||0)})).defined(vega_scenegraph_src_path_shapes_def),Ry=Mn().y(vega_scenegraph_src_path_shapes_y).x1(vega_scenegraph_src_path_shapes_x).x0((function src_path_shapes_xw(e){return(e.x||0)+(e.width||0)})).defined(vega_scenegraph_src_path_shapes_def),Dy=jn().x(vega_scenegraph_src_path_shapes_x).y(vega_scenegraph_src_path_shapes_y).defined(vega_scenegraph_src_path_shapes_def),Py=function(){var e=src_path_rectangle_rectangleX,t=src_path_rectangle_rectangleY,r=src_path_rectangle_rectangleWidth,n=src_path_rectangle_rectangleHeight,i=vega_scenegraph_src_path_rectangle_constant(0),a=null;function rectangle(o,s,u){var l,c=null!=s?s:+e.call(this,o),f=null!=u?u:+t.call(this,o),d=+r.call(this,o),h=+n.call(this,o),p=+i.call(this,o);if(a||(a=l=yn()),p<=0)a.rect(c,f,d,h);else{var g=c+d,m=f+h;a.moveTo(c+p,f),a.lineTo(g-p,f),a.quadraticCurveTo(g,f,g,f+p),a.lineTo(g,m-p),a.quadraticCurveTo(g,m,g-p,m),a.lineTo(c+p,m),a.quadraticCurveTo(c,m,c,m-p),a.lineTo(c,f+p),a.quadraticCurveTo(c,f,c+p,f),a.closePath()}if(l)return a=null,l+""||null}return rectangle.x=function(t){return arguments.length?(e="function"===typeof t?t:vega_scenegraph_src_path_rectangle_constant(+t),rectangle):e},rectangle.y=function(e){return arguments.length?(t="function"===typeof e?e:vega_scenegraph_src_path_rectangle_constant(+e),rectangle):t},rectangle.width=function(e){return arguments.length?(r="function"===typeof e?e:vega_scenegraph_src_path_rectangle_constant(+e),rectangle):r},rectangle.height=function(e){return arguments.length?(n="function"===typeof e?e:vega_scenegraph_src_path_rectangle_constant(+e),rectangle):n},rectangle.cornerRadius=function(e){return arguments.length?(i="function"===typeof e?e:vega_scenegraph_src_path_rectangle_constant(+e),rectangle):i},rectangle.context=function(e){return arguments.length?(a=null==e?null:e,rectangle):a},rectangle}().x(vega_scenegraph_src_path_shapes_x).y(vega_scenegraph_src_path_shapes_y).width((function vega_scenegraph_src_path_shapes_w(e){return e.width||0})).height((function vega_scenegraph_src_path_shapes_h(e){return e.height||0})).cornerRadius(vega_scenegraph_src_path_shapes_cr),jy=Ln().type((function vega_scenegraph_src_path_shapes_type(e){return vega_scenegraph_src_path_symbols_symbols(e.shape||"circle")})).size((function vega_scenegraph_src_path_shapes_size(e){return null==e.size?64:e.size})),My=function(){var e,t,r,n,i,a,o,s,u=null;function point(e,t,r){var n=r/2;if(i){var l=o-t,c=e-a;if(l||c){var f=Math.sqrt(l*l+c*c),d=(l/=f)*s,h=(c/=f)*s,p=Math.atan2(c,l);u.moveTo(a-d,o-h),u.lineTo(e-l*n,t-c*n),u.arc(e,t,n,p-Math.PI,p),u.lineTo(a+d,o+h),u.arc(a,o,s,p,p+Math.PI)}else u.arc(e,t,n,0,yy);u.closePath()}else i=1;a=e,o=t,s=n}function trail(a){var o,s,l,c=a.length,f=!1;for(null==u&&(u=l=yn()),o=0;o<=c;++o)!(o<c&&n(s=a[o],o,a))===f&&(f=!f)&&(i=0),f&&point(+e(s,o,a),+t(s,o,a),+r(s,o,a));if(l)return u=null,l+""||null}return trail.x=function(t){return arguments.length?(e=t,trail):e},trail.y=function(e){return arguments.length?(t=e,trail):t},trail.size=function(e){return arguments.length?(r=e,trail):r},trail.defined=function(e){return arguments.length?(n=e,trail):n},trail.context=function(e){return arguments.length?(u=null==e?null:e,trail):u},trail}().x(vega_scenegraph_src_path_shapes_x).y(vega_scenegraph_src_path_shapes_y).defined(vega_scenegraph_src_path_shapes_def).size((function src_path_shapes_ts(e){return e.size||1}));function vega_scenegraph_src_path_shapes_rectangle(e,t,r,n){return Py.context(e)(t,r,n)}var Fy,Iy=function(e,t){return t.stroke&&0!==t.opacity&&0!==t.strokeOpacity&&e.expand(null!=t.strokeWidth?+t.strokeWidth:1),e},Ly=yy-1e-8;function vega_scenegraph_src_bound_boundContext_context(e){return Fy=e,vega_scenegraph_src_bound_boundContext_context}function vega_scenegraph_src_bound_boundContext_noop(){}function vega_scenegraph_src_bound_boundContext_add(e,t){Fy.add(e,t)}vega_scenegraph_src_bound_boundContext_context.beginPath=vega_scenegraph_src_bound_boundContext_noop,vega_scenegraph_src_bound_boundContext_context.closePath=vega_scenegraph_src_bound_boundContext_noop,vega_scenegraph_src_bound_boundContext_context.moveTo=vega_scenegraph_src_bound_boundContext_add,vega_scenegraph_src_bound_boundContext_context.lineTo=vega_scenegraph_src_bound_boundContext_add,vega_scenegraph_src_bound_boundContext_context.rect=function(e,t,r,n){vega_scenegraph_src_bound_boundContext_add(e,t),vega_scenegraph_src_bound_boundContext_add(e+r,t+n)},vega_scenegraph_src_bound_boundContext_context.quadraticCurveTo=function(e,t,r,n){vega_scenegraph_src_bound_boundContext_add(e,t),vega_scenegraph_src_bound_boundContext_add(r,n)},vega_scenegraph_src_bound_boundContext_context.bezierCurveTo=function(e,t,r,n,i,a){vega_scenegraph_src_bound_boundContext_add(e,t),vega_scenegraph_src_bound_boundContext_add(r,n),vega_scenegraph_src_bound_boundContext_add(i,a)},vega_scenegraph_src_bound_boundContext_context.arc=function(e,t,r,n,i,a){if(Math.abs(i-n)>Ly)return vega_scenegraph_src_bound_boundContext_add(e-r,t-r),void vega_scenegraph_src_bound_boundContext_add(e+r,t+r);var o,s,u,l,c=1/0,f=-1/0,d=1/0,h=-1/0;function update(e){u=r*Math.cos(e),l=r*Math.sin(e),u<c&&(c=u),u>f&&(f=u),l<d&&(d=l),l>h&&(h=l)}if(update(n),update(i),i!==n)if((n%=yy)<0&&(n+=yy),(i%=yy)<0&&(i+=yy),i<n&&(a=!a,o=n,n=i,i=o),a)for(i-=yy,o=n-n%vy,s=0;s<4&&o>i;++s,o-=vy)update(o);else for(o=n-n%vy+vy,s=0;s<4&&o<i;++s,o+=vy)update(o);vega_scenegraph_src_bound_boundContext_add(e+c,t+d),vega_scenegraph_src_bound_boundContext_add(e+f,t+h)};var Ny=(Ny=domCanvas(1,1))?Ny.getContext("2d"):null,By=new vega_scenegraph_src_Bounds_Bounds;function src_util_intersect_intersectPath(e){return function(t,r){if(!Ny)return!0;e(Ny,t),By.clear().union(t.bounds).intersect(r).round();for(var n=By.x1,i=By.y1,a=By.x2,o=By.y2,s=i;s<=o;++s)for(var u=n;u<=a;++u)if(Ny.isPointInPath(u,s))return!0;return!1}}function src_util_intersect_intersectPoint(e,t){return t.contains(e.x||0,e.y||0)}function src_util_intersect_intersectRect(e,t){var r=e.x||0,n=e.y||0,i=e.width||0,a=e.height||0;return t.intersects(By.set(r,n,r+i,n+a))}function src_util_intersect_intersectBoxLine(e,t,r,n,i){var a,o,s,u,l=e.x1,c=e.y1,f=e.x2,d=e.y2,h=n-t,p=i-r,g=0,m=1;for(u=0;u<4;++u){if(0===u&&(a=-h,o=-(l-t)),1===u&&(a=h,o=f-t),2===u&&(a=-p,o=-(c-r)),3===u&&(a=p,o=d-r),Math.abs(a)<1e-10&&o<0)return!1;if(s=o/a,a<0){if(s>m)return!1;s>g&&(g=s)}else if(a>0){if(s<g)return!1;s<m&&(m=s)}}return!0}var Uy=function(e,t,r){return vega_scenegraph_src_Gradient_isGradient(r)?function(e,t,r){for(var n=r.width(),i=r.height(),a=t.stops,o=a.length,s="radial"===t.gradient?e.createRadialGradient(r.x1+(t.x1||.5)*n,r.y1+(t.y1||.5)*i,Math.max(n,i)*(t.r1||0),r.x1+(t.x2||.5)*n,r.y1+(t.y2||.5)*i,Math.max(n,i)*(t.r2||.5)):e.createLinearGradient(r.x1+(t.x1||0)*n,r.y1+(t.y1||0)*i,r.x1+(t.x2||1)*n,r.y1+(t.y2||0)*i),u=0;u<o;++u)s.addColorStop(a[u].offset,a[u].color);return s}(e,r,t.bounds):r},zy=function(e,t,r){return(r*=null==t.fillOpacity?1:t.fillOpacity)>0&&(e.globalAlpha=r,e.fillStyle=Uy(e,t,t.fill),!0)},qy=[],Wy=function(e,t,r){var n=null!=(n=t.strokeWidth)?n:1;return!(n<=0)&&((r*=null==t.strokeOpacity?1:t.strokeOpacity)>0&&(e.globalAlpha=r,e.strokeStyle=Uy(e,t,t.stroke),e.lineWidth=n,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||qy),e.lineDashOffset=t.strokeDashOffset||0),!0))};function vega_scenegraph_src_util_visit_compare(e,t){return e.zindex-t.zindex||e.index-t.index}function src_util_visit_zorder(e){if(!e.zdirty)return e.zitems;var t,r,n,i=e.items,a=[];for(r=0,n=i.length;r<n;++r)(t=i[r]).index=r,t.zindex&&a.push(t);return e.zdirty=!1,e.zitems=a.sort(vega_scenegraph_src_util_visit_compare)}function vega_scenegraph_src_util_visit_visit(e,t){var r,n,i=e.items;if(i&&i.length){var a=src_util_visit_zorder(e);if(a&&a.length){for(r=0,n=i.length;r<n;++r)i[r].zindex||t(i[r]);i=a}for(r=0,n=i.length;r<n;++r)t(i[r])}}function src_util_visit_pickVisit(e,t){var r,n,i=e.items;if(!i||!i.length)return null;var a=src_util_visit_zorder(e);for(a&&a.length&&(i=a),n=i.length;--n>=0;)if(r=t(i[n]))return r;if(i===a)for(n=(i=e.items).length;--n>=0;)if(!i[n].zindex&&(r=t(i[n])))return r;return null}function util_canvas_draw_drawAll(e){return function(t,r,n){vega_scenegraph_src_util_visit_visit(r,(function(r){n&&!n.intersects(r.bounds)||util_canvas_draw_drawPath(e,t,r,r)}))}}function util_canvas_draw_drawPath(e,t,r,n){var i=null==r.opacity?1:r.opacity;0!==i&&(e(t,n)||(r.fill&&zy(t,r,i)&&t.fill(),r.stroke&&Wy(t,r,i)&&t.stroke()))}function src_util_canvas_pick_pick(e){return e=e||V.eb,function(t,r,n,i,a,o){return n*=t.pixelRatio,i*=t.pixelRatio,src_util_visit_pickVisit(r,(function(r){var s=r.bounds;if((!s||s.contains(a,o))&&s)return e(t,r,n,i,a,o)?r:void 0}))}}function util_canvas_pick_hitPath(e,t){return function(r,n,i,a){var o,s,u=Array.isArray(n)?n[0]:n,l=null==t?u.fill:t,c=u.stroke&&r.isPointInStroke;return c&&(o=u.strokeWidth,s=u.strokeCap,r.lineWidth=null!=o?o:1,r.lineCap=null!=s?s:"butt"),!e(r,n)&&(l&&r.isPointInPath(i,a)||c&&r.isPointInStroke(i,a))}}function util_canvas_pick_pickPath(e){return src_util_canvas_pick_pick(util_canvas_pick_hitPath(e))}function src_util_svg_transform_translate(e,t){return"translate("+e+","+t+")"}function src_util_svg_transform_rotate(e){return"rotate("+e+")"}function util_svg_transform_translateItem(e){return src_util_svg_transform_translate(e.x||0,e.y||0)}var Gy=function(e,t,r){function draw(e,r){var n=r.x||0,i=r.y||0,a=r.angle||0;e.translate(n,i),a&&e.rotate(a*=my),e.beginPath(),t(e,r),a&&e.rotate(-a),e.translate(-n,-i)}return{type:e,tag:"path",nested:!1,attr:function attr(e,r){e("transform",function util_svg_transform_transformItem(e){return src_util_svg_transform_translate(e.x||0,e.y||0)+(e.angle?" "+src_util_svg_transform_rotate(e.angle):"")}(r)),e("d",t(null,r))},bound:function bound(e,r){var n=r.x||0,i=r.y||0;return t(vega_scenegraph_src_bound_boundContext_context(e),r),Iy(e,r).translate(n,i),r.angle&&e.rotate(r.angle*my,n,i),e},draw:util_canvas_draw_drawAll(draw),pick:util_canvas_pick_pickPath(draw),isect:r||src_util_intersect_intersectPath(draw)}},Hy=Gy("arc",(function vega_scenegraph_src_path_shapes_arc(e,t){return Oy.context(e)(t)}));var Vy=function(e,t,r){function draw(e,r){e.beginPath(),t(e,r)}var n,i=util_canvas_pick_hitPath(draw);return{type:e,tag:"path",nested:!0,attr:function attr(e,r){var n=r.mark.items;n.length&&e("d",t(null,n))},bound:function bound(e,r){var n=r.items;return 0===n.length?e:(t(vega_scenegraph_src_bound_boundContext_context(e),n),Iy(e,n[0]))},draw:(n=draw,function(e,t,r){!t.items.length||r&&!r.intersects(t.bounds)||util_canvas_draw_drawPath(n,e,t.items[0],t.items)}),pick:function pick(e,t,r,n,a,o){var s=t.items,u=t.bounds;return!s||!s.length||u&&!u.contains(a,o)?null:(r*=e.pixelRatio,n*=e.pixelRatio,i(e,s,r,n)?s[0]:null)},isect:src_util_intersect_intersectPoint,tip:r}},Yy=Vy("area",(function vega_scenegraph_src_path_shapes_area(e,t){var r=t[0],n=r.interpolate||"linear";return("horizontal"===r.orient?Ry:Ay).curve(src_path_curves_curves(n,r.orient,r.tension)).context(e)(t)}),(function src_util_pickPath_pickArea(e,t){for(var r,n,i="horizontal"===e[0].orient?t[1]:t[0],a="horizontal"===e[0].orient?"y":"x",o=e.length,s=1/0;--o>=0;)!1!==e[o].defined&&(n=Math.abs(e[o][a]-i))<s&&(s=n,r=e[o]);return r})),$y=1;var Xy=function(e,t,r){var n=t.clip,i=e._defs,a=t.clip_id||(t.clip_id="clip"+$y++),o=i.clipping[a]||(i.clipping[a]={id:a});return Object(V.D)(n)?o.path=n(null):(o.width=r.width||0,o.height=r.height||0),"url(#"+a+")"},Ky=.5;function src_marks_group_backgroundPath(e,t){var r=t.stroke?Ky:0;e.beginPath(),vega_scenegraph_src_path_shapes_rectangle(e,t,r,r)}var Jy=util_canvas_pick_hitPath(src_marks_group_backgroundPath);var Qy={type:"group",tag:"g",nested:!1,attr:function vega_scenegraph_src_marks_group_attr(e,t){e("transform",util_svg_transform_translateItem(t))},bound:function vega_scenegraph_src_marks_group_bound(e,t){if(!t.clip&&t.items)for(var r=t.items,n=0,i=r.length;n<i;++n)e.union(r[n].bounds);return(t.clip||t.width||t.height)&&!t.noBound&&e.add(0,0).add(t.width||0,t.height||0),Iy(e,t),e.translate(t.x||0,t.y||0)},draw:function vega_scenegraph_src_marks_group_draw(e,t,r){var n=this;vega_scenegraph_src_util_visit_visit(t,(function(t){var i,a=t.x||0,o=t.y||0,s=t.width||0,u=t.height||0;e.save(),e.translate(a,o),(t.stroke||t.fill)&&(i=null==t.opacity?1:t.opacity)>0&&(src_marks_group_backgroundPath(e,t),t.fill&&zy(e,t,i)&&e.fill(),t.stroke&&Wy(e,t,i)&&e.stroke()),t.clip&&(e.beginPath(),e.rect(0,0,s,u),e.clip()),r&&r.translate(-a,-o),vega_scenegraph_src_util_visit_visit(t,(function(t){n.draw(e,t,r)})),r&&r.translate(a,o),e.restore()}))},pick:function vega_scenegraph_src_marks_group_pick(e,t,r,n,i,a){if(t.bounds&&!t.bounds.contains(i,a)||!t.items)return null;var o=this,s=r*e.pixelRatio,u=n*e.pixelRatio;return src_util_visit_pickVisit(t,(function(l){var c,f,d,h;if(!(h=l.bounds)||h.contains(i,a))return f=l.x||0,d=l.y||0,e.save(),e.translate(f,d),f=i-f,d=a-d,!(c=src_util_visit_pickVisit(l,(function(e){return function src_marks_group_pickMark(e,t,r){return(!1!==e.interactive||"group"===e.marktype)&&e.bounds&&e.bounds.contains(t,r)}(e,f,d)?o.pick(e,r,n,f,d):null})))&&!1!==t.interactive&&(l.fill||l.stroke)&&Jy(e,l,s,u)&&(c=l),e.restore(),c||null}))},isect:src_util_intersect_intersectRect,background:function src_marks_group_background(e,t){var r=t.stroke?Ky:0;e("class","background"),e("d",vega_scenegraph_src_path_shapes_rectangle(null,t,r,r))},foreground:function src_marks_group_foreground(e,t,r){e("clip-path",t.clip?Xy(r,t,t):null)}};function src_marks_image_getImage(e,t){var r=e.image;return r&&r.url===e.url||(r={loaded:!1,width:0,height:0},t.loadImage(e.url).then((function(t){e.image=t,e.image.url=e.url}))),r}function src_marks_image_imageXOffset(e,t){return"center"===e?t/2:"right"===e?t:0}function src_marks_image_imageYOffset(e,t){return"middle"===e?t/2:"bottom"===e?t:0}var Zy={type:"image",tag:"image",nested:!1,attr:function vega_scenegraph_src_marks_image_attr(e,t,r){var n=src_marks_image_getImage(t,r),i=t.x||0,a=t.y||0,o=(null!=t.width?t.width:n.width)||0,s=(null!=t.height?t.height:n.height)||0,u=!1===t.aspect?"none":"xMidYMid";i-=src_marks_image_imageXOffset(t.align,o),a-=src_marks_image_imageYOffset(t.baseline,s),e("href",n.src||"","http://www.w3.org/1999/xlink","xlink:href"),e("transform",src_util_svg_transform_translate(i,a)),e("width",o),e("height",s),e("preserveAspectRatio",u)},bound:function vega_scenegraph_src_marks_image_bound(e,t){var r=t.image,n=t.x||0,i=t.y||0,a=(null!=t.width?t.width:r&&r.width)||0,o=(null!=t.height?t.height:r&&r.height)||0;return n-=src_marks_image_imageXOffset(t.align,a),i-=src_marks_image_imageYOffset(t.baseline,o),e.set(n,i,n+a,i+o)},draw:function vega_scenegraph_src_marks_image_draw(e,t,r){var n=this;vega_scenegraph_src_util_visit_visit(t,(function(t){if(!r||r.intersects(t.bounds)){var i,a,o,s,u=src_marks_image_getImage(t,n),l=t.x||0,c=t.y||0,f=(null!=t.width?t.width:u.width)||0,d=(null!=t.height?t.height:u.height)||0;l-=src_marks_image_imageXOffset(t.align,f),c-=src_marks_image_imageYOffset(t.baseline,d),!1!==t.aspect&&(a=u.width/u.height,o=t.width/t.height,a===a&&o===o&&a!==o&&(o<a?(c+=(d-(s=f/a))/2,d=s):(l+=(f-(s=d*a))/2,f=s))),u.loaded&&(e.globalAlpha=null!=(i=t.opacity)?i:1,e.drawImage(u,l,c,f,d))}}))},pick:src_util_canvas_pick_pick(),isect:V.eb,get:src_marks_image_getImage,xOffset:src_marks_image_imageXOffset,yOffset:src_marks_image_imageYOffset},e_=Vy("line",(function vega_scenegraph_src_path_shapes_line(e,t){var r=t[0],n=r.interpolate||"linear";return Dy.curve(src_path_curves_curves(n,r.orient,r.tension)).context(e)(t)}),(function src_util_pickPath_pickLine(e,t){for(var r,n,i=Math.pow(e[0].strokeWidth||1,2),a=e.length;--a>=0;)if(!1!==e[a].defined&&(r=e[a].x-t[0])*r+(n=e[a].y-t[1])*n<i)return e[a];return null}));function node_modules_vega_scenegraph_src_marks_path_path(e,t){var r=t.path;if(null==r)return!0;var n=t.pathCache;n&&n.path===r||((t.pathCache=n=gy(r)).path=r),Ey(e,n,t.x,t.y)}var t_={type:"path",tag:"path",nested:!1,attr:function vega_scenegraph_src_marks_path_attr(e,t){e("transform",util_svg_transform_translateItem(t)),e("d",t.path)},bound:function vega_scenegraph_src_marks_path_bound(e,t){return node_modules_vega_scenegraph_src_marks_path_path(vega_scenegraph_src_bound_boundContext_context(e),t)?e.set(0,0,0,0):Iy(e,t)},draw:util_canvas_draw_drawAll(node_modules_vega_scenegraph_src_marks_path_path),pick:util_canvas_pick_pickPath(node_modules_vega_scenegraph_src_marks_path_path),isect:src_util_intersect_intersectPath(node_modules_vega_scenegraph_src_marks_path_path)};function vega_scenegraph_src_marks_rect_draw(e,t){e.beginPath(),vega_scenegraph_src_path_shapes_rectangle(e,t)}var r_={type:"rect",tag:"path",nested:!1,attr:function vega_scenegraph_src_marks_rect_attr(e,t){e("d",vega_scenegraph_src_path_shapes_rectangle(null,t))},bound:function vega_scenegraph_src_marks_rect_bound(e,t){var r,n;return Iy(e.set(r=t.x||0,n=t.y||0,r+t.width||0,n+t.height||0),t)},draw:util_canvas_draw_drawAll(vega_scenegraph_src_marks_rect_draw),pick:util_canvas_pick_pickPath(vega_scenegraph_src_marks_rect_draw),isect:src_util_intersect_intersectRect};function vega_scenegraph_src_marks_rule_path(e,t,r){var n,i,a,o;return!(!t.stroke||!Wy(e,t,r))&&(n=t.x||0,i=t.y||0,a=null!=t.x2?t.x2:n,o=null!=t.y2?t.y2:i,e.beginPath(),e.moveTo(n,i),e.lineTo(a,o),!0)}var n_,i_={type:"rule",tag:"line",nested:!1,attr:function vega_scenegraph_src_marks_rule_attr(e,t){e("transform",util_svg_transform_translateItem(t)),e("x2",null!=t.x2?t.x2-(t.x||0):0),e("y2",null!=t.y2?t.y2-(t.y||0):0)},bound:function vega_scenegraph_src_marks_rule_bound(e,t){var r,n;return Iy(e.set(r=t.x||0,n=t.y||0,null!=t.x2?t.x2:r,null!=t.y2?t.y2:n),t)},draw:function vega_scenegraph_src_marks_rule_draw(e,t,r){vega_scenegraph_src_util_visit_visit(t,(function(t){if(!r||r.intersects(t.bounds)){var n=null==t.opacity?1:t.opacity;n&&vega_scenegraph_src_marks_rule_path(e,t,n)&&e.stroke()}}))},pick:src_util_canvas_pick_pick((function vega_scenegraph_src_marks_rule_hit(e,t,r,n){return!!e.isPointInStroke&&(vega_scenegraph_src_marks_rule_path(e,t,1)&&e.isPointInStroke(r,n))})),isect:function src_util_intersect_intersectRule(e,t){var r=e.x||0,n=e.y||0;return src_util_intersect_intersectBoxLine(t,r,n,null!=e.x2?e.x2:r,null!=e.y2?e.y2:n)}},a_=Gy("shape",(function vega_scenegraph_src_path_shapes_shape(e,t){return(t.mark.shape||t.shape).context(e)(t)})),o_=Gy("symbol",(function vega_scenegraph_src_path_shapes_symbol(e,t){return jy.context(e)(t)}),src_util_intersect_intersectPoint),s_={height:vega_scenegraph_src_util_text_fontSize,measureWidth:src_util_text_measureWidth,estimateWidth:src_util_text_estimateWidth,width:src_util_text_estimateWidth,canvas:src_util_text_useCanvas};function src_util_text_estimateWidth(e){return n_=vega_scenegraph_src_util_text_fontSize(e),src_util_text_estimate(src_util_text_textValue(e))}function src_util_text_estimate(e){return~~(.8*e.length*n_)}function src_util_text_measureWidth(e){return vega_scenegraph_src_util_text_fontSize(e)<=0?0:(Ny.font=vega_scenegraph_src_util_text_font(e),vega_scenegraph_src_util_text_measure(src_util_text_textValue(e)))}function vega_scenegraph_src_util_text_measure(e){return Ny.measureText(e).width}function vega_scenegraph_src_util_text_fontSize(e){return null!=e.fontSize?e.fontSize:11}function src_util_text_useCanvas(e){s_.width=e&&Ny?src_util_text_measureWidth:src_util_text_estimateWidth}function src_util_text_textValue(e){var t=e.text;return null==t?"":e.limit>0?function src_util_text_truncate(e){var t,r=+e.limit,n=e.text+"";s_.width===src_util_text_measureWidth?(Ny.font=vega_scenegraph_src_util_text_font(e),t=vega_scenegraph_src_util_text_measure):(n_=vega_scenegraph_src_util_text_fontSize(e),t=src_util_text_estimate);if(t(n)<r)return n;var i,a=e.ellipsis||"\u2026",o="rtl"===e.dir,s=0,u=n.length;if(r-=t(a),o){for(;s<u;)i=s+u>>>1,t(n.slice(i))>r?s=i+1:u=i;return a+n.slice(s)}for(;s<u;)i=1+(s+u>>>1),t(n.slice(0,i))<r?s=i:u=i-1;return n.slice(0,s)+a}(e):t+""}function src_util_text_fontFamily(e,t){var r=e.font;return(t&&r?String(r).replace(/"/g,"'"):r)||"sans-serif"}function vega_scenegraph_src_util_text_font(e,t){return(e.fontStyle?e.fontStyle+" ":"")+(e.fontVariant?e.fontVariant+" ":"")+(e.fontWeight?e.fontWeight+" ":"")+vega_scenegraph_src_util_text_fontSize(e)+"px "+src_util_text_fontFamily(e,t)}function vega_scenegraph_src_util_text_offset(e){var t=e.baseline,r=vega_scenegraph_src_util_text_fontSize(e);return Math.round("top"===t?.79*r:"middle"===t?.3*r:"bottom"===t?-.21*r:0)}src_util_text_useCanvas(!0);var u_={left:"start",center:"middle",right:"end"},l_=new vega_scenegraph_src_Bounds_Bounds;function src_marks_text_anchorPoint(e){var t,r=e.x||0,n=e.y||0,i=e.radius||0;return i&&(t=(e.theta||0)-vy,r+=i*Math.cos(t),n+=i*Math.sin(t)),l_.x1=r,l_.y1=n,l_}function vega_scenegraph_src_marks_text_bound(e,t,r){var n,i=s_.height(t),a=t.align,o=src_marks_text_anchorPoint(t),s=o.x1,u=o.y1,l=t.dx||0,c=(t.dy||0)+vega_scenegraph_src_util_text_offset(t)-Math.round(.8*i);if(n=s_.width(t),"center"===a?l-=n/2:"right"===a&&(l-=n),e.set(l+=s,c+=u,l+n,c+i),t.angle&&!r)e.rotate(t.angle*my,s,u);else if(2===r)return e.rotatedPoints(t.angle*my,s,u);return e}var c_={arc:Hy,area:Yy,group:Qy,image:Zy,line:e_,path:t_,rect:r_,rule:i_,shape:a_,symbol:o_,text:{type:"text",tag:"text",nested:!1,attr:function vega_scenegraph_src_marks_text_attr(e,t){var r,n=t.dx||0,i=(t.dy||0)+vega_scenegraph_src_util_text_offset(t),a=src_marks_text_anchorPoint(t),o=a.x1,s=a.y1,u=t.angle||0;e("text-anchor",u_[t.align]||"start"),u?(r=src_util_svg_transform_translate(o,s)+" "+src_util_svg_transform_rotate(u),(n||i)&&(r+=" "+src_util_svg_transform_translate(n,i))):r=src_util_svg_transform_translate(o+n,s+i),e("transform",r)},bound:vega_scenegraph_src_marks_text_bound,draw:function vega_scenegraph_src_marks_text_draw(e,t,r){vega_scenegraph_src_util_visit_visit(t,(function(t){var n,i,a,o,s;r&&!r.intersects(t.bounds)||(s=src_util_text_textValue(t))&&(0===(n=null==t.opacity?1:t.opacity)||t.fontSize<=0||(e.font=vega_scenegraph_src_util_text_font(t),e.textAlign=t.align||"left",a=(i=src_marks_text_anchorPoint(t)).x1,o=i.y1,t.angle&&(e.save(),e.translate(a,o),e.rotate(t.angle*my),a=o=0),a+=t.dx||0,o+=(t.dy||0)+vega_scenegraph_src_util_text_offset(t),t.fill&&zy(e,t,n)&&e.fillText(s,a,o),t.stroke&&Wy(e,t,n)&&e.strokeText(s,a,o),t.angle&&e.restore()))}))},pick:src_util_canvas_pick_pick((function vega_scenegraph_src_marks_text_hit(e,t,r,n,i,a){if(t.fontSize<=0)return!1;if(!t.angle)return!0;var o=src_marks_text_anchorPoint(t),s=o.x1,u=o.y1,l=vega_scenegraph_src_marks_text_bound(l_,t,1),c=-t.angle*my,f=Math.cos(c),d=Math.sin(c),h=f*i-d*a+(s-f*s+d*u),p=d*i+f*a+(u-d*s-f*u);return l.contains(h,p)})),isect:function src_marks_text_intersectText(e,t){var r=vega_scenegraph_src_marks_text_bound(l_,e,2);return src_util_intersect_intersectBoxLine(t,r[0],r[1],r[2],r[3])||src_util_intersect_intersectBoxLine(t,r[0],r[1],r[4],r[5])||src_util_intersect_intersectBoxLine(t,r[4],r[5],r[6],r[7])||src_util_intersect_intersectBoxLine(t,r[2],r[3],r[6],r[7])}},trail:Vy("trail",(function vega_scenegraph_src_path_shapes_trail(e,t){return My.context(e)(t)}),(function src_util_pickPath_pickTrail(e,t){for(var r,n,i=e.length;--i>=0;)if(!1!==e[i].defined&&(r=e[i].x-t[0])*r+(n=e[i].y-t[1])*n<(r=e[i].size||1)*r)return e[i];return null}))},f_=function(e,t,r){var n=c_[e.mark.marktype],i=t||n.bound;return n.nested&&(e=e.mark),i(e.bounds||(e.bounds=new vega_scenegraph_src_Bounds_Bounds),e,r)},d_={mark:null},h_=function(e,t,r){var n,i,a,o,s=c_[e.marktype],u=s.bound,l=e.items,c=l&&l.length;if(s.nested)return c?a=l[0]:(d_.mark=e,a=d_),o=f_(a,u,r),t=t&&t.union(o)||o;if(t=t||e.bounds&&e.bounds.clear()||new vega_scenegraph_src_Bounds_Bounds,c)for(n=0,i=l.length;n<i;++n)t.union(f_(l[n],u,r));return e.bounds=t},p_=["marktype","name","role","interactive","clip","items","zindex","x","y","width","height","align","baseline","fill","fillOpacity","opacity","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","startAngle","endAngle","innerRadius","outerRadius","cornerRadius","padAngle","interpolate","tension","orient","defined","url","path","x2","y2","size","shape","text","angle","theta","radius","dx","dy","font","fontSize","fontWeight","fontStyle","fontVariant"];function src_util_serialize_sceneFromJSON(e){return function vega_scenegraph_src_util_serialize_initialize(e){var t,r,n,i=e.marktype,a=e.items;if(a)for(r=0,n=a.length;r<n;++r)t=i?"mark":"group",a[r][t]=e,a[r].zindex&&(a[r][t].zdirty=!0),"group"===(i||t)&&vega_scenegraph_src_util_serialize_initialize(a[r]);i&&h_(e);return e}("string"===typeof e?JSON.parse(e):e)}var g_=function vega_scenegraph_src_Scenegraph_Scenegraph(e){arguments.length?this.root=src_util_serialize_sceneFromJSON(e):(this.root=vega_scenegraph_src_Scenegraph_createMark({marktype:"group",name:"root",role:"frame"}),this.root.items=[new vega_scenegraph_src_GroupItem_GroupItem(this.root)])}.prototype;function vega_scenegraph_src_Scenegraph_createMark(e,t){return{bounds:new vega_scenegraph_src_Bounds_Bounds,clip:!!e.clip,group:t,interactive:!1!==e.interactive,items:[],marktype:e.marktype,name:e.name||void 0,role:e.role||void 0,zindex:e.zindex||0}}function src_util_dom_domCreate(e,t,r){return!e&&"undefined"!==typeof document&&document.createElement&&(e=document),e?r?e.createElementNS(r,t):e.createElement(t):null}function src_util_dom_domFind(e,t){t=t.toLowerCase();for(var r=e.childNodes,n=0,i=r.length;n<i;++n)if(r[n].tagName.toLowerCase()===t)return r[n]}function src_util_dom_domChild(e,t,r,n){var i,a=e.childNodes[t];return a&&a.tagName.toLowerCase()===r.toLowerCase()||(i=a||null,a=src_util_dom_domCreate(e.ownerDocument,r,n),e.insertBefore(a,i)),a}function src_util_dom_domClear(e,t){for(var r=e.childNodes,n=r.length;n>t;)e.removeChild(r[--n]);return e}function src_util_dom_cssClass(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}g_.toJSON=function(e){return function src_util_serialize_sceneToJSON(e,t){return JSON.stringify(e,p_,t)}(this.root,e||0)},g_.mark=function(e,t,r){var n=vega_scenegraph_src_Scenegraph_createMark(e,t=t||this.root.items[0]);return t.items[r]=n,n.zindex&&(n.group.zdirty=!0),n};var m_=function(e,t){var r=t.getBoundingClientRect();return[e.clientX-r.left-(t.clientLeft||0),e.clientY-r.top-(t.clientTop||0)]};function node_modules_vega_scenegraph_src_Handler_Handler(e,t){this._active=null,this._handlers={},this._loader=e||cy(),this._tooltip=t||vega_scenegraph_src_Handler_defaultTooltip}function vega_scenegraph_src_Handler_defaultTooltip(e,t,r,n){e.element().setAttribute("title",n||"")}var v_=node_modules_vega_scenegraph_src_Handler_Handler.prototype;function node_modules_vega_scenegraph_src_Renderer_Renderer(e){this._el=null,this._bgcolor=null,this._loader=new vega_scenegraph_src_ResourceLoader_ResourceLoader(e)}v_.initialize=function(e,t,r){return this._el=e,this._obj=r||null,this.origin(t)},v_.element=function(){return this._el},v_.canvas=function(){return this._el&&this._el.firstChild},v_.origin=function(e){return arguments.length?(this._origin=e||[0,0],this):this._origin.slice()},v_.scene=function(e){return arguments.length?(this._scene=e,this):this._scene},v_.on=function(){},v_.off=function(){},v_._handlerIndex=function(e,t,r){for(var n=e?e.length:0;--n>=0;)if(e[n].type===t&&(!r||e[n].handler===r))return n;return-1},v_.handlers=function(e){var t,r=this._handlers,n=[];if(e)n.push.apply(n,r[this.eventName(e)]);else for(t in r)n.push.apply(n,r[t]);return n},v_.eventName=function(e){var t=e.indexOf(".");return t<0?e:e.slice(0,t)},v_.handleHref=function(e,t,r){this._loader.sanitize(r,{context:"href"}).then((function(t){var r=new MouseEvent(e.type,e),n=src_util_dom_domCreate(null,"a");for(var i in t)n.setAttribute(i,t[i]);n.dispatchEvent(r)})).catch((function(){}))},v_.handleTooltip=function(e,t,r){if(t&&null!=t.tooltip){t=function(e,t,r,n){var i,a,o=e&&e.mark;if(o&&(i=c_[o.marktype]).tip){for((a=m_(t,r))[0]-=n[0],a[1]-=n[1];e=e.mark.group;)a[0]-=e.x||0,a[1]-=e.y||0;e=i.tip(o.items,a)}return e}(t,e,this.canvas(),this._origin);var n=r&&t&&t.tooltip||null;this._tooltip.call(this._obj,this,e,t,n)}},v_.getItemBoundingClientRect=function(e){if(t=this.canvas()){for(var t,r=t.getBoundingClientRect(),n=this._origin,i=e.bounds,a=i.x1+n[0]+r.left,o=i.y1+n[1]+r.top,s=i.width(),u=i.height();e.mark&&(e=e.mark.group);)a+=e.x||0,o+=e.y||0;return{x:a,y:o,width:s,height:u,left:a,top:o,right:a+s,bottom:o+u}}};var y_=node_modules_vega_scenegraph_src_Renderer_Renderer.prototype;y_.initialize=function(e,t,r,n,i){return this._el=e,this.resize(t,r,n,i)},y_.element=function(){return this._el},y_.canvas=function(){return this._el&&this._el.firstChild},y_.background=function(e){return 0===arguments.length?this._bgcolor:(this._bgcolor=e,this)},y_.resize=function(e,t,r,n){return this._width=e,this._height=t,this._origin=r||[0,0],this._scale=n||1,this},y_.dirty=function(){},y_.render=function(e){var t=this;return t._call=function(){t._render(e)},t._call(),t._call=null,t},y_._render=function(){},y_.renderAsync=function(e){var t=this.render(e);return this._ready?this._ready.then((function(){return t})):Promise.resolve(t)},y_._load=function(e,t){var r=this,n=r._loader[e](t);if(!r._ready){var i=r._call;r._ready=r._loader.ready().then((function(e){e&&i(),r._ready=null}))}return n},y_.sanitizeURL=function(e){return this._load("sanitizeURL",e)},y_.loadImage=function(e){return this._load("loadImage",e)};var __="mouseout";function vega_scenegraph_src_CanvasHandler_CanvasHandler(e,t){node_modules_vega_scenegraph_src_Handler_Handler.call(this,e,t),this._down=null,this._touch=null,this._first=!0}var b_=Object(V.y)(vega_scenegraph_src_CanvasHandler_CanvasHandler,node_modules_vega_scenegraph_src_Handler_Handler);function vega_scenegraph_src_CanvasHandler_move(e,t,r){return function(n){var i=this._active,a=this.pickEvent(n);a===i?this.fire(e,n):(i&&i.exit||this.fire(r,n),this._active=a,this.fire(t,n),this.fire(e,n))}}function vega_scenegraph_src_CanvasHandler_inactive(e){return function(t){this.fire(e,t),this._active=null}}b_.initialize=function(e,t,r){var n=this._canvas=e&&src_util_dom_domFind(e,"canvas");if(n){var i=this;this.events.forEach((function(e){n.addEventListener(e,(function(t){b_[e]?b_[e].call(i,t):i.fire(e,t)}))}))}return node_modules_vega_scenegraph_src_Handler_Handler.prototype.initialize.call(this,e,t,r)},b_.canvas=function(){return this._canvas},b_.context=function(){return this._canvas.getContext("2d")},b_.events=["keydown","keypress","keyup","dragenter","dragleave","dragover","mousedown","mouseup","mousemove","mouseout","mouseover","click","dblclick","wheel","mousewheel","touchstart","touchmove","touchend"],b_.DOMMouseScroll=function(e){this.fire("mousewheel",e)},b_.mousemove=vega_scenegraph_src_CanvasHandler_move("mousemove","mouseover","mouseout"),b_.dragover=vega_scenegraph_src_CanvasHandler_move("dragover","dragenter","dragleave"),b_.mouseout=vega_scenegraph_src_CanvasHandler_inactive("mouseout"),b_.dragleave=vega_scenegraph_src_CanvasHandler_inactive("dragleave"),b_.mousedown=function(e){this._down=this._active,this.fire("mousedown",e)},b_.click=function(e){this._down===this._active&&(this.fire("click",e),this._down=null)},b_.touchstart=function(e){this._touch=this.pickEvent(e.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire("touchstart",e,!0)},b_.touchmove=function(e){this.fire("touchmove",e,!0)},b_.touchend=function(e){this.fire("touchend",e,!0),this._touch=null},b_.fire=function(e,t,r){var n,i,a=r?this._touch:this._active,o=this._handlers[e];if(t.vegaType=e,"click"===e&&a&&a.href?this.handleHref(t,a,a.href):"mousemove"!==e&&e!==__||this.handleTooltip(t,a,e!==__),o)for(n=0,i=o.length;n<i;++n)o[n].handler.call(this._obj,t,a)},b_.on=function(e,t){var r=this.eventName(e),n=this._handlers;return this._handlerIndex(n[r],e,t)<0&&(n[r]||(n[r]=[])).push({type:e,handler:t}),this},b_.off=function(e,t){var r=this.eventName(e),n=this._handlers[r],i=this._handlerIndex(n,e,t);return i>=0&&n.splice(i,1),this},b_.pickEvent=function(e){var t=m_(e,this._canvas),r=this._origin;return this.pick(this._scene,t[0],t[1],t[0]-r[0],t[1]-r[1])},b_.pick=function(e,t,r,n,i){var a=this.context();return c_[e.marktype].pick.call(this,a,e,t,r,n,i)};var x_=function util_canvas_resize_devicePixelRatio(){return"undefined"!==typeof window&&window.devicePixelRatio||1}();function vega_scenegraph_src_CanvasRenderer_CanvasRenderer(e){node_modules_vega_scenegraph_src_Renderer_Renderer.call(this,e),this._redraw=!1,this._dirty=new vega_scenegraph_src_Bounds_Bounds}var w_=Object(V.y)(vega_scenegraph_src_CanvasRenderer_CanvasRenderer,node_modules_vega_scenegraph_src_Renderer_Renderer),k_=node_modules_vega_scenegraph_src_Renderer_Renderer.prototype,S_=new vega_scenegraph_src_Bounds_Bounds;function vega_scenegraph_src_SVGHandler_SVGHandler(e,t){node_modules_vega_scenegraph_src_Handler_Handler.call(this,e,t);var r=this;r._hrefHandler=vega_scenegraph_src_SVGHandler_listener(r,(function(e,t){t&&t.href&&r.handleHref(e,t,t.href)})),r._tooltipHandler=vega_scenegraph_src_SVGHandler_listener(r,(function(e,t){r.handleTooltip(e,t,e.type!==__)}))}w_.initialize=function(e,t,r,n,i,a){return this._options=a,this._canvas=domCanvas(1,1,a&&a.type),e&&(src_util_dom_domClear(e,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),k_.initialize.call(this,e,t,r,n,i)},w_.resize=function(e,t,r,n){return k_.resize.call(this,e,t,r,n),function(e,t,r,n,i,a){var o,s="undefined"!==typeof HTMLElement&&e instanceof HTMLElement&&null!=e.parentNode,u=e.getContext("2d"),l=s?x_:i;for(o in e.width=t*l,e.height=r*l,a)u[o]=a[o];s&&1!==l&&(e.style.width=t+"px",e.style.height=r+"px"),u.pixelRatio=l,u.setTransform(l,0,0,l,l*n[0],l*n[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options&&this._options.context),this._redraw=!0,this},w_.canvas=function(){return this._canvas},w_.context=function(){return this._canvas?this._canvas.getContext("2d"):null},w_.dirty=function(e){var t=function node_modules_vega_scenegraph_src_CanvasRenderer_translate(e,t){if(null==t)return e;for(var r=S_.clear().union(e);null!=t;t=t.mark.group)r.translate(t.x||0,t.y||0);return r}(e.bounds,e.mark.group);this._dirty.union(t)},w_._render=function(e){var t=this.context(),r=this._origin,n=this._width,i=this._height,a=this._dirty;return t.save(),this._redraw||a.empty()?(this._redraw=!1,a=null):a=function vega_scenegraph_src_CanvasRenderer_clipToBounds(e,t,r){return t.expand(1).round(),t.translate(-r[0]%1,-r[1]%1),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}(t,a,r),this.clear(-r[0],-r[1],n,i),this.draw(t,e,a),t.restore(),this._dirty.clear(),this},w_.draw=function(e,t,r){var n=c_[t.marktype];t.clip&&function(e,t){var r=t.clip;if(e.save(),e.beginPath(),Object(V.D)(r))r(e);else{var n=t.group;e.rect(0,0,n.width||0,n.height||0)}e.clip()}(e,t),n.draw.call(this,e,t,r),t.clip&&e.restore()},w_.clear=function(e,t,r,n){var i=this.context();i.clearRect(e,t,r,n),null!=this._bgcolor&&(i.fillStyle=this._bgcolor,i.fillRect(e,t,r,n))};var E_=Object(V.y)(vega_scenegraph_src_SVGHandler_SVGHandler,node_modules_vega_scenegraph_src_Handler_Handler);function vega_scenegraph_src_SVGHandler_listener(e,t){return function(r){var n=r.target.__data__;r.vegaType=r.type,n=Array.isArray(n)?n[0]:n,t.call(e._obj,r,n)}}function src_util_tags_openTag(e,t,r){var n,i,a="<"+e;if(t)for(n in t)null!=(i=t[n])&&(a+=" "+n+'="'+i+'"');return r&&(a+=" "+r),a+">"}function src_util_tags_closeTag(e){return"</"+e+">"}E_.initialize=function(e,t,r){var n=this._svg;return n&&(n.removeEventListener("click",this._hrefHandler),n.removeEventListener("mousemove",this._tooltipHandler),n.removeEventListener(__,this._tooltipHandler)),this._svg=n=e&&src_util_dom_domFind(e,"svg"),n&&(n.addEventListener("click",this._hrefHandler),n.addEventListener("mousemove",this._tooltipHandler),n.addEventListener(__,this._tooltipHandler)),node_modules_vega_scenegraph_src_Handler_Handler.prototype.initialize.call(this,e,t,r)},E_.canvas=function(){return this._svg},E_.on=function(e,t){var r=this.eventName(e),n=this._handlers;if(this._handlerIndex(n[r],e,t)<0){var i={type:e,handler:t,listener:vega_scenegraph_src_SVGHandler_listener(this,t)};(n[r]||(n[r]=[])).push(i),this._svg&&this._svg.addEventListener(r,i.listener)}return this},E_.off=function(e,t){var r=this.eventName(e),n=this._handlers[r],i=this._handlerIndex(n,e,t);return i>=0&&(this._svg&&this._svg.removeEventListener(r,n[i].listener),n.splice(i,1)),this};var C_={version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},T_={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",strokeCap:"stroke-linecap",strokeJoin:"stroke-linejoin",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeMiterLimit:"stroke-miterlimit",opacity:"opacity"},O_=Object.keys(T_),A_=C_.xmlns;function vega_scenegraph_src_SVGRenderer_SVGRenderer(e){node_modules_vega_scenegraph_src_Renderer_Renderer.call(this,e),this._dirtyID=1,this._dirty=[],this._svg=null,this._root=null,this._defs=null}var R_=Object(V.y)(vega_scenegraph_src_SVGRenderer_SVGRenderer,node_modules_vega_scenegraph_src_Renderer_Renderer),D_=node_modules_vega_scenegraph_src_Renderer_Renderer.prototype;function vega_scenegraph_src_SVGRenderer_updateGradient(e,t,r){var n,i,a;if("radial"===t.gradient){var o=src_util_dom_domChild(e,r++,"pattern",A_);o.setAttribute("id",ny+t.id),o.setAttribute("viewBox","0,0,1,1"),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("preserveAspectRatio","xMidYMid slice"),(o=src_util_dom_domChild(o,0,"rect",A_)).setAttribute("width","1"),o.setAttribute("height","1"),o.setAttribute("fill","url("+node_modules_vega_scenegraph_src_SVGRenderer_href()+"#"+t.id+")"),(e=src_util_dom_domChild(e,r++,"radialGradient",A_)).setAttribute("id",t.id),e.setAttribute("fx",t.x1),e.setAttribute("fy",t.y1),e.setAttribute("fr",t.r1),e.setAttribute("cx",t.x2),e.setAttribute("cy",t.y2),e.setAttribute("r",t.r2)}else(e=src_util_dom_domChild(e,r++,"linearGradient",A_)).setAttribute("id",t.id),e.setAttribute("x1",t.x1),e.setAttribute("x2",t.x2),e.setAttribute("y1",t.y1),e.setAttribute("y2",t.y2);for(n=0,i=t.stops.length;n<i;++n)(a=src_util_dom_domChild(e,n,"stop",A_)).setAttribute("offset",t.stops[n].offset),a.setAttribute("stop-color",t.stops[n].color);return src_util_dom_domClear(e,n),r}function vega_scenegraph_src_SVGRenderer_updateClipping(e,t,r){var n;return(e=src_util_dom_domChild(e,r,"clipPath",A_)).setAttribute("id",t.id),t.path?(n=src_util_dom_domChild(e,0,"path",A_)).setAttribute("d",t.path):((n=src_util_dom_domChild(e,0,"rect",A_)).setAttribute("x",0),n.setAttribute("y",0),n.setAttribute("width",t.width),n.setAttribute("height",t.height)),r+1}function vega_scenegraph_src_SVGRenderer_dirtyParents(e,t){for(;e&&e.dirty!==t;e=e.mark.group){if(e.dirty=t,!e.mark||e.mark.dirty===t)return;e.mark.dirty=t}}function node_modules_vega_scenegraph_src_SVGRenderer_bind(e,t,r,n,i){var a,o=e._svg;if(!o&&(o=src_util_dom_domCreate(a=t.ownerDocument,n,A_),e._svg=o,e.mark&&(o.__data__=e,o.__values__={fill:"default"},"g"===n))){var s=src_util_dom_domCreate(a,"path",A_);s.setAttribute("class","background"),o.appendChild(s),s.__data__=e;var u=src_util_dom_domCreate(a,"g",A_);o.appendChild(u),u.__data__=e}return(o.ownerSVGElement!==i||function vega_scenegraph_src_SVGRenderer_hasSiblings(e){var t=e.mark||e.group;return t&&t.items.length>1}(e)&&o.previousSibling!==r)&&t.insertBefore(o,r?r.nextSibling:t.firstChild),o}R_.initialize=function(e,t,r,n){return e&&(this._svg=src_util_dom_domChild(e,0,"svg",A_),this._svg.setAttribute("class","marks"),src_util_dom_domClear(e,1),this._root=src_util_dom_domChild(this._svg,0,"g",A_),src_util_dom_domClear(this._svg,1)),this._defs={gradient:{},clipping:{}},this.background(this._bgcolor),D_.initialize.call(this,e,t,r,n)},R_.background=function(e){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",e),D_.background.apply(this,arguments)},R_.resize=function(e,t,r,n){return D_.resize.call(this,e,t,r,n),this._svg&&(this._svg.setAttribute("width",this._width*this._scale),this._svg.setAttribute("height",this._height*this._scale),this._svg.setAttribute("viewBox","0 0 "+this._width+" "+this._height),this._root.setAttribute("transform","translate("+this._origin+")")),this._dirty=[],this},R_.canvas=function(){return this._svg},R_.svg=function(){if(!this._svg)return null;var e={class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 "+this._width+" "+this._height};for(var t in C_)e[t]=C_[t];var r=this._bgcolor?src_util_tags_openTag("rect",{width:this._width,height:this._height,style:"fill: "+this._bgcolor+";"})+src_util_tags_closeTag("rect"):"";return src_util_tags_openTag("svg",e)+r+this._svg.innerHTML+src_util_tags_closeTag("svg")},R_._render=function(e){return this._dirtyCheck()&&(this._dirtyAll&&this._resetDefs(),this.draw(this._root,e),src_util_dom_domClear(this._root,1)),this.updateDefs(),this._dirty=[],++this._dirtyID,this},R_.updateDefs=function(){var e,t=this._svg,r=this._defs,n=r.el,i=0;for(e in r.gradient)n||(r.el=n=src_util_dom_domChild(t,0,"defs",A_)),i=vega_scenegraph_src_SVGRenderer_updateGradient(n,r.gradient[e],i);for(e in r.clipping)n||(r.el=n=src_util_dom_domChild(t,0,"defs",A_)),i=vega_scenegraph_src_SVGRenderer_updateClipping(n,r.clipping[e],i);n&&(0===i?(t.removeChild(n),r.el=null):src_util_dom_domClear(n,i))},R_._resetDefs=function(){var e=this._defs;e.gradient={},e.clipping={}},R_.dirty=function(e){e.dirty!==this._dirtyID&&(e.dirty=this._dirtyID,this._dirty.push(e))},R_.isDirty=function(e){return this._dirtyAll||!e._svg||e.dirty===this._dirtyID},R_._dirtyCheck=function(){this._dirtyAll=!0;var e=this._dirty;if(!e.length)return!0;var t,r,n,i,a,o,s,u=++this._dirtyID;for(a=0,o=e.length;a<o;++a)(r=(t=e[a]).mark).marktype!==n&&(n=r.marktype,i=c_[n]),r.zdirty&&r.dirty!==u&&(this._dirtyAll=!1,vega_scenegraph_src_SVGRenderer_dirtyParents(t,u),r.items.forEach((function(e){e.dirty=u}))),r.zdirty||(t.exit?(i.nested&&r.items.length?(s=r.items[0])._svg&&this._update(i,s._svg,s):t._svg&&(s=t._svg.parentNode)&&s.removeChild(t._svg),t._svg=null):(t=i.nested?r.items[0]:t)._update!==u&&(t._svg&&t._svg.ownerSVGElement?this._update(i,t._svg,t):(this._dirtyAll=!1,vega_scenegraph_src_SVGRenderer_dirtyParents(t,u)),t._update=u));return!this._dirtyAll},R_.draw=function(e,t,r){if(!this.isDirty(t))return t._svg;var n,i=this,a=this._svg,o=c_[t.marktype],s=!1===t.interactive?"none":null,u="g"===o.tag,l=null,c=0;function process(e){var t=i.isDirty(e),r=node_modules_vega_scenegraph_src_SVGRenderer_bind(e,n,l,o.tag,a);t&&(i._update(o,r,e),u&&function node_modules_vega_scenegraph_src_SVGRenderer_recurse(e,t,r){t=t.lastChild;var n,i=0;vega_scenegraph_src_util_visit_visit(r,(function(r){n=e.draw(t,r,n),++i})),src_util_dom_domClear(t,1+i)}(i,r,e)),l=r,++c}return(n=node_modules_vega_scenegraph_src_SVGRenderer_bind(t,e,r,"g",a)).setAttribute("class",src_util_dom_cssClass(t)),u||n.style.setProperty("pointer-events",s),t.clip?n.setAttribute("clip-path",Xy(i,t,t.group)):n.removeAttribute("clip-path"),o.nested?t.items.length&&process(t.items[0]):vega_scenegraph_src_util_visit_visit(t,process),src_util_dom_domClear(n,c),n};var P_=null,j_=null,M_={group:function group(e,t,r){j_=t.__values__,P_=t.childNodes[1],e.foreground(node_modules_vega_scenegraph_src_SVGRenderer_emit,r,this),P_=t.childNodes[0],e.background(node_modules_vega_scenegraph_src_SVGRenderer_emit,r,this);var n=!1===r.mark.interactive?"none":null;n!==j_.events&&(P_.style.setProperty("pointer-events",n),j_.events=n)},text:function text(e,t,r){var n;(n=src_util_text_textValue(r))!==j_.text&&(t.textContent=n,j_.text=n),vega_scenegraph_src_SVGRenderer_setStyle(t,"font-family",src_util_text_fontFamily(r)),vega_scenegraph_src_SVGRenderer_setStyle(t,"font-size",vega_scenegraph_src_util_text_fontSize(r)+"px"),vega_scenegraph_src_SVGRenderer_setStyle(t,"font-style",r.fontStyle),vega_scenegraph_src_SVGRenderer_setStyle(t,"font-variant",r.fontVariant),vega_scenegraph_src_SVGRenderer_setStyle(t,"font-weight",r.fontWeight)}};function vega_scenegraph_src_SVGRenderer_setStyle(e,t,r){r!==j_[t]&&(null==r?e.style.removeProperty(t):e.style.setProperty(t,r+""),j_[t]=r)}function node_modules_vega_scenegraph_src_SVGRenderer_emit(e,t,r){t!==j_[e]&&(null!=t?r?P_.setAttributeNS(r,e,t):P_.setAttribute(e,t):r?P_.removeAttributeNS(r,e):P_.removeAttribute(e),j_[e]=t)}function node_modules_vega_scenegraph_src_SVGRenderer_href(){var e;return"undefined"===typeof window?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}function vega_scenegraph_src_SVGStringRenderer_SVGStringRenderer(e){node_modules_vega_scenegraph_src_Renderer_Renderer.call(this,e),this._text={head:"",bg:"",root:"",foot:"",defs:"",body:""},this._defs={gradient:{},clipping:{}}}R_._update=function(e,t,r){P_=t,j_=t.__values__,e.attr(node_modules_vega_scenegraph_src_SVGRenderer_emit,r,this);var n=M_[e.type];n&&n.call(this,e,t,r),this.style(P_,r)},R_.style=function(e,t){var r,n,i,a,o;if(null!=t)for(r=0,n=O_.length;r<n;++r)o=t[i=O_[r]],"font"===i&&(o=src_util_text_fontFamily(t)),o!==j_[i]&&(a=T_[i],null==o?"fill"===a?e.style.setProperty(a,"none"):e.style.removeProperty(a):(vega_scenegraph_src_Gradient_isGradient(o)&&(o=vega_scenegraph_src_Gradient_gradientRef(o,this._defs.gradient,node_modules_vega_scenegraph_src_SVGRenderer_href())),e.style.setProperty(a,o+"")),j_[i]=o)};var F_,I_=Object(V.y)(vega_scenegraph_src_SVGStringRenderer_SVGStringRenderer,node_modules_vega_scenegraph_src_Renderer_Renderer),L_=node_modules_vega_scenegraph_src_Renderer_Renderer.prototype;function node_modules_vega_scenegraph_src_SVGStringRenderer_emit(e,t,r,n){F_[n||e]=t}function vega_scenegraph_src_SVGStringRenderer_applyStyles(e,t,r,n){if(null==e)return"";var i,a,o,s,u,l="";for("bgrect"===r&&!1===t.interactive&&(l+="pointer-events: none; "),"text"===r&&(l+="font-family: "+src_util_text_fontFamily(e)+"; ",l+="font-size: "+vega_scenegraph_src_util_text_fontSize(e)+"px; ",e.fontStyle&&(l+="font-style: "+e.fontStyle+"; "),e.fontVariant&&(l+="font-variant: "+e.fontVariant+"; "),e.fontWeight&&(l+="font-weight: "+e.fontWeight+"; ")),i=0,a=O_.length;i<a;++i)o=O_[i],s=T_[o],null==(u=e[o])?"fill"===s&&(l+="fill: none; "):"transparent"!==u||"fill"!==s&&"stroke"!==s?(vega_scenegraph_src_Gradient_isGradient(u)&&(u=vega_scenegraph_src_Gradient_gradientRef(u,n.gradient,"")),l+=s+": "+u+"; "):l+=s+": none; ";return l?'style="'+l.trim()+'"':null}I_.resize=function(e,t,r,n){L_.resize.call(this,e,t,r,n);var i=this._origin,a=this._text,o={class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 "+this._width+" "+this._height};for(var s in C_)o[s]=C_[s];a.head=src_util_tags_openTag("svg",o);var u=this._bgcolor;return"transparent"!==u&&"none"!==u||(u=null),a.bg=u?src_util_tags_openTag("rect",{width:this._width,height:this._height,style:"fill: "+u+";"})+src_util_tags_closeTag("rect"):"",a.root=src_util_tags_openTag("g",{transform:"translate("+i+")"}),a.foot=src_util_tags_closeTag("g")+src_util_tags_closeTag("svg"),this},I_.background=function(){var e=L_.background.apply(this,arguments);return arguments.length&&this._text.head&&this.resize(this._width,this._height,this._origin,this._scale),e},I_.svg=function(){var e=this._text;return e.head+e.bg+e.defs+e.root+e.body+e.foot},I_._render=function(e){return this._text.body=this.mark(e),this._text.defs=this.buildDefs(),this},I_.buildDefs=function(){var e,t,r,n,i,a=this._defs,o="";for(t in a.gradient){for(i=(r=a.gradient[t]).stops,"radial"===r.gradient?(o+=src_util_tags_openTag(n="pattern",{id:ny+t,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),o+=src_util_tags_openTag("rect",{width:"1",height:"1",fill:"url(#"+t+")"})+src_util_tags_closeTag("rect"),o+=src_util_tags_closeTag(n),o+=src_util_tags_openTag(n="radialGradient",{id:t,fx:r.x1,fy:r.y1,fr:r.r1,cx:r.x2,cy:r.y2,r:r.r2})):o+=src_util_tags_openTag(n="linearGradient",{id:t,x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2}),e=0;e<i.length;++e)o+=src_util_tags_openTag("stop",{offset:i[e].offset,"stop-color":i[e].color})+src_util_tags_closeTag("stop");o+=src_util_tags_closeTag(n)}for(t in a.clipping)r=a.clipping[t],o+=src_util_tags_openTag("clipPath",{id:t}),r.path?o+=src_util_tags_openTag("path",{d:r.path})+src_util_tags_closeTag("path"):o+=src_util_tags_openTag("rect",{x:0,y:0,width:r.width,height:r.height})+src_util_tags_closeTag("rect"),o+=src_util_tags_closeTag("clipPath");return o.length>0?src_util_tags_openTag("defs")+o+src_util_tags_closeTag("defs"):""},I_.attributes=function(e,t){return F_={},e(node_modules_vega_scenegraph_src_SVGStringRenderer_emit,t,this),F_},I_.href=function(e){var t,r=this,n=e.href;if(n){if(t=r._hrefs&&r._hrefs[n])return t;r.sanitizeURL(n).then((function(e){e["xlink:href"]=e.href,e.href=null,(r._hrefs||(r._hrefs={}))[n]=e}))}return null},I_.mark=function(e){var t,r=this,n=c_[e.marktype],i=n.tag,a=this._defs,o="";function process(s){var u=r.href(s);u&&(o+=src_util_tags_openTag("a",u)),t="g"!==i?vega_scenegraph_src_SVGStringRenderer_applyStyles(s,e,i,a):null,o+=src_util_tags_openTag(i,r.attributes(n.attr,s),t),"text"===i?o+=function vega_scenegraph_src_SVGStringRenderer_escape_text(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}(src_util_text_textValue(s)):"g"===i&&(o+=src_util_tags_openTag("path",r.attributes(n.background,s),vega_scenegraph_src_SVGStringRenderer_applyStyles(s,e,"bgrect",a))+src_util_tags_closeTag("path"),o+=src_util_tags_openTag("g",r.attributes(n.foreground,s))+r.markGroup(s)+src_util_tags_closeTag("g")),o+=src_util_tags_closeTag(i),u&&(o+=src_util_tags_closeTag("a"))}return"g"!==i&&!1===e.interactive&&(t='style="pointer-events: none;"'),o+=src_util_tags_openTag("g",{class:src_util_dom_cssClass(e),"clip-path":e.clip?Xy(r,e,e.group):null},t),n.nested?e.items&&e.items.length&&process(e.items[0]):vega_scenegraph_src_util_visit_visit(e,process),o+src_util_tags_closeTag("g")},I_.markGroup=function(e){var t=this,r="";return vega_scenegraph_src_util_visit_visit(e,(function(e){r+=t.mark(e)})),r};var N_={};function vega_scenegraph_src_intersect_intersectMark(e,t,r,n){if(function vega_scenegraph_src_intersect_visitMark(e,t,r){return e.bounds&&t.intersects(e.bounds)&&("group"===e.marktype||!1!==e.interactive&&(!r||r(e)))}(e,t,r)){var i=e.items,a=e.marktype,o=i.length,s=0;if("group"===a)for(;s<o;++s)vega_scenegraph_src_intersect_intersectGroup(i[s],t,r,n);else for(var u=c_[a].isect;s<o;++s){var l=i[s];vega_scenegraph_src_intersect_intersectItem(l,t,u)&&n.push(l)}}return n}function vega_scenegraph_src_intersect_intersectGroup(e,t,r,n){r&&r(e.mark)&&vega_scenegraph_src_intersect_intersectItem(e,t,c_.group.isect)&&n.push(e);var i=e.items,a=i&&i.length;if(a){var o=e.x||0,s=e.y||0;t.translate(-o,-s);for(var u=0;u<a;++u)vega_scenegraph_src_intersect_intersectMark(i[u],t,r,n);t.translate(o,s)}return n}function vega_scenegraph_src_intersect_intersectItem(e,t,r){var n=e.bounds;return t.encloses(n)||t.intersects(n)&&r(e,t)}N_.canvas=N_.png={renderer:vega_scenegraph_src_CanvasRenderer_CanvasRenderer,headless:vega_scenegraph_src_CanvasRenderer_CanvasRenderer,handler:vega_scenegraph_src_CanvasHandler_CanvasHandler},N_.svg={renderer:vega_scenegraph_src_SVGRenderer_SVGRenderer,headless:vega_scenegraph_src_SVGStringRenderer_SVGStringRenderer,handler:vega_scenegraph_src_SVGHandler_SVGHandler},N_.none={};new vega_scenegraph_src_Bounds_Bounds;function src_log_log(e,t,r){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(r)))}catch(n){e.warn(n)}return r[r.length-1]}function equal(e,t){return e===t||e!==e&&t!==t||(Object(V.A)(e)?!(!Object(V.A)(t)||e.length!==t.length)&&function equalArray(e,t){for(var r=0,n=e.length;r<n;++r)if(!equal(e[r],t[r]))return!1;return!0}(e,t):!(!Object(V.F)(e)||!Object(V.F)(t))&&equalObject(e,t))}function equalObject(e,t){for(var r in e)if(!equal(e[r],t[r]))return!1;return!0}function removePredicate(e){return function(t){return equalObject(e,t)}}var B_={};function tree_datum(e){return e.data}function treeNodes(e,t){var r=src_data_data.call(t,e);return r.root&&r.root.lookup||B_}var U_="undefined"!==typeof window&&window||null;var z_=":",q_="@",W_="%";function dataVisitor(e,t,r,n){t[0].type!==Gm&&Object(V.n)("First argument to data functions must be a string literal.");var i=t[0].value,a=z_+i;if(!Object(V.v)(a,n))try{n[a]=r.getData(i).tuplesRef()}catch(o){}}function scaleVisitor(e,t,r,n){if(t[0].type===Gm)addScaleDependency(r,n,t[0].value);else if(t[0].type===Vm)for(e in r.scales)addScaleDependency(r,n,e)}function addScaleDependency(e,t,r){var n=W_+r;if(!Object(V.v)(t,n))try{t[n]=e.scaleRef(r)}catch(i){}}var G_={random:function random(){return kt()},isArray:V.A,isBoolean:V.B,isDate:V.C,isDefined:function isDefined(e){return void 0!==e},isNumber:V.E,isObject:V.F,isRegExp:V.G,isString:V.H,isTuple:isTuple,isValid:function isValid(e){return null!=e&&e===e},toBoolean:V.Y,toDate:V.Z,toNumber:V.ab,toString:V.cb,flush:V.u,lerp:V.J,merge:function(){var e=[].slice.call(arguments);return e.unshift({}),V.o.apply(null,e)},pad:V.N,peek:V.S,span:V.V,inrange:V.z,truncate:V.db,rgb:color_rgb,lab:lab,hcl:hcl,hsl:hsl,sequence:dr,format:function format_format(e,t){return formatter("format",Do,t)(e)},utcFormat:function format_utcFormat(e,t){return formatter("utcFormat",nt,t)(e)},utcParse:function format_utcParse(e,t){return formatter("utcParse",it,t)(e)},timeFormat:format_timeFormat,timeParse:function format_timeParse(e,t){return formatter("timeParse",rt,t)(e)},monthFormat:function monthFormat(e){return format_time(e,1,"%B")},monthAbbrevFormat:function monthAbbrevFormat(e){return format_time(e,1,"%b")},dayFormat:function dayFormat(e){return format_time(0,2+e,"%A")},dayAbbrevFormat:function dayAbbrevFormat(e){return format_time(0,2+e,"%a")},quarter:V.T,utcquarter:V.fb,warn:function warn(){return src_log_log(this.context.dataflow,"warn",arguments)},info:function info(){return src_log_log(this.context.dataflow,"info",arguments)},debug:function debug(){return src_log_log(this.context.dataflow,"debug",arguments)},extent:V.p,inScope:function(e){var t=this.context.group,r=!1;if(t)for(;e;){if(e===t){r=!0;break}e=e.mark.group}return r},intersect:function(e,t,r){if(!e)return[];var n=Object(qt.a)(e,2),i=n[0],a=n[1],o=(new vega_scenegraph_src_Bounds_Bounds).set(i[0],i[1],a[0],a[1]);return function node_modules_vega_scenegraph_src_intersect_intersect(e,t,r){var n=[],i=(new vega_scenegraph_src_Bounds_Bounds).union(t),a=e.marktype;return a?vega_scenegraph_src_intersect_intersectMark(e,i,r,n):"group"===a?vega_scenegraph_src_intersect_intersectGroup(e,i,r,n):Object(V.n)("Intersect scene must be mark node or group item.")}(r||this.context.dataflow.scenegraph().root,o,function intersect_filter(e){var t=null;if(e){var r=Object(V.i)(e.marktype),n=Object(V.i)(e.markname);t=function p(e){return(!r.length||r.some((function(t){return e.marktype===t})))&&(!n.length||n.some((function(t){return e.name===t})))}}return t}(t))},clampRange:V.j,pinchDistance:function pinchDistance(e){var t=e.touches,r=t[0].clientX-t[1].clientX,n=t[0].clientY-t[1].clientY;return Math.sqrt(r*r+n*n)},pinchAngle:function pinchAngle(e){var t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)},screen:function screen(){return U_?U_.screen:{}},containerSize:function containerSize(){var e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]},windowSize:function windowSize(){return U_?[U_.innerWidth,U_.innerHeight]:[void 0,void 0]},bandspace:function bandspace(e,t,r){return Da(e||0,t||0,r||0)},setdata:function setdata(e,t){var r=this.context.dataflow,n=this.context.data[e].input;return r.pulse(n,r.changeset().remove(V.eb).insert(t)),1},pathShape:function pathShape(e){var t=null;return function(r){return r?Ey(r,t=t||gy(e)):e}},panLinear:V.O,panLog:V.P,panPow:V.Q,panSymlog:V.R,zoomLinear:V.ib,zoomLog:V.jb,zoomPow:V.kb,zoomSymlog:V.lb,encode:function(e,t,r){if(e){var n=this.context.dataflow,i=e.mark.source;n.pulse(i,n.changeset().encode(e,t))}return void 0!==r?r:e},modify:function(e,t,r,n,i,a){var o,s,u=this.context.dataflow,l=this.context.data[e],c=l.input,f=l.changes,d=u.stamp();if(!1===u._trigger||!(c.value.length||t||n))return 0;if((!f||f.stamp<d)&&(l.changes=f=u.changeset(),f.stamp=d,u.runAfter((function(){l.modified=!0,u.pulse(c,f).run()}),!0,1)),r&&(o=!0===r?V.eb:Object(V.A)(r)||isTuple(r)?r:removePredicate(r),f.remove(o)),t&&f.insert(t),n&&(o=removePredicate(n),c.value.some(o)?f.remove(o):f.insert(n)),i)for(s in a)f.modify(i,s,a[s]);return 1}},H_=["view","item","group","xy","x","y"],V_="event.vega.",Y_="this.",$_={};function expressionFunction(e,t,r){return 1===arguments.length?G_[e]:(G_[e]=t,r&&($_[e]=r),K_&&(K_.functions[e]=Y_+e),this)}expressionFunction("bandwidth",(function scale_bandwidth(e,t){var r=getScale(e,(t||this).context);return r&&r.bandwidth?r.bandwidth():0}),scaleVisitor),expressionFunction("copy",(function scale_copy(e,t){var r=getScale(e,(t||this).context);return r?r.copy():void 0}),scaleVisitor),expressionFunction("domain",(function scale_domain(e,t){var r=getScale(e,(t||this).context);return r?r.domain():[]}),scaleVisitor),expressionFunction("range",(function scale_range(e,t){var r=getScale(e,(t||this).context);return r&&r.range?r.range():[]}),scaleVisitor),expressionFunction("invert",(function scale_invert(e,t,r){var n=getScale(e,(r||this).context);return n?Object(V.A)(t)?(n.invertRange||n.invert)(t):(n.invert||n.invertExtent)(t):void 0}),scaleVisitor),expressionFunction("scale",(function scale_scale(e,t,r){var n=getScale(e,(r||this).context);return n&&void 0!==t?n(t):void 0}),scaleVisitor),expressionFunction("gradient",(function(e,t,r,n,i){e=getScale(e,(i||this).context);var a=function(e,t){var r,n=[];return r={gradient:"linear",x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:n,stop:function stop(e,t){return n.push({offset:e,color:t}),r}}}(t,r),o=e.domain(),s=o[0],u=Object(V.S)(o),l=V.x;return u-s?l=scaleFraction(e,s,u):e=(e.interpolator?scales_scale("sequential")().interpolator(e.interpolator()):scales_scale("linear")().interpolate(e.interpolate()).range(e.range())).domain([s=0,u=1]),e.ticks&&(s!==(o=e.ticks(+n||15))[0]&&o.unshift(s),u!==Object(V.S)(o)&&o.push(u)),o.forEach((function(t){return a.stop(l(t),e(t))})),a}),scaleVisitor),expressionFunction("geoArea",Qv,scaleVisitor),expressionFunction("geoBounds",Zv,scaleVisitor),expressionFunction("geoCentroid",ey,scaleVisitor),expressionFunction("geoShape",(function geoShape(e,t,r){var n=getScale(e,(r||this).context);return function(e){return n?n.path.context(e)(t):""}}),scaleVisitor),expressionFunction("indata",(function indata(e,t,r){var n=this.context.data[e]["index:"+t],i=n?n.value.get(r):void 0;return i?i.count:i}),(function indataVisitor(e,t,r,n){t[0].type!==Gm&&Object(V.n)("First argument to indata must be a string literal."),t[1].type!==Gm&&Object(V.n)("Second argument to indata must be a string literal.");var i=t[0].value,a=t[1].value,o=q_+a;Object(V.v)(o,n)||(n[o]=r.getData(i).indataRef(r,a))})),expressionFunction("data",src_data_data,dataVisitor),expressionFunction("treePath",(function treePath(e,t,r){var n=treeNodes(e,this),i=n[t],a=n[r];return i&&a?i.path(a).map(tree_datum):void 0}),dataVisitor),expressionFunction("treeAncestors",(function treeAncestors(e,t){var r=treeNodes(e,this)[t];return r?r.ancestors().map(tree_datum):void 0}),dataVisitor),expressionFunction("vlSelectionTest",(function selectionTest(e,t,r){for(var n,i,a,o,s,u=this.context.data[e],l=u?u.values.value:[],c=u?u[Vv]&&u[Vv].value:void 0,f=r===Bv,d=l.length,h=0;h<d;++h)if(n=l[h],c&&f){if(-1===(a=(i=i||{})[o=n.unit]||0))continue;if(s=testPoint(t,n),i[o]=s?-1:++a,s&&1===c.size)return!0;if(!s&&a===c.get(o).count)return!1}else if(f^(s=testPoint(t,n)))return s;return d&&f}),selectionVisitor),expressionFunction("vlSelectionResolve",(function selectionResolve(e,t){for(var r,n,i,a,o,s,u,l,c,f,d,h=this.context.data[e],p=h?h.values.value:[],g={},m={},v=p.length,y=0;y<v;++y)for(a=(r=p[y]).unit,n=r.fields,i=r.values,f=0,d=n.length;f<d;++f)o=n[f],u=(s=g[o.field]||(g[o.field]={}))[a]||(s[a]=[]),m[o.field]=l=o.type.charAt(0),c=Yv[l+"_union"],s[a]=c(u,Object(V.i)(i[f]));return t=t||Uv,Object.keys(g).forEach((function(e){g[e]=Object.keys(g[e]).map((function(t){return g[e][t]})).reduce((function(r,n){return void 0===r?n:Yv[m[e]+"_"+t](r,n)}))})),g}),selectionVisitor);var X_={blacklist:["_"],whitelist:["datum","event","item"],fieldvar:"datum",globalvar:function globalvar(e){return"_["+Object(V.X)("$"+e)+"]"},functions:function buildFunctions(e){var t=Nv(e);for(var r in H_.forEach((function(e){return t[e]=V_+e})),G_)t[r]=Y_+r;return t},constants:Lv,visitors:$_},K_=function(e){var t=(e=e||{}).whitelist?Object(V.bb)(e.whitelist):{},r=e.blacklist?Object(V.bb)(e.blacklist):{},n=e.constants||Lv,i=(e.functions||Nv)(visit),a=e.globalvar,o=e.fieldvar,s={},u={},l=0,c=Object(V.D)(a)?a:function(e){return a+'["'+e+'"]'};function visit(e){if(Object(V.H)(e))return e;var t=f[e.type];return null==t&&Object(V.n)("Unsupported type: "+e.type),t(e)}var f={Literal:function Literal(e){return e.raw},Identifier:function Identifier(e){var i=e.name;return l>0?i:Object(V.v)(r,i)?Object(V.n)("Illegal identifier: "+i):Object(V.v)(n,i)?n[i]:Object(V.v)(t,i)?i:(s[i]=1,c(i))},MemberExpression:function MemberExpression(e){var t=!e.computed,r=visit(e.object);t&&(l+=1);var n=visit(e.property);return r===o&&(u[function stripQuotes(e){var t=e&&e.length-1;return t&&('"'===e[0]&&'"'===e[t]||"'"===e[0]&&"'"===e[t])?e.slice(1,-1):e}(n)]=1),t&&(l-=1),r+(t?"."+n:"["+n+"]")},CallExpression:function CallExpression(e){"Identifier"!==e.callee.type&&Object(V.n)("Illegal callee type: "+e.callee.type);var t=e.callee.name,r=e.arguments,n=Object(V.v)(i,t)&&i[t];return n||Object(V.n)("Unrecognized function: "+t),Object(V.D)(n)?n(r):n+"("+r.map(visit).join(",")+")"},ArrayExpression:function ArrayExpression(e){return"["+e.elements.map(visit).join(",")+"]"},BinaryExpression:function BinaryExpression(e){return"("+visit(e.left)+e.operator+visit(e.right)+")"},UnaryExpression:function UnaryExpression(e){return"("+e.operator+visit(e.argument)+")"},ConditionalExpression:function ConditionalExpression(e){return"("+visit(e.test)+"?"+visit(e.consequent)+":"+visit(e.alternate)+")"},LogicalExpression:function LogicalExpression(e){return"("+visit(e.left)+e.operator+visit(e.right)+")"},ObjectExpression:function ObjectExpression(e){return"{"+e.properties.map(visit).join(",")+"}"},Property:function Property(e){l+=1;var t=visit(e.key);return l-=1,t+":"+visit(e.value)}};function codegen(e){var t={code:visit(e),globals:Object.keys(s),fields:Object.keys(u)};return s={},u={},t}return codegen.functions=i,codegen.constants=n,codegen}(X_);function expression_expression(e,t,r){";"!==t[t.length-1]&&(t="return("+t+");");var n=Function.apply(null,e.concat(t));return r&&r.functions?n.bind(r.functions):n}function eventExpression(e,t){return expression_expression(["event"],e,t)}function encodeExpression(e,t){return expression_expression(["item","_"],e,t)}function parseParameters(e,t,r){var n,i;for(n in r=r||{},e)i=e[n],r[n]=Object(V.A)(i)?i.map((function(e){return parseParameter(e,t,r)})):parseParameter(i,t,r);return r}function parseParameter(e,t,r){if(!e||!Object(V.F)(e))return e;for(var n,i=0,a=J_.length;i<a;++i)if(n=J_[i],Object(V.v)(e,n.key))return n.parse(e,t,r);return e}var J_=[{key:"$ref",parse:function getOperator(e,t){return t.get(e.$ref)||Object(V.n)("Operator not defined: "+e.$ref)}},{key:"$key",parse:function getKey(e,t){var r="k:"+e.$key+"_"+!!e.$flat;return t.fn[r]||(t.fn[r]=Object(V.I)(e.$key,e.$flat))}},{key:"$expr",parse:function getExpression(e,t,r){e.$params&&parseParameters(e.$params,t,r);var n="e:"+e.$expr+"_"+e.$name;return t.fn[n]||(t.fn[n]=Object(V.f)(function parameterExpression(e,t){return expression_expression(["datum","_"],e,t)}(e.$expr,t),e.$fields,e.$name))}},{key:"$field",parse:function parameters_getField(e,t){if(!e.$field)return null;var r="f:"+e.$field+"_"+e.$name;return t.fn[r]||(t.fn[r]=Object(V.t)(e.$field,e.$name))}},{key:"$encode",parse:function getEncode(e,t){var r,n,i=e.$encode,a={};for(r in i)n=i[r],a[r]=Object(V.f)(encodeExpression(n.$expr,t),n.$fields),a[r].output=n.$output;return a}},{key:"$compare",parse:function getCompare(e,t){var r="c:"+e.$compare+"_"+e.$order,n=Object(V.i)(e.$compare).map((function(e){return e&&e.$tupleid?tupleid:e}));return t.fn[r]||(t.fn[r]=Object(V.k)(n,e.$order))}},{key:"$context",parse:function parameters_getContext(e,t){return t}},{key:"$subflow",parse:function getSubflow(e,t){var r=e.$subflow;return function(e,n,i){var a=eb(r,t.fork()),o=a.get(r.operators[0].id),s=a.signals.parent;return s&&s.set(i),o}}},{key:"$tupleid",parse:function getTupleId(){return tupleid}}];function canonicalType(e){return(e+"").toLowerCase()}var Q_=function(e,t){!function isOperator(e){return"operator"===canonicalType(e)}(e.type)&&e.type?t.transform(e,e.type):t.operator(e,e.update?function operatorExpression(e,t){return expression_expression(["_"],e,t)}(e.update,t):null)};var Z_=function(e,t){var r=Object(V.F)(r=e.source)?r.$ref:r,n=t.get(r),i=null,a=e.update,o=void 0;n||Object(V.n)("Source not defined: "+e.source),i=e.target&&e.target.$expr?eventExpression(e.target.$expr,t):t.get(e.target),a&&a.$expr&&(a.$params&&(o=parseParameters(a.$params,t)),a=function handlerExpression(e,t){return expression_expression(["_","event"],e,t)}(a.$expr,t)),t.update(e,n,i,a,o)},eb=function(e,t){var r=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),r.forEach((function(e){Q_(e,t)})),r.forEach((function(e){!function parseOperatorParameters(e,t){if(e.params){var r=t.get(e.id);r||Object(V.n)("Invalid operator id: "+e.id),t.dataflow.connect(r,r.parameters(parseParameters(e.params,t),e.react,e.initonly))}}(e,t)})),(e.streams||[]).forEach((function(e){!function(e,t){var r,n=null!=e.filter?eventExpression(e.filter,t):void 0,i=null!=e.stream?t.get(e.stream):void 0;e.source?i=t.events(e.source,e.type,n):e.merge&&(i=(r=e.merge.map(t.get.bind(t)))[0].merge.apply(r[0],r.slice(1))),e.between&&(r=e.between.map(t.get.bind(t)),i=i.between(r[0],r[1])),e.filter&&(i=i.filter(n)),null!=e.throttle&&(i=i.throttle(+e.throttle)),null!=e.debounce&&(i=i.debounce(+e.debounce)),null==i&&Object(V.n)("Invalid stream definition: "+JSON.stringify(e)),e.consume&&i.consume(!0),t.stream(e,i)}(e,t)})),(e.updates||[]).forEach((function(e){Z_(e,t)})),t.resolve()},tb={skip:!0};function Context(e,t,r){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},r&&(this.functions=Object.create(r),this.functions.context=this)}function ContextFork(e){this.dataflow=e.dataflow,this.transforms=e.transforms,this.functions=e.functions,this.events=e.events,this.signals=Object.create(e.signals),this.scales=Object.create(e.scales),this.nodes=Object.create(e.nodes),this.data=Object.create(e.data),this.fn=Object.create(e.fn),e.functions&&(this.functions=Object.create(e.functions),this.functions.context=this)}Context.prototype=ContextFork.prototype={fork:function fork(){var e=new ContextFork(this);return(this.subcontext||(this.subcontext=[])).push(e),e},get:function get(e){return this.nodes[e]},set:function set(e,t){return this.nodes[e]=t},add:function add(e,t){var r,n=this,i=n.dataflow;if(n.set(e.id,t),function isCollect(e){return"collect"===canonicalType(e)}(e.type)&&(r=e.value)&&(r.$ingest?i.ingest(t,r.$ingest,r.$format):r.$request?i.preload(t,r.$request,r.$format):i.pulse(t,i.changeset().insert(r))),e.root&&(n.root=t),e.parent){var a=n.get(e.parent.$ref);a?(i.connect(a,[t]),t.targets().add(a)):(n.unresolved=n.unresolved||[]).push((function(){a=n.get(e.parent.$ref),i.connect(a,[t]),t.targets().add(a)}))}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(var o in e.data)r=n.data[o]||(n.data[o]={}),e.data[o].forEach((function(e){r[e]=t}))},resolve:function resolve(){return(this.unresolved||[]).forEach((function(e){e()})),delete this.unresolved,this},operator:function operator(e,t){this.add(e,this.dataflow.add(e.value,t))},transform:function transform(e,t){this.add(e,this.dataflow.add(this.transforms[canonicalType(t)]))},stream:function stream(e,t){this.set(e.id,t)},update:function update(e,t,r,n,i){this.dataflow.on(t,r,n,i,e.options)},getState:function getState(e){var t=this,r={};if(e.signals){var n=r.signals={};Object.keys(t.signals).forEach((function(r){var i=t.signals[r];e.signals(r,i)&&(n[r]=i.value)}))}if(e.data){var i=r.data={};Object.keys(t.data).forEach((function(r){var n=t.data[r];e.data(r,n)&&(i[r]=n.input.value)}))}return t.subcontext&&!1!==e.recurse&&(r.subcontext=t.subcontext.map((function(t){return t.getState(e)}))),r},setState:function setState(e){var t=this,r=t.dataflow,n=e.data,i=e.signals;Object.keys(i||{}).forEach((function(e){r.update(t.signals[e],i[e],tb)})),Object.keys(n||{}).forEach((function(e){r.pulse(t.data[e].input,r.changeset().remove(V.eb).insert(n[e]))})),(e.subcontext||[]).forEach((function(e,r){var n=t.subcontext[r];n&&n.setState(e)}))}};var rb=function(e,t,r){return eb(t,function(e,t,r){return new Context(e,t,r)}(e,yt,r||G_))};var nb="width",ib="height",ab="padding",ob={skip:!0};function size_viewWidth(e,t){var r=e.autosize(),n=e.padding();return t-(r&&r.contains===ab?n.left+n.right:0)}function size_viewHeight(e,t){var r=e.autosize(),n=e.padding();return t-(r&&r.contains===ab?n.top+n.bottom:0)}function dataTest(e,t){return t.modified&&Object(V.A)(t.input.value)&&e.indexOf("_:vega:_")}function signalTest(e,t){return!("parent"===e||t instanceof yt.proxy)}var sb=function(e,t,r,n){var i=e.element();i&&i.setAttribute("title",function formatTooltip(e){return null==e?"":Object(V.A)(e)?formatArray(e):Object(V.F)(e)&&!Object(V.C)(e)?function formatObject(e){return Object.keys(e).map((function(t){var r=e[t];return t+": "+(Object(V.A)(r)?formatArray(r):tooltip_formatValue(r))})).join("\n")}(e):e+""}(n))};function formatArray(e){return"["+e.map(tooltip_formatValue).join(", ")+"]"}function tooltip_formatValue(e){return Object(V.A)(e)?"[\u2026]":Object(V.F)(e)&&!Object(V.C)(e)?"{\u2026}":e}function View(e,t){t=t||{},Dataflow.call(this),t.loader&&this.loader(t.loader),t.logger&&this.logger(t.logger),null!=t.logLevel&&this.logLevel(t.logLevel),this._el=null,this._elBind=null,this._renderType=t.renderer||wm.Canvas,this._scenegraph=new src_Scenegraph_Scenegraph;var r=this._scenegraph.root;this._renderer=null,this._tooltip=t.tooltip||sb,this._redraw=!0,this._handler=(new src_CanvasHandler_CanvasHandler).scene(r),this._preventDefault=!1,this._timers=[],this._eventListeners=[],this._resizeListeners=[],this._eventConfig=function initializeEventConfig(e){var t=Object(V.o)({defaults:{}},e),r=function unpack(e,t){t.forEach((function(t){Object(V.A)(e[t])&&(e[t]=Object(V.bb)(e[t]))}))};return r(t.defaults,["prevent","allow"]),r(t,["view","window","selector"]),t}(e.eventConfig);var n=rb(this,e,t.functions);this._runtime=n,this._signals=n.signals,this._bind=(e.bindings||[]).map((function(e){return{state:null,param:Object(V.o)({},e)}})),n.root&&n.root.set(r),r.source=n.data.root.input,this.pulse(n.data.root.input,this.changeset().insert(r.items)),this._background=t.background||n.background||null,this._width=this.width(),this._height=this.height(),this._viewWidth=size_viewWidth(this,this._width),this._viewHeight=size_viewHeight(this,this._height),this._origin=[0,0],this._resize=0,this._autosize=1,function initializeResize(e){var t=e._signals,r=t[nb],n=t[ib],i=t[ab];function resetSize(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,(function(t){e._width=t.size,e._viewWidth=size_viewWidth(e,t.size),resetSize()}),{size:r}),e._resizeHeight=e.add(null,(function(t){e._height=t.size,e._viewHeight=size_viewHeight(e,t.size),resetSize()}),{size:n});var a=e.add(null,resetSize,{pad:i});e._resizeWidth.rank=r.rank+1,e._resizeHeight.rank=n.rank+1,a.rank=i.rank+1}(this),Bp(this),t.hover&&this.hover(),t.container&&this.initialize(t.container,t.bind)}var ub=Object(V.y)(View,Dataflow);function lookupSignal(e,t){return Object(V.v)(e._signals,t)?e._signals[t]:Object(V.n)("Unrecognized signal name: "+Object(V.X)(t))}function findOperatorHandler(e,t){var r=(e._targets||[]).filter((function(e){var r=e._update;return r&&r.handler===t}));return r.length?r[0]:null}function addOperatorListener(e,t,r,n){var i=findOperatorHandler(r,n);return i||((i=Im(this,(function(){n(t,r.value)}))).handler=n,e.on(r,null,i)),e}function removeOperatorListener(e,t,r){var n=findOperatorHandler(t,r);return n&&t._targets.remove(n),e}ub.evaluate=function(){var e=Object(Y.a)(A.a.mark((function _callee(e,t,r){return A.a.wrap((function _callee$(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Dataflow.prototype.evaluate.call(this,e,t);case 2:if(!this._redraw&&!this._resize){n.next=14;break}if(n.prev=3,!this._renderer){n.next=8;break}return this._resize&&(this._resize=0,resizeRenderer(this)),n.next=8,this._renderer.renderAsync(this._scenegraph.root);case 8:this._redraw=!1,n.next=14;break;case 11:n.prev=11,n.t0=n.catch(3),this.error(n.t0);case 14:return r&&$(this,r),n.abrupt("return",this);case 16:case"end":return n.stop()}}),_callee,this,[[3,11]])})));return function(t,r,n){return e.apply(this,arguments)}}(),ub.dirty=function(e){this._redraw=!0,this._renderer&&this._renderer.dirty(e)},ub.container=function(){return this._el},ub.scenegraph=function(){return this._scenegraph},ub.origin=function(){return this._origin.slice()},ub.signal=function(e,t,r){var n=lookupSignal(this,e);return 1===arguments.length?n.value:this.update(n,t,r)},ub.background=function(e){return arguments.length?(this._background=e,this._resize=1,this):this._background},ub.width=function(e){return arguments.length?this.signal("width",e):this.signal("width")},ub.height=function(e){return arguments.length?this.signal("height",e):this.signal("height")},ub.padding=function(e){return arguments.length?this.signal("padding",e):this.signal("padding")},ub.autosize=function(e){return arguments.length?this.signal("autosize",e):this.signal("autosize")},ub.renderer=function(e){return arguments.length?(src_modules_renderModule(e)||Object(V.n)("Unrecognized renderer type: "+e),e!==this._renderType&&(this._renderType=e,this._resetRenderer()),this):this._renderType},ub.tooltip=function(e){return arguments.length?(e!==this._tooltip&&(this._tooltip=e,this._resetRenderer()),this):this._tooltip},ub.loader=function(e){return arguments.length?(e!==this._loader&&(Dataflow.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},ub.resize=function(){return this._autosize=1,this.touch(lookupSignal(this,"autosize"))},ub._resetRenderer=function(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},ub._resizeView=function resizeView(e,t,r,n,i,a){this.runAfter((function(o){var s=0;o._autosize=0,o.width()!==r&&(s=1,o.signal(nb,r,ob),o._resizeWidth.skip(!0)),o.height()!==n&&(s=1,o.signal(ib,n,ob),o._resizeHeight.skip(!0)),o._viewWidth!==e&&(o._resize=1,o._viewWidth=e),o._viewHeight!==t&&(o._resize=1,o._viewHeight=t),o._origin[0]===i[0]&&o._origin[1]===i[1]||(o._resize=1,o._origin=i),s&&o.run("enter"),a&&o.runAfter((function(e){return e.resize()}))}),!1,1)},ub.addEventListener=function(e,t,r){var n=t;return r&&!1===r.trap||((n=Im(this,t)).raw=t),this._handler.on(e,n),this},ub.removeEventListener=function(e,t){for(var r,n,i=this._handler.handlers(e),a=i.length;--a>=0;)if(n=i[a].type,r=i[a].handler,e===n&&(t===r||t===r.raw)){this._handler.off(n,r);break}return this},ub.addResizeListener=function(e){var t=this._resizeListeners;return t.indexOf(e)<0&&t.push(e),this},ub.removeResizeListener=function(e){var t=this._resizeListeners,r=t.indexOf(e);return r>=0&&t.splice(r,1),this},ub.addSignalListener=function(e,t){return addOperatorListener(this,e,lookupSignal(this,e),t)},ub.removeSignalListener=function(e,t){return removeOperatorListener(this,lookupSignal(this,e),t)},ub.addDataListener=function(e,t){return addOperatorListener(this,e,dataref(this,e).values,t)},ub.removeDataListener=function(e,t){return removeOperatorListener(this,dataref(this,e).values,t)},ub.preventDefault=function(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},ub.timer=function(e,t){this._timers.push(function(e,t,r){var n=new Timer,i=t;return null==t?(n.restart(e,t,r),n):(t=+t,r=null==r?now():+r,n.restart((function tick(a){a+=i,n.restart(tick,i+=t,r),e(a)}),t,r),n)}((function tick(t){e({timestamp:Date.now(),elapsed:t})}),t))},ub.events=function events_events(e,t,r){var n,i=this,a=new EventStream(r),o=function send(r,n){i.runAsync(null,(function(){e===Em&&function prevent(e,t){var r=e._eventConfig.defaults,n=r.prevent,i=r.allow;return!1!==n&&!0!==i&&(!0===n||!1===i||(n?n[t]:i?!i[t]:e.preventDefault()))}(i,t)&&r.preventDefault(),a.receive(Sm(i,r,n))}))};if(e===Cm)permit(i,"timer",t)&&i.timer(o,t);else if(e===Em)permit(i,"view",t)&&i.addEventListener(t,o,Om);else if(e===Tm?permit(i,"window",t)&&"undefined"!==typeof window&&(n=[window]):"undefined"!==typeof document&&permit(i,"selector",t)&&(n=document.querySelectorAll(e)),n){for(var s=0,u=n.length;s<u;++s)n[s].addEventListener(t,o);i._eventListeners.push({type:t,sources:n,handler:o})}else i.warn("Can not resolve event source: "+e);return a},ub.finalize=function(){var e,t,r,n=this._tooltip,i=this._timers,a=this._eventListeners;for(e=i.length;--e>=0;)i[e].stop();for(e=a.length;--e>=0;)for(t=(r=a[e]).sources.length;--t>=0;)r.sources[t].removeEventListener(r.type,r.handler);return n&&n.call(this,this._handler,null,null,null),this},ub.hover=function(e,t){return t=[t||"update",(e=[e||"hover"])[0]],this.on(this.events("view","mouseover",itemFilter),markTarget,invoke(e)),this.on(this.events("view","mouseout",itemFilter),markTarget,invoke(t)),this},ub.data=function data_data(e,t){return arguments.length<2?dataref(this,e).values.value:change.call(this,e,ChangeSet_changeset().remove(V.eb).insert(t))},ub.change=change,ub.insert=function data_insert(e,t){return change.call(this,e,ChangeSet_changeset().insert(t))},ub.remove=function data_remove(e,t){return change.call(this,e,ChangeSet_changeset().remove(t))},ub.scale=function src_scale_scale(e){var t=this._runtime.scales;return Object(V.v)(t,e)||Object(V.n)("Unrecognized scale or projection: "+e),t[e].value},ub.initialize=function(e,t){var r,n,i=this,a=i._renderType,o=i._eventConfig.bind,s=src_modules_renderModule(a);return e=i._el=e?initialize_lookup(i,e):null,s||i.error("Unrecognized renderer type: "+a),r=s.handler||src_CanvasHandler_CanvasHandler,n=e?s.renderer:s.headless,i._renderer=n?Fm(i,i._renderer,e,n):null,i._handler=function(e,t,r,n){var i=new n(e.loader(),Im(e,e.tooltip())).scene(e.scenegraph().root).initialize(r,render_size_offset(e),e);return t&&t.handlers().forEach((function(e){i.on(e.type,e.handler)})),i}(i,i._handler,e,r),i._redraw=!0,e&&"none"!==o&&(t=t?i._elBind=initialize_lookup(i,t):e.appendChild(Am("div",{class:"vega-bindings"})),i._bind.forEach((function(e){e.param.element&&"container"!==o&&(e.element=initialize_lookup(i,e.param.element))})),i._bind.forEach((function(e){Mm(i,e.element||t,e)}))),i},ub.toImageURL=function(e,t){return render_to_image_url_ref.apply(this,arguments)},ub.toCanvas=function(e,t){return render_to_canvas_ref.apply(this,arguments)},ub.toSVG=function(e){return render_to_svg_ref.apply(this,arguments)},ub.getState=function state_getState(e){return this._runtime.getState(e||{data:dataTest,signals:signalTest,recurse:!0})},ub.setState=function state_setState(e){return this.runAsync(null,(function(t){t._trigger=!1,t._runtime.setState(e)}),(function(e){e._trigger=!0})),this};var lb=function(e,t){return e=e||t.autosize,Object(V.F)(e)?e:{type:e||"pad"}},cb=function(e,t){return e=e||t.padding,Object(V.F)(e)?{top:padding_number(e.top),bottom:padding_number(e.bottom),left:padding_number(e.left),right:padding_number(e.right)}:function paddingObject(e){return{top:e,bottom:e,left:e,right:e}}(padding_number(e))};function padding_number(e){return+e||0}var fb=["value","update","init","react","bind"];function outerError(e,t){Object(V.n)(e+' for "outer" push: '+Object(V.X)(t))}var db=function(e,t){var r=e.name;if("outer"===e.push)t.signals[r]||outerError("No prior signal definition",r),fb.forEach((function(t){void 0!==e[t]&&outerError("Invalid property ",t)}));else{var n=t.addSignal(r,e.value);!1===e.react&&(n.react=!1),e.bind&&t.addBinding(r,e.bind)}},hb=function(e,t,r){var n,i,a={};try{e=Object(V.H)(e)?e:Object(V.X)(e)+"",n=Iv(e)}catch(o){Object(V.n)("Expression parse error: "+e)}return n.visit((function visitor(e){if(e.type===Xm){var r=e.callee.name,n=X_.visitors[r];n&&n(r,e.arguments,t,a)}})),(i=K_(n)).globals.forEach((function(e){var r="$"+e;!Object(V.v)(a,r)&&t.getSignal(e)&&(a[r]=t.signalRef(e))})),{$expr:r?r+"return("+i.code+");":i.code,$fields:i.fields,$params:a}};function Entry(e,t,r,n){this.id=-1,this.type=e,this.value=t,this.params=r,n&&(this.parent=n)}function util_entry(e,t,r,n){return new Entry(e,t,r,n)}function util_operator(e,t){return util_entry("operator",e,t)}function util_ref(e){var t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function util_fieldRef(e,t){return t?{$field:e,$name:t}:{$field:e}}var pb=util_fieldRef("key");function compareRef(e,t){return{$compare:e,$order:t}}var gb="descending";function aggrField(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}var mb="scope",vb="view";function isSignal(e){return e&&e.signal}function util_hasSignal(e){if(isSignal(e))return!0;if(Object(V.F)(e))for(var t in e)if(util_hasSignal(e[t]))return!0;return!1}function util_value(e,t){return null!=e?e:t}function deref(e){return e&&e.signal||e}var yb="timer";function parseStream(e,t){return(e.merge?mergeStream:e.stream?nestedStream:e.type?eventStream:Object(V.n)("Invalid stream specification: "+Object(V.X)(e)))(e,t)}function mergeStream(e,t){var r=streamParameters({merge:e.merge.map((function(e){return parseStream(e,t)}))},e,t);return t.addStream(r).id}function nestedStream(e,t){var r=streamParameters({stream:parseStream(e.stream,t)},e,t);return t.addStream(r).id}function eventStream(e,t){var r,n;return e.type===yb?(r=t.event(yb,e.throttle),e={between:e.between,filter:e.filter}):r=t.event(function eventSource(e){return e===mb?vb:e||vb}(e.source),e.type),n=streamParameters({stream:r},e,t),1===Object.keys(n).length?r:t.addStream(n).id}function streamParameters(e,t,r){var n=t.between;return n&&(2!==n.length&&Object(V.n)('Stream "between" parameter must have 2 entries: '+Object(V.X)(t)),e.between=[parseStream(n[0],r),parseStream(n[1],r)]),n=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&n.push(function filterMark(e,t,r){var n="event.item";return n+(e&&"*"!==e?"&&"+n+".mark.marktype==='"+e+"'":"")+(r?"&&"+n+".mark.role==='"+r+"'":"")+(t?"&&"+n+".mark.name==='"+t+"'":"")}(t.marktype,t.markname,t.markrole)),t.source===mb&&n.push("inScope(event.item)"),n.length&&(e.filter=hb("("+n.join(")&&(")+")").$expr),null!=(n=t.throttle)&&(e.throttle=+n),null!=(n=t.debounce)&&(e.debounce=+n),t.consume&&(e.consume=!0),e}var _b,bb,xb=function(e,t,r){return _b=t||wb,bb=r||Pb,parseMerge(e.trim()).map(parseSelector)},wb="view",kb="[",Sb="]",Eb="{",Cb="}",Tb=":",Ob=",",Ab="@",Rb=">",Db=/[[\]{}]/,Pb={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};function event_selector_find(e,t,r,n,i){for(var a,o=0,s=e.length;t<s;++t){if(a=e[t],!o&&a===r)return t;i&&i.indexOf(a)>=0?--o:n&&n.indexOf(a)>=0&&++o}return t}function parseMerge(e){for(var t=[],r=0,n=e.length,i=0;i<n;)i=event_selector_find(e,i,Ob,kb+Eb,Sb+Cb),t.push(e.substring(r,i).trim()),r=++i;if(0===t.length)throw"Empty event selector: "+e;return t}function parseSelector(e){return"["===e[0]?function parseBetween(e){var t,r,n=e.length,i=1;if((i=event_selector_find(e,i,Sb,kb,Sb))===n)throw"Empty between selector: "+e;if(2!==(t=parseMerge(e.substring(1,i))).length)throw"Between selector must have two elements: "+e;if((e=e.slice(i+1).trim())[0]!==Rb)throw"Expected '>' after between selector: "+e;if(t=t.map(parseSelector),(r=parseSelector(e.slice(1).trim())).between)return{between:t,stream:r};r.between=t;return r}(e):function event_selector_parseStream(e){var t,r,n={source:_b},i=[],a=[0,0],o=0,s=0,u=e.length,l=0;if(e[u-1]===Cb){if(!((l=e.lastIndexOf(Eb))>=0))throw"Unmatched right brace: "+e;try{a=function parseThrottle(e){var t=e.split(Ob);if(!e.length||t.length>2)throw e;return t.map((function(t){var r=+t;if(r!==r)throw e;return r}))}(e.substring(l+1,u-1))}catch(c){throw"Invalid throttle specification: "+e}e=e.slice(0,l).trim(),u=e.length,l=0}if(!u)throw e;e[0]===Ab&&(o=++l);(t=event_selector_find(e,l,Tb))<u&&(i.push(e.substring(s,t).trim()),s=l=++t);if((l=event_selector_find(e,l,kb))===u)i.push(e.substring(s,u).trim());else if(i.push(e.substring(s,l).trim()),r=[],(s=++l)===u)throw"Unmatched left bracket: "+e;for(;l<u;){if((l=event_selector_find(e,l,Sb))===u)throw"Unmatched left bracket: "+e;if(r.push(e.substring(s,l).trim()),l<u-1&&e[++l]!==kb)throw"Expected left bracket: "+e;s=++l}if(!(u=i.length)||Db.test(i[u-1]))throw"Invalid event selector: "+e;u>1?(n.type=i[1],o?n.markname=i[0].slice(1):!function isMarkType(e){return bb[e]}(i[0])?n.source=i[0]:n.marktype=i[0]):n.type=i[0];"!"===n.type.slice(-1)&&(n.consume=!0,n.type=n.type.slice(0,-1));null!=r&&(n.filter=r);a[0]&&(n.throttle=a[0]);a[1]&&(n.debounce=a[1]);return n}(e)}var jb=function(e,t,r){var n=e.events,i=e.update,a=e.encode,o=[],s={target:r};n||Object(V.n)("Signal update missing events specification."),Object(V.H)(n)&&(n=xb(n,t.isSubscope()?mb:vb)),n=Object(V.i)(n).filter((function(e){return e.signal||e.scale?(o.push(e),0):1})),o.length>1&&(o=[mergeSources(o)]),n.length&&o.push(n.length>1?{merge:n}:n[0]),null!=a&&(i&&Object(V.n)("Signal encode and update are mutually exclusive."),i="encode(item(),"+Object(V.X)(a)+")"),s.update=Object(V.H)(i)?hb(i,t,"var datum=event.item&&event.item.datum;"):null!=i.expr?hb(i.expr,t,"var datum=event.item&&event.item.datum;"):null!=i.value?i.value:null!=i.signal?{$expr:"_.value",$params:{value:t.signalRef(i.signal)}}:Object(V.n)("Invalid signal update specification."),e.force&&(s.options={force:!0}),o.forEach((function(e){t.addUpdate(Object(V.o)(function streamSource(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):parseStream(e,t)}}(e,t),s))}))};function mergeSources(e){return{signal:"["+e.map((function(e){return e.scale?'scale("'+e.scale+'")':e.signal}))+"]"}}function transforms_transform(e){return function(t,r,n){return util_entry(e,r,t||void 0,n)}}var Mb=transforms_transform("aggregate"),Fb=transforms_transform("axisticks"),Ib=transforms_transform("bound"),Lb=transforms_transform("collect"),Nb=transforms_transform("compare"),Bb=transforms_transform("datajoin"),Ub=transforms_transform("encode"),zb=transforms_transform("expression"),qb=(transforms_transform("extent"),transforms_transform("facet")),Wb=transforms_transform("field"),Gb=transforms_transform("key"),Hb=transforms_transform("legendentries"),Vb=transforms_transform("load"),Yb=transforms_transform("mark"),$b=transforms_transform("multiextent"),Xb=transforms_transform("multivalues"),Kb=transforms_transform("overlap"),Jb=transforms_transform("params"),Qb=transforms_transform("prefacet"),Zb=transforms_transform("projection"),ex=transforms_transform("proxy"),tx=transforms_transform("relay"),rx=transforms_transform("render"),nx=transforms_transform("scale"),ix=transforms_transform("sieve"),ax=transforms_transform("sortitems"),ox=transforms_transform("viewlayout"),sx=transforms_transform("values"),ux=0,lx={min:"min",max:"max",count:"sum"};function initScale(e,t){var r=e.type||"linear";(function isValidScaleType(e){switch(e){case Pa:case ja:case Ma:case Fa:case Ia:case La:case Na:case Ba:case Ua:case qa:case Wa:case Ga:case Ha:case Va:case Ya:case $a:return!0}return!1})(r)||Object(V.n)("Unrecognized scale type: "+Object(V.X)(r)),t.addScale(e.name,{type:r,domain:void 0})}function scale_parseScale(e,t){var r,n=t.getScale(e.name).params;for(r in n.domain=parseScaleDomain(e.domain,e,t),null!=e.range&&(n.range=function parseScaleRange(e,t,r){var n=e.range,i=t.config.range;if(n.signal)return t.signalRef(n.signal);if(Object(V.H)(n)){if(i&&Object(V.v)(i,n))return e=Object(V.o)({},e,{range:i[n]}),parseScaleRange(e,t,r);"width"===n?n=[0,{signal:"width"}]:"height"===n?n=isDiscrete(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:Object(V.n)("Unrecognized scale range value: "+Object(V.X)(n))}else{if(n.scheme)return r.scheme=Object(V.A)(n.scheme)?parseArray(n.scheme,t):parseLiteral(n.scheme,t),n.extent&&(r.schemeExtent=parseArray(n.extent,t)),void(n.count&&(r.schemeCount=parseLiteral(n.count,t)));if(n.step)return void(r.rangeStep=parseLiteral(n.step,t));if(isDiscrete(e.type)&&!Object(V.A)(n))return parseScaleDomain(n,e,t);Object(V.A)(n)||Object(V.n)("Unsupported range type: "+Object(V.X)(n))}return n.map((function(e){return(Object(V.A)(e)?parseArray:parseLiteral)(e,t)}))}(e,t,n)),null!=e.interpolate&&function parseScaleInterpolate(e,t){t.interpolate=parseLiteral(e.type||e),null!=e.gamma&&(t.interpolateGamma=parseLiteral(e.gamma))}(e.interpolate,n),null!=e.nice&&(n.nice=function parseScaleNice(e){return Object(V.F)(e)?{interval:parseLiteral(e.interval),step:parseLiteral(e.step)}:parseLiteral(e)}(e.nice)),null!=e.bins&&(n.bins=function parseScaleBins(e,t){return e.signal||Object(V.A)(e)?parseArray(e,t):t.objectProperty(e)}(e.bins,t)),e)Object(V.v)(n,r)||"name"===r||(n[r]=parseLiteral(e[r],t))}function parseLiteral(e,t){return Object(V.F)(e)?e.signal?t.signalRef(e.signal):Object(V.n)("Unsupported object: "+Object(V.X)(e)):e}function parseArray(e,t){return e.signal?t.signalRef(e.signal):e.map((function(e){return parseLiteral(e,t)}))}function dataLookupError(e){Object(V.n)("Can not find data set: "+Object(V.X)(e))}function parseScaleDomain(e,t,r){if(e)return e.signal?r.signalRef(e.signal):(Object(V.A)(e)?explicitDomain:e.fields?multipleDomain:singularDomain)(e,t,r);null==t.domainMin&&null==t.domainMax||Object(V.n)("No scale domain defined for domainMin/domainMax to override.")}function explicitDomain(e,t,r){return e.map((function(e){return parseLiteral(e,r)}))}function singularDomain(e,t,r){var n=r.getData(e.data);return n||dataLookupError(e.data),isDiscrete(t.type)?n.valuesRef(r,e.field,parseSort(e.sort,!1)):isQuantile(t.type)?n.domainRef(r,e.field):n.extentRef(r,e.field)}function multipleDomain(e,t,r){var n=e.data,i=e.fields.reduce((function(e,t){return t=Object(V.H)(t)?{data:n,field:t}:Object(V.A)(t)||t.signal?function scale_fieldRef(e,t){var r="_:vega:_"+ux++,n=Lb({});if(Object(V.A)(e))n.value={$ingest:e};else if(e.signal){var i="setdata("+Object(V.X)(r)+","+e.signal+")";n.params.input=t.signalRef(i)}return t.addDataPipeline(r,[n,ix({})]),{data:r,field:"data"}}(t,r):t,e.push(t),e}),[]);return(isDiscrete(t.type)?ordinalMultipleDomain:isQuantile(t.type)?quantileMultipleDomain:numericMultipleDomain)(e,r,i)}function ordinalMultipleDomain(e,t,r){var n,i,a,o,s,u=parseSort(e.sort,!0);return n=r.map((function(e){var r=t.getData(e.data);return r||dataLookupError(e.data),r.countsRef(t,e.field,u)})),i={groupby:pb,pulse:n},u&&(a=u.op||"count",s=u.field?aggrField(a,u.field):"count",i.ops=[lx[a]],i.fields=[t.fieldRef(s)],i.as=[s]),a=t.add(Mb(i)),o=t.add(Lb({pulse:util_ref(a)})),s=t.add(sx({field:pb,sort:t.sortRef(u),pulse:util_ref(o)})),util_ref(s)}function parseSort(e,t){return e&&(e.field||e.op?e.field||"count"===e.op?t&&e.field&&e.op&&!lx[e.op]&&Object(V.n)("Multiple domain scales can not be sorted using "+e.op):Object(V.n)("No field provided for sort aggregate op: "+e.op):Object(V.F)(e)?e.field="key":e={field:"key"}),e}function quantileMultipleDomain(e,t,r){var n=r.map((function(e){var r=t.getData(e.data);return r||dataLookupError(e.data),r.domainRef(t,e.field)}));return util_ref(t.add(Xb({values:n})))}function numericMultipleDomain(e,t,r){var n=r.map((function(e){var r=t.getData(e.data);return r||dataLookupError(e.data),r.extentRef(t,e.field)}));return util_ref(t.add($b({extents:n})))}function projection_parseParameter(e,t,r){return Object(V.A)(e)?e.map((function(e){return projection_parseParameter(e,t,r)})):Object(V.F)(e)?e.signal?r.signalRef(e.signal):"fit"===t?e:Object(V.n)("Unsupported parameter object: "+Object(V.X)(e)):e}var cx="vertical",fx="start",dx="end",hx="value",px="guide-label",gx="group-title",mx="symbol",vx="gradient",yx="discrete",_x=["size","shape","fill","stroke","strokeWidth","strokeDash","opacity"],bx={name:1,interactive:1},xx={value:0},wx={value:1},kx=Object(V.bb)(["rule"]),Sx=Object(V.bb)(["group","image","rect"]),Ex=function(e,t){var r="";return kx[t]?r:(e.x2&&(e.x?(Sx[t]&&(r+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),r+="o.width=o.x2-o.x;"):r+="o.x=o.x2-(o.width||0);"),e.xc&&(r+="o.x=o.xc-(o.width||0)/2;"),e.y2&&(e.y?(Sx[t]&&(r+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),r+="o.height=o.y2-o.y;"):r+="o.y=o.y2-(o.height||0);"),e.yc&&(r+="o.y=o.yc-(o.height||0)/2;"),r)},Cx=function(e,t,r,n){var i=hb(e,t);return i.$fields.forEach((function(e){n[e]=1})),Object(V.o)(r,i.$params),i.$expr},Tx=function(e,t,r,n){return function field_resolve(e,t,r,n){var i,a,o;if(e.signal)i="datum",o=Cx(e.signal,t,r,n);else if(e.group||e.parent){for(a=Math.max(1,e.level||1),i="item";a-- >0;)i+=".mark.group";e.parent?(o=e.parent,i+=".datum"):o=e.group}else e.datum?(i="datum",o=e.datum):Object(V.n)("Invalid field reference: "+Object(V.X)(e));e.signal||(Object(V.H)(o)?(n[o]=1,o=Object(V.W)(o).map(V.X).join("][")):o=field_resolve(o,t,r,n));return i+"["+o+"]"}(Object(V.F)(e)?e:{datum:e},t,r,n)};var Ox=function(e,t,r,n,i){var a,o,s,u=scale_getScale(e.scale,r,n,i);return null!=e.range?(o=u+".range()",t=0===(a=+e.range)?o+"[0]":"($="+o+","+(1===a?"$[$.length-1]":"$[0]+"+a+"*($[$.length-1]-$[0])")+")"):(void 0!==t&&(t=u+"("+t+")"),e.band&&(s=function hasBandwidth(e,t){if(!Object(V.H)(e))return-1;var r=t.scaleType(e);return"band"===r||"point"===r?1:0}(e.scale,r))&&(a=(o=u+".bandwidth")+"()"+(1===(a=+e.band)?"":"*"+a),s<0&&(a="("+o+"?"+a+":0)"),t=(t?t+"+":"")+a,e.extra&&(t="(datum.extra?"+u+"(datum.extra.value):"+t+")")),null==t&&(t="0")),t};function scale_getScale(e,t,r,n){var i;if(Object(V.H)(e))i=W_+e,Object(V.v)(r,i)||(r[i]=t.scaleRef(e)),i=Object(V.X)(i);else{for(i in t.scales)r[W_+i]=t.scaleRef(i);i=Object(V.X)(W_)+"+"+(e.signal?"("+Cx(e.signal,t,r,n)+")":Tx(e,t,r,n))}return"_["+i+"]"}var Ax=function(e,t,r,n){return Object(V.F)(e)?"("+Rx(null,e,t,r,n)+")":e},Rx=function(e,t,r,n,i){if(null!=t.gradient)return function(e,t,r,n){return"this.gradient("+scale_getScale(e.gradient,t,r,n)+","+Object(V.X)(e.start)+","+Object(V.X)(e.stop)+","+Object(V.X)(e.count)+")"}(t,r,n,i);var a=t.signal?Cx(t.signal,r,n,i):t.color?function(e,t,r,n){function color(e,i,a,o){return"this."+e+"("+[Rx(null,i,t,r,n),Rx(null,a,t,r,n),Rx(null,o,t,r,n)].join(",")+").toString()"}return e.c?color("hcl",e.h,e.c,e.l):e.h||e.s?color("hsl",e.h,e.s,e.l):e.l||e.a?color("lab",e.l,e.a,e.b):e.r||e.g||e.b?color("rgb",e.r,e.g,e.b):null}(t.color,r,n,i):null!=t.field?Tx(t.field,r,n,i):void 0!==t.value?Object(V.X)(t.value):void 0;return null!=t.scale&&(a=Ox(t,a,r,n,i)),void 0===a&&(a=null),null!=t.exponent&&(a="Math.pow("+a+","+Ax(t.exponent,r,n,i)+")"),null!=t.mult&&(a+="*"+Ax(t.mult,r,n,i)),null!=t.offset&&(a+="+"+Ax(t.offset,r,n,i)),t.round&&(a="Math.round("+a+")"),a},Dx=function(e,t,r){var n=e+"["+Object(V.X)(t)+"]";return"$=".concat(r,";if(").concat(n,"!==$)").concat(n,"=$,m=1;")},Px=function(e,t,r,n,i){var a="";return t.forEach((function(t){var o=Rx(e,t,r,n,i);a+=t.test?Cx(t.test,r,n,i)+"?"+o+":":o})),":"===Object(V.S)(a)&&(a+="null"),Dx("o",e,a)};function parseEncode(e,t,r,n){var i,a,o,s={},u="var o=item,datum=o.datum,m=0,$;";for(i in e)a=e[i],Object(V.A)(a)?u+=Px(i,a,n,r,s):(o=Rx(i,a,n,r,s),u+=Dx("o",i,o));return u+=Ex(e,t),{$expr:u+="return m;",$fields:Object.keys(s),$output:Object.keys(e)}}var jx="mark",Mx="frame",Fx="title";function encoder(e){return Object(V.F)(e)?Object(V.o)({},e):{value:e}}function addEncode(e,t,r,n){return null!=r?(Object(V.F)(r)&&!Object(V.A)(r)?e.update[t]=r:e[n||"enter"][t]={value:r},1):0}function addEncoders(e,t,r){for(var n in t)addEncode(e,n,t[n]);for(var i in r)addEncode(e,i,r[i],"update")}function extendEncode(e,t,r){for(var n in t)r&&Object(V.v)(r,n)||(e[n]=Object(V.o)(e[n]||{},t[n]));return e}function encode_util_encoders(e,t,r,n,i,a){var o,s;for(s in(a=a||{}).encoders={$encode:o={}},e=function applyDefaults(e,t,r,n,i){var a,o,s,u={},l={};"legend"!=r&&0!==String(r).indexOf("axis")||(r=null);for(o in s=r===Mx?i.group:r===jx?Object(V.o)({},i.mark,i[t]):null)has(o,e)||("fill"===o||"stroke"===o)&&(has("fill",e)||has("stroke",e))||applyDefault(u,o,s[o]);for(o in Object(V.i)(n).forEach((function(t){var r=i.style&&i.style[t];for(var n in r)has(n,e)||applyDefault(u,n,r[n])})),e=Object(V.o)({},e),u)(s=u[o]).signal?(a=a||{})[o]=s:l[o]=s;e.enter=Object(V.o)(l,e.enter),a&&(e.update=Object(V.o)(a,e.update));return e}(e,t,r,n,i.config))o[s]=parseEncode(e[s],t,a,i);return a}function applyDefault(e,t,r){e[t]=r&&r.signal?{signal:r.signal}:{value:r}}function has(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}var Ix=function(e,t,r,n,i,a,o){return{type:e,name:o?o.name:void 0,role:t,style:o&&o.style||r,key:n,from:i,interactive:!(!o||!o.interactive),encode:extendEncode(a,o,bx)}};function guide_util_lookup(e,t){var r=function _(r){return util_value(e[r],t[r])};return r.isVertical=function(r){return cx===util_value(e.direction,t.direction||(r?t.symbolDirection:t.gradientDirection))},r.gradientLength=function(){return util_value(e.gradientLength,t.gradientLength||t.gradientWidth)},r.gradientThickness=function(){return util_value(e.gradientThickness,t.gradientThickness||t.gradientHeight)},r.entryColumns=function(){return util_value(e.columns,util_value(t.columns,+r.isVertical(!0)))},r}function getEncoding(e,t){var r=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return r&&r.signal?r:r?r.value:null}function anchorExpr(e,t,r){return'item.anchor === "'.concat(fx,'" ? ').concat(e,' : item.anchor === "').concat(dx,'" ? ').concat(t," : ").concat(r)}var Lx=anchorExpr(Object(V.X)("left"),Object(V.X)("right"),Object(V.X)("center")),Nx="group",Bx="text",Ux=function(e,t,r,n){var i,a,o,s,u,l,c=guide_util_lookup(e,r),f=c.isVertical(),d=c.gradientThickness(),h=c.gradientLength();return f?(o=[0,1],s=[0,0],u=d,l=h):(o=[0,0],s=[1,0],u=h,l=d),addEncoders(i={enter:a={opacity:xx,x:xx,y:xx,width:encoder(u),height:encoder(l)},update:Object(V.o)({},a,{opacity:wx,fill:{gradient:t,start:o,stop:s}}),exit:{opacity:xx}},{stroke:c("gradientStrokeColor"),strokeWidth:c("gradientStrokeWidth")},{opacity:c("gradientOpacity")}),Ix("rect","legend-gradient",null,void 0,void 0,i,n)},zx=function(e,t,r,n,i){var a,o,s,u,l,c,f=guide_util_lookup(e,r),d=f.isVertical(),h=f.gradientThickness(),p=f.gradientLength(),g="";return d?(s="y",l="y2",u="x",c="width",g="1-"):(s="x",l="x2",u="y",c="height"),(o={opacity:xx,fill:{scale:t,field:hx}})[s]={signal:g+"datum.perc",mult:p},o[u]=xx,o[l]={signal:g+"datum.perc2",mult:p},o[c]=encoder(h),addEncoders(a={enter:o,update:Object(V.o)({},o,{opacity:wx}),exit:{opacity:xx}},{stroke:f("gradientStrokeColor"),strokeWidth:f("gradientStrokeWidth")},{opacity:f("gradientOpacity")}),Ix("rect","legend-band",null,hx,i,a,n)},qx="datum.".concat("perc",'<=0?"').concat("left",'":datum.').concat("perc",'>=1?"').concat("right",'":"').concat("center",'"'),Wx="datum.".concat("perc",'<=0?"').concat("bottom",'":datum.').concat("perc",'>=1?"').concat("top",'":"').concat("middle",'"'),Gx=function(e,t,r,n){var i,a,o,s,u,l=guide_util_lookup(e,t),c=l.isVertical(),f=encoder(l.gradientThickness()),d=l.gradientLength(),h=l("labelOverlap"),p=l("labelSeparation"),g="";return addEncoders(i={enter:a={opacity:xx},update:o={opacity:wx,text:{field:"label"}},exit:{opacity:xx}},{fill:l("labelColor"),fillOpacity:l("labelOpacity"),font:l("labelFont"),fontSize:l("labelFontSize"),fontStyle:l("labelFontStyle"),fontWeight:l("labelFontWeight"),limit:util_value(e.labelLimit,t.gradientLabelLimit)}),c?(a.align={value:"left"},a.baseline=o.baseline={signal:Wx},s="y",u="x",g="1-"):(a.align=o.align={signal:qx},a.baseline={value:"top"},s="x",u="y"),a[s]=o[s]={signal:g+"datum.perc",mult:d},a[u]=o[u]=f,f.offset=util_value(e.labelOffset,t.gradientLabelOffset)||0,e=Ix(Bx,"legend-label",px,hx,n,i,r),h&&(e.overlap={separation:p,method:h,order:"datum.index"}),e},Hx=function(e,t,r,n,i,a,o,s){return{type:Nx,name:r,role:e,style:t,from:n,interactive:i||!1,encode:a,marks:o,layout:s}},Vx=function(e,t,r,n,i){var a,o,s,u,l,c,f,d=guide_util_lookup(e,t),h=r.entries,p=!(!h||!h.interactive),g=h?h.name:void 0,m=d("clipHeight"),v=d("symbolOffset"),y={data:"value"},_={},b="".concat(i," ? datum.").concat("offset"," : datum.").concat("size"),x=m?encoder(m):{field:"size"},w="datum.".concat("index"),k="max(1, ".concat(i,")");return x.mult=.5,_={enter:a={opacity:xx,x:{signal:b,mult:.5,offset:v},y:x},update:o={opacity:wx,x:a.x,y:a.y},exit:{opacity:xx}},e.fill||addEncoders(_,{fill:t.symbolBaseFillColor,stroke:t.symbolBaseStrokeColor}),addEncoders(_,{fill:d("symbolFillColor"),shape:d("symbolType"),size:d("symbolSize"),stroke:d("symbolStrokeColor"),strokeDash:d("symbolDash"),strokeDashOffset:d("symbolDashOffset"),strokeWidth:d("symbolStrokeWidth")},{opacity:d("symbolOpacity")}),_x.forEach((function(t){e[t]&&(o[t]=a[t]={scale:e[t],field:hx})})),u=Ix("symbol","legend-symbol",null,hx,y,_,r.symbols),m&&(u.clip=!0),(s=encoder(v)).offset=d("labelOffset"),addEncoders(_={enter:a={opacity:xx,x:{signal:b,offset:s},y:x},update:o={opacity:wx,text:{field:"label"},x:a.x,y:a.y},exit:{opacity:xx}},{align:d("labelAlign"),baseline:d("labelBaseline"),fill:d("labelColor"),fillOpacity:d("labelOpacity"),font:d("labelFont"),fontSize:d("labelFontSize"),fontStyle:d("labelFontStyle"),fontWeight:d("labelFontWeight"),limit:d("labelLimit")}),l=Ix(Bx,"legend-label",px,hx,y,_,r.labels),_={enter:{noBound:{value:!m},width:xx,height:m?encoder(m):xx,opacity:xx},exit:{opacity:xx},update:o={opacity:wx,row:{signal:null},column:{signal:null}}},d.isVertical(!0)?(c="ceil(item.mark.items.length / ".concat(k,")"),o.row.signal="".concat(w,"%").concat(c),o.column.signal="floor(".concat(w," / ").concat(c,")"),f={field:["row",w]}):(o.row.signal="floor(".concat(w," / ").concat(k,")"),o.column.signal="".concat(w," % ").concat(k),f={field:w}),o.column.signal="".concat(i,"?").concat(o.column.signal,":").concat(w),(e=Hx("scope",null,g,n={facet:{data:n,name:"value",groupby:"index"}},p,extendEncode(_,h,bx),[u,l])).sort=f,e};var Yx='item.orient === "left"',$x='item.orient === "right"',Xx="(".concat(Yx," || ").concat($x,")"),Kx="datum.vgrad && ".concat(Xx),Jx=anchorExpr('"top"','"bottom"','"middle"'),Qx=anchorExpr('"right"','"left"','"center"'),Zx="datum.vgrad && ".concat($x," ? (").concat(Qx,") : (").concat(Xx," && !(datum.vgrad && ").concat(Yx,')) ? "left" : ').concat(Lx),ew="item._anchor || (".concat(Xx,' ? "middle" : "start")'),tw="".concat(Kx," ? (").concat(Yx," ? -90 : 90) : 0"),rw="".concat(Xx," ? (datum.vgrad ? (").concat($x,' ? "bottom" : "top") : ').concat(Jx,') : "top"'),nw=function(e,t){var r;return Object(V.F)(e)&&(e.signal?r=e.signal:e.path?r="pathShape("+clip_param(e.path)+")":e.sphere&&(r="geoShape("+clip_param(e.sphere)+', {type: "Sphere"})')),r?t.signalRef(r):!!e};function clip_param(e){return Object(V.F)(e)&&e.signal?e.signal:Object(V.X)(e)}var iw=function(e){var t=e.role||"";return t.indexOf("axis")&&t.indexOf("legend")?e.type===Nx?"scope":t||jx:t},aw=function(e){return{marktype:e.type,name:e.name||void 0,role:e.role||iw(e),zindex:+e.zindex||void 0}},ow=function(e,t){return e&&e.signal?t.signalRef(e.signal):!1!==e},sw=function(e,t){var r=register_definition(e.type);r||Object(V.n)("Unrecognized transform type: "+Object(V.X)(e.type));var n=util_entry(r.type.toLowerCase(),null,transform_parseParameters(r,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(n)),n.metadata=r.metadata||{},n};function transform_parseParameters(e,t,r){var n,i,a,o={};for(i=0,a=e.params.length;i<a;++i)o[(n=e.params[i]).name]=transform_parseParameter(n,t,r);return o}function transform_parseParameter(e,t,r){var n=e.type,i=t[e.name];return"index"===n?function parseIndexParameter(e,t,r){Object(V.H)(t.from)||Object(V.n)('Lookup "from" parameter must be a string literal.');return r.getData(t.from).lookupRef(r,t.key)}(0,t,r):void 0!==i?"param"===n?function parseSubParameters(e,t,r){var n=t[e.name];return e.array?(Object(V.A)(n)||Object(V.n)("Expected an array of sub-parameters. Instead: "+Object(V.X)(n)),n.map((function(t){return parseSubParameter(e,t,r)}))):parseSubParameter(e,n,r)}(e,t,r):"projection"===n?r.projectionRef(t[e.name]):e.array&&!isSignal(i)?i.map((function(t){return parameterValue(e,t,r)})):parameterValue(e,i,r):void(e.required&&Object(V.n)("Missing required "+Object(V.X)(t.type)+" parameter: "+Object(V.X)(e.name)))}function parameterValue(e,t,r){var n=e.type;if(isSignal(t))return transform_isExpr(n)?Object(V.n)("Expression references can not be signals."):isField(n)?r.fieldRef(t):isCompare(n)?r.compareRef(t):r.signalRef(t.signal);var i=e.expr||isField(n);return i&&function outerExpr(e){return e&&e.expr}(t)?r.exprRef(t.expr,t.as):i&&function outerField(e){return e&&e.field}(t)?util_fieldRef(t.field,t.as):transform_isExpr(n)?hb(t,r):function isData(e){return"data"===e}(n)?util_ref(r.getData(t).values):isField(n)?util_fieldRef(t):isCompare(n)?r.compareRef(t):t}function parseSubParameter(e,t,r){var n,i,a,o,s;for(o=0,s=e.params.length;o<s;++o){for(a in(i=e.params[o]).key)if(i.key[a]!==t[a]){i=null;break}if(i)break}return i||Object(V.n)("Unsupported parameter: "+Object(V.X)(t)),n=Object(V.o)(transform_parseParameters(i,t,r),i.key),util_ref(r.add(Jb(n)))}function transform_isExpr(e){return"expr"===e}function isField(e){return"field"===e}function isCompare(e){return"compare"===e}function getDataRef(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:util_ref(t.getData(e.data).output)}function DataScope(e,t,r,n,i){this.scope=e,this.input=t,this.output=r,this.values=n,this.aggregate=i,this.index={}}DataScope.fromEntries=function(e,t){var r=t.length,n=1,i=t[0],a=t[r-1],o=t[r-2],s=null;for(i&&"load"===i.type&&(i=t[1]),e.add(t[0]);n<r;++n)t[n].params.pulse=util_ref(t[n-1]),e.add(t[n]),"aggregate"===t[n].type&&(s=t[n]);return new DataScope(e,i,o,a,s)};var uw=DataScope.prototype;function fieldKey(e){return Object(V.H)(e)?e:null}function addSortField(e,t,r){var n,i=aggrField(r.op,r.field);if(t.ops){for(var a=0,o=t.as.length;a<o;++a)if(t.as[a]===i)return}else t.ops=["count"],t.fields=[null],t.as=["count"];r.op&&(t.ops.push((n=r.op.signal)?e.signalRef(n):r.op),t.fields.push(e.fieldRef(r.field)),t.as.push(i))}function DataScope_cache(e,t,r,n,i,a,o){var s,u,l=t[r]||(t[r]={}),c=function sortKey(e){return Object(V.F)(e)?(e.order===gb?"-":"+")+aggrField(e.op,e.field):""}(a),f=fieldKey(i);if(null!=f&&(e=t.scope,s=l[f+=c?"|"+c:""]),!s){var d=a?{field:pb,pulse:t.countsRef(e,i,a)}:{field:e.fieldRef(i),pulse:util_ref(t.output)};c&&(d.sort=e.sortRef(a)),u=e.add(util_entry(n,void 0,d)),o&&(t.index[i]=u),s=util_ref(u),null!=f&&(l[f]=s)}return s}uw.countsRef=function(e,t,r){var n,i,a,o=this.counts||(this.counts={}),s=fieldKey(t);return null!=s&&(e=this.scope,n=o[s]),n?r&&r.field&&addSortField(e,n.agg.params,r):(a={groupby:e.fieldRef(t,"key"),pulse:util_ref(this.output)},r&&r.field&&addSortField(e,a,r),i=e.add(Mb(a)),n=e.add(Lb({pulse:util_ref(i)})),n={agg:i,ref:util_ref(n)},null!=s&&(o[s]=n)),n.ref},uw.tuplesRef=function(){return util_ref(this.values)},uw.extentRef=function(e,t){return DataScope_cache(e,this,"extent","extent",t,!1)},uw.domainRef=function(e,t){return DataScope_cache(e,this,"domain","values",t,!1)},uw.valuesRef=function(e,t,r){return DataScope_cache(e,this,"vals","values",t,r||!0)},uw.lookupRef=function(e,t){return DataScope_cache(e,this,"lookup","tupleindex",t,!1)},uw.indataRef=function(e,t){return DataScope_cache(e,this,"indata","tupleindex",t,!0,!0)};var lw=function(e,t,r){var n,i,a=e.remove,o=e.insert,s=e.toggle,u=e.modify,l=e.values,c=t.add(util_operator());n="if("+e.trigger+',modify("'+r+'",'+[o,a,s,u,l].map((function(e){return null==e?"null":e})).join(",")+"),0)",i=hb(n,t),c.update=i.$expr,c.params=i.$params},cw=function(e,t){var r,n,i,a,o,s,u,l,c,f,d,h,p,g,m=iw(e),v=e.type===Nx,y=e.from&&e.from.facet,_=e.layout||"scope"===m||m===Mx,b=m===jx||_||y,x=e.overlap;i=function(e,t,r){var n,i,a,o,s;return e?(n=e.facet)&&(t||Object(V.n)("Only group marks can be faceted."),null!=n.field?o=s=getDataRef(n,r):(e.data?s=util_ref(r.getData(e.data).aggregate):((a=sw(Object(V.o)({type:"aggregate",groupby:Object(V.i)(n.groupby)},n.aggregate),r)).params.key=r.keyRef(n.groupby),a.params.pulse=getDataRef(n,r),o=s=util_ref(r.add(a))),i=r.keyRef(n.groupby,!0))):o=util_ref(r.add(Lb(null,[{}]))),o||(o=getDataRef(e,r)),{key:i,pulse:o,parent:s}}(e.from,v,t),f=util_ref(n=t.add(Bb({key:i.key||(e.key?util_fieldRef(e.key):void 0),pulse:i.pulse,clean:!v}))),n=a=t.add(Lb({pulse:f})),n=t.add(Yb({markdef:aw(e),interactive:ow(e.interactive,t),clip:nw(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:util_ref(n)})),d=util_ref(n),(n=o=t.add(Ub(encode_util_encoders(e.encode,e.type,m,e.style,t,{mod:!1,pulse:d})))).params.parent=t.encode(),e.transform&&e.transform.forEach((function(e){var r=sw(e,t),i=r.metadata;(i.generates||i.changes)&&Object(V.n)("Mark transforms should not generate new data."),i.nomod||(o.params.mod=!0),r.params.pulse=util_ref(n),t.add(n=r)})),e.sort&&(n=t.add(ax({sort:t.compareRef(e.sort),pulse:util_ref(n)}))),h=util_ref(n),(y||_)&&(p=util_ref(_=t.add(ox({layout:t.objectProperty(e.layout),legends:t.legends,mark:d,pulse:h})))),g=util_ref(s=t.add(Ib({mark:d,pulse:p||h}))),v&&(b&&((r=t.operators).pop(),_&&r.pop()),t.pushState(h,p||g,f),y?function(e,t,r){var n,i,a,o,s=e.from.facet,u=s.name,l=getDataRef(s,t);s.name||Object(V.n)("Facet must have a name: "+Object(V.X)(s)),s.data||Object(V.n)("Facet must reference a data set: "+Object(V.X)(s)),s.field?o=t.add(Qb({field:t.fieldRef(s.field),pulse:l})):s.groupby?o=t.add(qb({key:t.keyRef(s.groupby),group:util_ref(t.proxy(r.parent)),pulse:l})):Object(V.n)("Facet must specify groupby or field: "+Object(V.X)(s)),i=(n=t.fork()).add(Lb()),a=n.add(ix({pulse:util_ref(i)})),n.addData(u,new DataScope(n,i,i,a)),n.addSignal("parent",null),o.params.subflow={$subflow:vw(e,n).toRuntime()}}(e,t,i):b?function(e,t,r){var n=t.add(Qb({pulse:r.pulse})),i=t.fork();i.add(ix()),i.addSignal("parent",null),n.params.subflow={$subflow:vw(e,i).toRuntime()}}(e,t,i):vw(e,t),t.popState(),b&&(_&&r.push(_),r.push(s))),x&&(g=function parseOverlap(e,t,r){var n,i=e.method,a=e.bound,o=e.separation,s={separation:isSignal(o)?r.signalRef(o.signal):o,method:isSignal(i)?r.signalRef(i.signal):i,pulse:t};e.order&&(s.sort=r.compareRef({field:e.order}));a&&(n=a.tolerance,s.boundTolerance=isSignal(n)?r.signalRef(n.signal):+n,s.boundScale=r.scaleRef(a.scale),s.boundOrient=a.orient);return util_ref(r.add(Kb(s)))}(x,g,t)),u=t.add(rx({pulse:g})),l=t.add(ix({pulse:util_ref(u)},void 0,t.parent())),null!=e.name&&(c=e.name,t.addData(c,new DataScope(t,a,u,l)),e.on&&e.on.forEach((function(e){(e.insert||e.remove||e.toggle)&&Object(V.n)("Marks only support modify triggers."),lw(e,t,c)})))};var fw=function(e,t){var r,n,i,a,o,s,u,l,c,f=t.config.legend,d=e.encode||{},h=d.legend||{},p=h.name||void 0,g=h.interactive,m=h.style,v=guide_util_lookup(e,f),y=_x.reduce((function(t,r){return t||e[r]}),0);return y||Object(V.n)("Missing valid scale for legend."),o=function legend_legendType(e,t){var r=e.type||mx;e.type||1!==function scaleCount(e){return _x.reduce((function(t,r){return t+(e[r]?1:0)}),0)}(e)||!e.fill&&!e.stroke||(r=isContinuous(t)?vx:isDiscretizing(t)?yx:mx);return r!==vx?r:isDiscretizing(t)?yx:vx}(e,t.scaleType(y)),s={title:null!=e.title,type:o,vgrad:"symbol"!==o&&v.isVertical()},u=util_ref(t.add(Lb(null,[s]))),h=extendEncode(function buildLegendEncode(e,t){var r={enter:{},update:{}};return addEncoders(r,{orient:e("orient"),offset:e("offset"),padding:e("padding"),titlePadding:e("titlePadding"),cornerRadius:e("cornerRadius"),fill:e("fillColor"),stroke:e("strokeColor"),strokeWidth:t.strokeWidth,strokeDash:t.strokeDash,x:e("legendX"),y:e("legendY")}),r}(v,f),h,bx),r={enter:{x:{value:0},y:{value:0}}},l=util_ref(t.add(Hb(i={type:o,scale:t.scaleRef(y),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)}))),o===vx?(a=[Ux(e,y,f,d.gradient),Gx(e,f,d.labels,l)],i.count=i.count||t.signalRef("max(2,2*floor((".concat(deref(v.gradientLength()),")/100))"))):o===yx?a=[zx(e,y,f,d.gradient,l),Gx(e,f,d.labels,l)]:(n=function legendSymbolLayout(e,t){var r=guide_util_lookup(e,t);return{align:r("gridAlign"),columns:r.entryColumns(),center:{row:!0,column:!1},padding:{row:r("rowPadding"),column:r("columnPadding")}}}(e,f),a=[Vx(e,f,d,l,deref(n.columns))],i.size=function sizeExpression(e,t,r){var n=deref(getChannel("size",e,r)),i=deref(getChannel("strokeWidth",e,r)),a=deref(function getFontSize(e,t,r){return getEncoding("fontSize",e)||function getStyle(e,t,r){var n=t.config.style[r];return n&&n[e]}("fontSize",t,r)}(r[1].encode,t,px));return hb("max(ceil(sqrt(".concat(n,")+").concat(i,"),").concat(a,")"),t)}(e,t,a[0].marks)),a=[Hx("legend-entry",null,null,u,g,r,a,n)],s.title&&a.push(function(e,t,r,n){var i,a=guide_util_lookup(e,t);return addEncoders(i={enter:{opacity:xx},update:{opacity:wx,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:xx}},{orient:a("titleOrient"),_anchor:a("titleAnchor"),anchor:{signal:ew},angle:{signal:tw},align:{signal:Zx},baseline:{signal:rw},text:e.title,fill:a("titleColor"),fillOpacity:a("titleOpacity"),font:a("titleFont"),fontSize:a("titleFontSize"),fontStyle:a("titleFontStyle"),fontWeight:a("titleFontWeight"),limit:a("titleLimit")},{align:a("titleAlign"),baseline:a("titleBaseline")}),Ix(Bx,"legend-title","guide-title",null,n,i,r)}(e,f,d.title,u)),c=Hx("legend",m,p,u,g,h,a),e.zindex&&(c.zindex=e.zindex),cw(c,t)};function getChannel(e,t,r){return t[e]?'scale("'.concat(t[e],'",datum)'):getEncoding(e,r[0].encode)}var dw='item.orient==="'.concat("left",'"?-90:item.orient==="').concat("right",'"?90:0'),hw='item.orient==="'.concat("bottom",'"?"').concat("top",'":"').concat("bottom",'"'),pw=function(e,t){e=Object(V.H)(e)?{text:e}:e;var r,n,i=t.config.title,a=Object(V.o)({},e.encode);return r=util_ref(t.add(Lb(null,[{}]))),a.name=e.name,a.interactive=e.interactive,n=function buildTitle(e,t,r,n){var i,a=guide_util_lookup(e,t),o={value:0},s=e.text;return addEncoders(i={enter:{opacity:o},update:{opacity:{value:1}},exit:{opacity:o}},{text:s,orient:a("orient"),anchor:a("anchor"),align:{signal:Lx},angle:{signal:dw},baseline:{signal:hw},dx:a("dx"),dy:a("dy"),fill:a("color"),font:a("font"),fontSize:a("fontSize"),fontStyle:a("fontStyle"),fontWeight:a("fontWeight"),frame:a("frame"),limit:a("limit"),offset:a("offset")||0},{align:a("align"),angle:a("angle"),baseline:a("baseline")}),Ix(Bx,Fx,e.style||gx,null,n,i,r)}(e,i,a,r),e.zindex&&(n.zindex=e.zindex),cw(n,t)};function data_parseData(e,t){var r=[];e.transform&&e.transform.forEach((function(e){r.push(sw(e,t))})),e.on&&e.on.forEach((function(r){lw(r,t,e.name)})),t.addDataPipeline(e.name,function analyze(e,t,r){var n,i,a,o,s,u=[],l=null,c=!1,f=!1;e.values?util_hasSignal(e.values)||util_hasSignal(e.format)?(u.push(data_load(t,e)),u.push(l=collect())):u.push(l=collect({$ingest:e.values,$format:e.format})):e.url?util_hasSignal(e.url)||util_hasSignal(e.format)?(u.push(data_load(t,e)),u.push(l=collect())):u.push(l=collect({$request:e.url,$format:e.format})):e.source&&(l=n=Object(V.i)(e.source).map((function(e){return util_ref(t.getData(e).output)})),u.push(null));for(i=0,a=r.length;i<a;++i)o=r[i],s=o.metadata,l||s.source||u.push(l=collect()),u.push(o),s.generates&&(f=!0),s.modifies&&!f&&(c=!0),s.source?l=o:s.changes&&(l=null);n&&(a=n.length-1,u[0]=tx({derive:c,pulse:a?n:n[0]}),(c||a)&&u.splice(1,0,collect()));l||u.push(collect());return u.push(ix({})),u}(e,t,r))}function collect(e){var t=Lb({},e);return t.metadata={source:!0},t}function data_load(e,t){return Vb({url:t.url?e.property(t.url):void 0,values:t.values?e.property(t.values):void 0,format:e.objectProperty(t.format)})}function axis_domain_position(e,t){return{scale:e.scale,range:t}}var gw=function(e,t,r,n){var i,a,o,s,u,l,c,f,d,h=guide_util_lookup(e,t),p=e.orient,g=e.gridScale,m="left"===p||"top"===p?1:-1,v=function axis_grid_offsetValue(e,t){if(1===t);else if(Object(V.F)(e)){for(var r=e=Object(V.o)({},e);null!=r.mult;){if(!Object(V.F)(r.mult))return r.mult*=t,e;r=r.mult=Object(V.o)({},r.mult)}r.mult=t}else e=t*(e||0);return e}(e.offset,m);return addEncoders(i={enter:a={opacity:xx},update:s={opacity:wx},exit:o={opacity:xx}},{stroke:h("gridColor"),strokeDash:h("gridDash"),strokeDashOffset:h("gridDashOffset"),strokeOpacity:h("gridOpacity"),strokeWidth:h("gridWidth")}),u={scale:e.scale,field:hx,band:h("bandPosition"),round:h("tickRound"),extra:h("tickExtra"),offset:h("tickOffset")},"top"===p||"bottom"===p?(l="x",c="y",d="height"):(l="y",c="x",d="width"),f=c+"2",s[l]=a[l]=o[l]=u,g?(s[c]=a[c]={scale:g,range:0,mult:m,offset:v},s[f]=a[f]={scale:g,range:1,mult:m,offset:v}):(s[c]=a[c]={value:0,offset:v},s[f]=a[f]={signal:d,mult:m,offset:v}),Ix("rule","axis-grid",null,hx,n,i,r)};function flushExpr(e,t,r,n,i){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+r+","+n+","+i+")"}}var mw=function(e,t){var r,n,i,a,o,s,u=function(e,t){var r=t.config,n=e.orient,i="top"===n||"bottom"===n?r.axisX:r.axisY,a=r["axis"+n[0].toUpperCase()+n.slice(1)],o="band"===t.scaleType(e.scale)&&r.axisBand;return i||a||o?Object(V.o)({},r.axis,i,a,o):r.axis}(e,t),l=e.encode||{},c=l.axis||{},f=c.name||void 0,d=c.interactive,h=c.style,p=guide_util_lookup(e,u);return r={orient:e.orient,ticks:!!p("ticks"),labels:!!p("labels"),grid:!!p("grid"),domain:!!p("domain"),title:null!=e.title},n=util_ref(t.add(Lb({},[r]))),c=extendEncode({update:{offset:encoder(p("offset")||0),position:encoder(util_value(e.position,0)),titlePadding:encoder(p("titlePadding")),minExtent:encoder(p("minExtent")),maxExtent:encoder(p("maxExtent")),range:{signal:'abs(span(range("'.concat(e.scale,'")))')}}},l.axis,bx),i=util_ref(t.add(Fb({scale:t.scaleRef(e.scale),extra:t.property(p("tickExtra")),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)}))),s=[],r.grid&&s.push(gw(e,u,l.grid,i)),r.ticks&&(a=p("tickSize"),s.push(function(e,t,r,n,i){var a,o,s,u,l,c,f=guide_util_lookup(e,t),d=e.orient,h="left"===d||"top"===d?-1:1;return addEncoders(a={enter:o={opacity:xx},update:u={opacity:wx},exit:s={opacity:xx}},{stroke:f("tickColor"),strokeDash:f("tickDash"),strokeDashOffset:f("tickDashOffset"),strokeOpacity:f("tickOpacity"),strokeWidth:f("tickWidth")}),(l=encoder(i)).mult=h,c={scale:e.scale,field:hx,band:f("bandPosition"),round:f("tickRound"),extra:f("tickExtra"),offset:f("tickOffset")},"top"===d||"bottom"===d?(u.y=o.y=xx,u.y2=o.y2=l,u.x=o.x=s.x=c):(u.x=o.x=xx,u.x2=o.x2=l,u.y=o.y=s.y=c),Ix("rule","axis-tick",null,hx,n,a,r)}(e,u,l.ticks,i,a))),r.labels&&(a=r.ticks?a:0,s.push(function(e,t,r,n,i){var a,o,s,u,l,c,f,d,h,p,g,m=guide_util_lookup(e,t),v=e.orient,y="left"===v||"top"===v?-1:1,_="top"===v||"bottom"===v,b=e.scale,x=deref(m("labelFlush")),w=deref(m("labelFlushOffset")),k=0===x||!!x,S=m("labelAlign"),E=m("labelBaseline");return(u=encoder(i)).mult=y,u.offset=encoder(m("labelPadding")||0),u.offset.mult=y,l={scale:b,field:hx,band:.5,offset:m("tickOffset")},_?(c=S||(k?flushExpr(b,x,'"left"','"right"','"center"'):"center"),f=E||("top"===v?"bottom":"top"),d=!S):(c=S||("right"===v?"left":"right"),f=E||(k?flushExpr(b,x,'"top"','"bottom"','"middle"'):"middle"),d=!E),d=d&&k&&w?flushExpr(b,x,"-("+w+")",w,0):null,addEncoders(o={enter:s={opacity:xx,x:_?l:u,y:_?u:l},update:{opacity:wx,text:{field:"label"},x:s.x,y:s.y},exit:{opacity:xx,x:s.x,y:s.y}},(a={},Object(po.a)(a,_?"dx":"dy",d),Object(po.a)(a,"align",c),Object(po.a)(a,"baseline",f),Object(po.a)(a,"angle",m("labelAngle")),Object(po.a)(a,"fill",m("labelColor")),Object(po.a)(a,"fillOpacity",m("labelOpacity")),Object(po.a)(a,"font",m("labelFont")),Object(po.a)(a,"fontSize",m("labelFontSize")),Object(po.a)(a,"fontWeight",m("labelFontWeight")),Object(po.a)(a,"fontStyle",m("labelFontStyle")),Object(po.a)(a,"limit",m("labelLimit")),a)),h=m("labelBound"),p=m("labelOverlap"),g=m("labelSeparation"),e=Ix(Bx,"axis-label",px,hx,n,o,r),(p||h)&&(e.overlap={separation:g,method:p,order:"datum.index",bound:h?{scale:b,orient:v,tolerance:h}:null}),e}(e,u,l.labels,i,a))),r.domain&&s.push(function(e,t,r,n){var i,a,o,s,u,l,c=guide_util_lookup(e,t),f=e.orient;return addEncoders(i={enter:a={opacity:xx},update:o={opacity:wx},exit:{opacity:xx}},{stroke:c("domainColor"),strokeDash:c("domainDash"),strokeDashOffset:c("domainDashOffset"),strokeWidth:c("domainWidth"),strokeOpacity:c("domainOpacity")}),"top"===f||"bottom"===f?(s="x",l="y"):(s="y",l="x"),u=s+"2",a[l]=xx,o[s]=a[s]=axis_domain_position(e,0),o[u]=a[u]=axis_domain_position(e,1),Ix("rule","axis-domain",null,null,n,i,r)}(e,u,l.domain,n)),r.title&&s.push(function(e,t,r,n){var i,a,o,s,u=guide_util_lookup(e,t),l=e.orient,c="left"===l||"top"===l?-1:1,f="top"===l||"bottom"===l;return i={enter:a={opacity:xx,anchor:encoder(u("titleAnchor")),align:{signal:Lx}},update:o=Object(V.o)({},a,{opacity:wx,text:encoder(e.title)}),exit:{opacity:xx}},s={signal:'lerp(range("'.concat(e.scale,'"), ').concat(anchorExpr(0,1,.5),")")},f?(o.x=s,a.angle={value:0},a.baseline={value:"top"===l?"bottom":"top"}):(o.y=s,a.angle={value:90*c},a.baseline={value:"bottom"}),addEncoders(i,{angle:u("titleAngle"),baseline:u("titleBaseline"),fill:u("titleColor"),fillOpacity:u("titleOpacity"),font:u("titleFont"),fontSize:u("titleFontSize"),fontStyle:u("titleFontStyle"),fontWeight:u("titleFontWeight"),limit:u("titleLimit")},{align:u("titleAlign")}),!addEncode(i,"x",u("titleX"),"update")&&!f&&!has("x",r)&&(i.enter.auto={value:!0}),!addEncode(i,"y",u("titleY"),"update")&&f&&!has("y",r)&&(i.enter.auto={value:!0}),Ix(Bx,"axis-title","guide-title",null,n,i,r)}(e,u,l.title,n)),o=Hx("axis",h,f,n,d,c,s),e.zindex&&(o.zindex=e.zindex),cw(o,t)},vw=function(e,t,r){var n=Object(V.i)(e.signals),i=Object(V.i)(e.scales);return r||n.forEach((function(e){return db(e,t)})),Object(V.i)(e.projections).forEach((function(e){return function(e,t){var r={};for(var n in e)"name"!==n&&(r[n]=projection_parseParameter(e[n],n,t));t.addProjection(e.name,r)}(e,t)})),i.forEach((function(e){return initScale(e,t)})),Object(V.i)(e.data).forEach((function(e){return data_parseData(e,t)})),i.forEach((function(e){return scale_parseScale(e,t)})),(r||n).forEach((function(e){return function(e,t){var r=t.getSignal(e.name),n=e.update;e.init&&(n?Object(V.n)("Signals can not include both init and update expressions."):(n=e.init,r.initonly=!0)),n&&(n=hb(n,t),r.update=n.$expr,r.params=n.$params),e.on&&e.on.forEach((function(e){jb(e,t,r.id)}))}(e,t)})),Object(V.i)(e.axes).forEach((function(e){return mw(e,t)})),Object(V.i)(e.marks).forEach((function(e){return cw(e,t)})),Object(V.i)(e.legends).forEach((function(e){return fw(e,t)})),e.title&&pw(e.title,t),t.parseLambdas(),t},yw=Object(V.bb)(["width","height","padding","autosize"]);function parseView(e,t){var r,n,i,a,o,s,u=t.config;return t.background=e.background||u.background,t.eventConfig=u.events,o=util_ref(t.root=t.add(util_operator())),t.addSignal("width",e.width||0),t.addSignal("height",e.height||0),t.addSignal("padding",cb(e.padding,u)),t.addSignal("autosize",lb(e.autosize,u)),t.legends=t.objectProperty(u.legend&&u.legend.layout),s=function addSignals(e,t,r){if(Object(V.i)(t).forEach((function(t){yw[t.name]||db(t,e)})),!r)return t;var n=Object(V.i)(t).slice();return Object(V.i)(r).forEach((function(t){e.hasOwnSignal(t.name)||(db(t,e),n.push(t))})),n}(t,e.signals,u.signals),n=t.add(Lb()),i=extendEncode({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e.encode),i=t.add(Ub(encode_util_encoders(i,Nx,Mx,e.style,t,{pulse:util_ref(n)}))),a=t.add(ox({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:o,pulse:util_ref(i)})),t.operators.pop(),t.pushState(util_ref(i),util_ref(a),null),vw(e,t,s),t.operators.push(a),r=t.add(Ib({mark:o,pulse:util_ref(a)})),r=t.add(rx({pulse:util_ref(r)})),r=t.add(ix({pulse:util_ref(r)})),t.addData("root",new DataScope(t,n,n,r)),t}function Scope_Scope(e){this.config=e,this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.background=null,this.eventConfig=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function Subscope(e){this.config=e.config,this.legends=e.legends,this.field=Object.create(e.field),this.signals=Object.create(e.signals),this.lambdas=Object.create(e.lambdas),this.scales=Object.create(e.scales),this.events=Object.create(e.events),this.data=Object.create(e.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++e._nextsub[0],this._nextsub=e._nextsub,this._parent=e._parent.slice(),this._encode=e._encode.slice(),this._lookup=e._lookup.slice(),this._markpath=e._markpath}var _w=Scope_Scope.prototype=Subscope.prototype;function propertyLambda(e){return(Object(V.A)(e)?arrayLambda:objectLambda)(e)}function arrayLambda(e){for(var t,r="[",n=0,i=e.length;n<i;++n)t=e[n],r+=(n>0?",":"")+(Object(V.F)(t)?t.signal||propertyLambda(t):Object(V.X)(t));return r+"]"}function objectLambda(e){var t,r,n="{",i=0;for(t in e)r=e[t],n+=(++i>1?",":"")+Object(V.X)(t)+":"+(Object(V.F)(r)?r.signal||propertyLambda(r):Object(V.X)(r));return n+"}"}_w.fork=function(){return new Subscope(this)},_w.isSubscope=function(){return this._subid>0},_w.toRuntime=function(){return this.finish(),{background:this.background,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig}},_w.id=function(){return(this._subid?this._subid+":":0)+this._id++},_w.add=function(e){return this.operators.push(e),e.id=this.id(),e.refs&&(e.refs.forEach((function(t){t.$ref=e.id})),e.refs=null),e},_w.proxy=function(e){var t=e instanceof Entry?util_ref(e):e;return this.add(ex({value:t}))},_w.addStream=function(e){return this.streams.push(e),e.id=this.id(),e},_w.addUpdate=function(e){return this.updates.push(e),e},_w.finish=function(){var e,t;for(e in this.root&&(this.root.root=!0),this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function annotate(e,t,r){var n;e&&((n=e.data||(e.data={}))[t]||(n[t]=[])).push(r)}for(e in this.data)for(var r in annotate((t=this.data[e]).input,e,"input"),annotate(t.output,e,"output"),annotate(t.values,e,"values"),t.index)annotate(t.index[r],e,"index:"+r);return this},_w.pushState=function(e,t,r){this._encode.push(util_ref(this.add(ix({pulse:e})))),this._parent.push(t),this._lookup.push(r?util_ref(this.proxy(r)):null),this._markpath.push(-1)},_w.popState=function(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},_w.parent=function(){return Object(V.S)(this._parent)},_w.encode=function(){return Object(V.S)(this._encode)},_w.lookup=function(){return Object(V.S)(this._lookup)},_w.markpath=function(){var e=this._markpath;return++e[e.length-1]},_w.fieldRef=function(e,t){if(Object(V.H)(e))return util_fieldRef(e,t);e.signal||Object(V.n)("Unsupported field reference: "+Object(V.X)(e));var r,n=e.signal,i=this.field[n];return i||(r={name:this.signalRef(n)},t&&(r.as=t),this.field[n]=i=util_ref(this.add(Wb(r)))),i},_w.compareRef=function(e){function check(e){return isSignal(e)?(r=!0,t.signalRef(e.signal)):function isExpr(e){return e&&e.expr}(e)?(r=!0,t.exprRef(e.expr)):e}var t=this,r=!1,n=Object(V.i)(e.field).map(check),i=Object(V.i)(e.order).map(check);return r?util_ref(this.add(Nb({fields:n,orders:i}))):compareRef(n,i)},_w.keyRef=function(e,t){var r=this.signals,n=!1;return e=Object(V.i)(e).map((function check(e){return isSignal(e)?(n=!0,util_ref(r[e.signal])):e})),n?util_ref(this.add(Gb({fields:e,flat:t}))):function keyRef(e,t){var r={$key:e};return t&&(r.$flat=!0),r}(e,t)},_w.sortRef=function(e){if(!e)return e;var t=aggrField(e.op,e.field),r=e.order||"ascending";return r.signal?util_ref(this.add(Nb({fields:t,orders:this.signalRef(r.signal)}))):compareRef(t,r)},_w.event=function(e,t){var r=e+":"+t;if(!this.events[r]){var n=this.id();this.streams.push({id:n,source:e,type:t}),this.events[r]=n}return this.events[r]},_w.hasOwnSignal=function(e){return Object(V.v)(this.signals,e)},_w.addSignal=function(e,t){this.hasOwnSignal(e)&&Object(V.n)("Duplicate signal name: "+Object(V.X)(e));var r=t instanceof Entry?t:this.add(util_operator(t));return this.signals[e]=r},_w.getSignal=function(e){return this.signals[e]||Object(V.n)("Unrecognized signal name: "+Object(V.X)(e)),this.signals[e]},_w.signalRef=function(e){return this.signals[e]?util_ref(this.signals[e]):(Object(V.v)(this.lambdas,e)||(this.lambdas[e]=this.add(util_operator(null))),util_ref(this.lambdas[e]))},_w.parseLambdas=function(){for(var e=Object.keys(this.lambdas),t=0,r=e.length;t<r;++t){var n=e[t],i=hb(n,this),a=this.lambdas[n];a.params=i.$params,a.update=i.$expr}},_w.property=function(e){return e&&e.signal?this.signalRef(e.signal):e},_w.objectProperty=function(e){return e&&Object(V.F)(e)?this.signalRef(e.signal||propertyLambda(e)):e},_w.exprRef=function(e,t){var r={expr:hb(e,this)};return t&&(r.expr.$name=t),util_ref(this.add(zb(r)))},_w.addBinding=function(e,t){this.bindings||Object(V.n)("Nested signals do not support binding: "+Object(V.X)(e)),this.bindings.push(Object(V.o)({signal:e},t))},_w.addScaleProj=function(e,t){Object(V.v)(this.scales,e)&&Object(V.n)("Duplicate scale or projection name: "+Object(V.X)(e)),this.scales[e]=this.add(t)},_w.addScale=function(e,t){this.addScaleProj(e,nx(t))},_w.addProjection=function(e,t){this.addScaleProj(e,Zb(t))},_w.getScale=function(e){return this.scales[e]||Object(V.n)("Unrecognized scale name: "+Object(V.X)(e)),this.scales[e]},_w.projectionRef=_w.scaleRef=function(e){return util_ref(this.getScale(e))},_w.projectionType=_w.scaleType=function(e){return this.getScale(e).params.type},_w.addData=function(e,t){return Object(V.v)(this.data,e)&&Object(V.n)("Duplicate data set name: "+Object(V.X)(e)),this.data[e]=t},_w.getData=function(e){return this.data[e]||Object(V.n)("Undefined data set name: "+Object(V.X)(e)),this.data[e]},_w.addDataPipeline=function(e,t){return Object(V.v)(this.data,e)&&Object(V.n)("Duplicate data set name: "+Object(V.X)(e)),this.addData(e,DataScope.fromEntries(this,t))};var bw=function(e){return(e||[]).reduce((function(e,t){for(var r in t)if("signals"===r)e.signals=mergeNamed(e.signals,t.signals);else{var n="legend"===r?{layout:1}:"style"===r||null;config_copy(e,r,t[r],n)}return e}),function config_defaults(){return{padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:Ew},area:{fill:Ew},image:null,line:{stroke:Ew,strokeWidth:Sw},path:{stroke:Ew},rect:{fill:Ew},rule:{stroke:Cw},shape:{stroke:Ew},symbol:{fill:Ew,size:64},text:{fill:Cw,font:ww,fontSize:11},style:{"guide-label":{fill:Cw,font:ww,fontSize:10},"guide-title":{fill:Cw,font:ww,fontSize:11,fontWeight:"bold"},"group-title":{fill:Cw,font:ww,fontSize:13,fontWeight:"bold"},point:{size:kw,strokeWidth:Sw,shape:"circle"},circle:{size:kw,strokeWidth:Sw},square:{size:kw,strokeWidth:Sw,shape:"square"},cell:{fill:"transparent",stroke:Ow}},title:{orient:"top",anchor:"middle",offset:4},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:Tw,grid:!1,gridWidth:1,gridColor:Ow,labels:!0,labelAngle:0,labelLimit:180,labelPadding:2,ticks:!0,tickColor:Tw,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-1},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:Ow,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:Tw,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}())};function config_copy(e,t,r,n){var i,a;if(Object(V.F)(r)&&!Object(V.A)(r))for(i in a=Object(V.F)(e[t])?e[t]:e[t]={},r)n&&(!0===n||n[i])?config_copy(a,i,r[i]):a[i]=r[i];else e[t]=r}function mergeNamed(e,t){if(null==e)return t;var r={},n=[];function add(e){r[e.name]||(r[e.name]=1,n.push(e))}return t.forEach(add),e.forEach(add),n}var ww="sans-serif",kw=30,Sw=2,Ew="#4c78a8",Cw="#000",Tw="#888",Ow="#ddd";var Aw=function(e,t){return Object(V.F)(e)||Object(V.n)("Input Vega specification must be an object."),parseView(e,new Scope_Scope(bw([t,e.config]))).toRuntime()};function src_expression_expression(e,t,r){";"!==t[t.length-1]&&(t="return("+t+");");var n=Function.apply(null,e.concat(t));return r&&r.functions?n.bind(r.functions):n}function expression_eventExpression(e,t){return src_expression_expression(["event"],e,t)}function expression_encodeExpression(e,t){return src_expression_expression(["item","_"],e,t)}function parameters_parseParameters(e,t,r){var n,i;for(n in r=r||{},e)i=e[n],r[n]=Object(V.A)(i)?i.map((function(e){return parameters_parseParameter(e,t,r)})):parameters_parseParameter(i,t,r);return r}function parameters_parseParameter(e,t,r){if(!e||!Object(V.F)(e))return e;for(var n,i=0,a=Rw.length;i<a;++i)if(n=Rw[i],Object(V.v)(e,n.key))return n.parse(e,t,r);return e}var Rw=[{key:"$ref",parse:function parameters_getOperator(e,t){return t.get(e.$ref)||Object(V.n)("Operator not defined: "+e.$ref)}},{key:"$key",parse:function parameters_getKey(e,t){var r="k:"+e.$key+"_"+!!e.$flat;return t.fn[r]||(t.fn[r]=Object(V.I)(e.$key,e.$flat))}},{key:"$expr",parse:function parameters_getExpression(e,t,r){e.$params&&parameters_parseParameters(e.$params,t,r);var n="e:"+e.$expr+"_"+e.$name;return t.fn[n]||(t.fn[n]=Object(V.f)(function expression_parameterExpression(e,t){return src_expression_expression(["datum","_"],e,t)}(e.$expr,t),e.$fields,e.$name))}},{key:"$field",parse:function src_parameters_getField(e,t){if(!e.$field)return null;var r="f:"+e.$field+"_"+e.$name;return t.fn[r]||(t.fn[r]=Object(V.t)(e.$field,e.$name))}},{key:"$encode",parse:function parameters_getEncode(e,t){var r,n,i=e.$encode,a={};for(r in i)n=i[r],a[r]=Object(V.f)(expression_encodeExpression(n.$expr,t),n.$fields),a[r].output=n.$output;return a}},{key:"$compare",parse:function parameters_getCompare(e,t){var r="c:"+e.$compare+"_"+e.$order,n=Object(V.i)(e.$compare).map((function(e){return e&&e.$tupleid?tupleid:e}));return t.fn[r]||(t.fn[r]=Object(V.k)(n,e.$order))}},{key:"$context",parse:function src_parameters_getContext(e,t){return t}},{key:"$subflow",parse:function parameters_getSubflow(e,t){var r=e.$subflow;return function(e,n,i){var a=jw(r,t.fork()),o=a.get(r.operators[0].id),s=a.signals.parent;return s&&s.set(i),o}}},{key:"$tupleid",parse:function parameters_getTupleId(){return tupleid}}];function util_canonicalType(e){return(e+"").toLowerCase()}var Dw=function(e,t){!function util_isOperator(e){return"operator"===util_canonicalType(e)}(e.type)&&e.type?t.transform(e,e.type):t.operator(e,e.update?function expression_operatorExpression(e,t){return src_expression_expression(["_"],e,t)}(e.update,t):null)};var Pw=function(e,t){var r=Object(V.F)(r=e.source)?r.$ref:r,n=t.get(r),i=null,a=e.update,o=void 0;n||Object(V.n)("Source not defined: "+e.source),i=e.target&&e.target.$expr?expression_eventExpression(e.target.$expr,t):t.get(e.target),a&&a.$expr&&(a.$params&&(o=parameters_parseParameters(a.$params,t)),a=function expression_handlerExpression(e,t){return src_expression_expression(["_","event"],e,t)}(a.$expr,t)),t.update(e,n,i,a,o)},jw=function(e,t){var r=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),r.forEach((function(e){Dw(e,t)})),r.forEach((function(e){!function operator_parseOperatorParameters(e,t){if(e.params){var r=t.get(e.id);r||Object(V.n)("Invalid operator id: "+e.id),t.dataflow.connect(r,r.parameters(parameters_parseParameters(e.params,t),e.react,e.initonly))}}(e,t)})),(e.streams||[]).forEach((function(e){!function(e,t){var r,n=null!=e.filter?expression_eventExpression(e.filter,t):void 0,i=null!=e.stream?t.get(e.stream):void 0;e.source?i=t.events(e.source,e.type,n):e.merge&&(i=(r=e.merge.map(t.get.bind(t)))[0].merge.apply(r[0],r.slice(1))),e.between&&(r=e.between.map(t.get.bind(t)),i=i.between(r[0],r[1])),e.filter&&(i=i.filter(n)),null!=e.throttle&&(i=i.throttle(+e.throttle)),null!=e.debounce&&(i=i.debounce(+e.debounce)),null==i&&Object(V.n)("Invalid stream definition: "+JSON.stringify(e)),e.consume&&i.consume(!0),t.stream(e,i)}(e,t)})),(e.updates||[]).forEach((function(e){Pw(e,t)})),t.resolve()},Mw={skip:!0};var Fw=function(e,t,r){return new context_Context(e,t,r)};function context_Context(e,t,r){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},r&&(this.functions=Object.create(r),this.functions.context=this)}function context_ContextFork(e){this.dataflow=e.dataflow,this.transforms=e.transforms,this.functions=e.functions,this.events=e.events,this.signals=Object.create(e.signals),this.scales=Object.create(e.scales),this.nodes=Object.create(e.nodes),this.data=Object.create(e.data),this.fn=Object.create(e.fn),e.functions&&(this.functions=Object.create(e.functions),this.functions.context=this)}context_Context.prototype=context_ContextFork.prototype={fork:function fork(){var e=new context_ContextFork(this);return(this.subcontext||(this.subcontext=[])).push(e),e},get:function get(e){return this.nodes[e]},set:function set(e,t){return this.nodes[e]=t},add:function add(e,t){var r,n=this,i=n.dataflow;if(n.set(e.id,t),function util_isCollect(e){return"collect"===util_canonicalType(e)}(e.type)&&(r=e.value)&&(r.$ingest?i.ingest(t,r.$ingest,r.$format):r.$request?i.preload(t,r.$request,r.$format):i.pulse(t,i.changeset().insert(r))),e.root&&(n.root=t),e.parent){var a=n.get(e.parent.$ref);a?(i.connect(a,[t]),t.targets().add(a)):(n.unresolved=n.unresolved||[]).push((function(){a=n.get(e.parent.$ref),i.connect(a,[t]),t.targets().add(a)}))}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(var o in e.data)r=n.data[o]||(n.data[o]={}),e.data[o].forEach((function(e){r[e]=t}))},resolve:function resolve(){return(this.unresolved||[]).forEach((function(e){e()})),delete this.unresolved,this},operator:function operator(e,t){this.add(e,this.dataflow.add(e.value,t))},transform:function transform(e,t){this.add(e,this.dataflow.add(this.transforms[util_canonicalType(t)]))},stream:function stream(e,t){this.set(e.id,t)},update:function update(e,t,r,n,i){this.dataflow.on(t,r,n,i,e.options)},getState:function src_state_getState(e){var t=this,r={};if(e.signals){var n=r.signals={};Object.keys(t.signals).forEach((function(r){var i=t.signals[r];e.signals(r,i)&&(n[r]=i.value)}))}if(e.data){var i=r.data={};Object.keys(t.data).forEach((function(r){var n=t.data[r];e.data(r,n)&&(i[r]=n.input.value)}))}return t.subcontext&&!1!==e.recurse&&(r.subcontext=t.subcontext.map((function(t){return t.getState(e)}))),r},setState:function src_state_setState(e){var t=this,r=t.dataflow,n=e.data,i=e.signals;Object.keys(i||{}).forEach((function(e){r.update(t.signals[e],i[e],Mw)})),Object.keys(n||{}).forEach((function(e){r.pulse(t.data[e].input,r.changeset().remove(V.eb).insert(n[e]))})),(e.subcontext||[]).forEach((function(e,r){var n=t.subcontext[r];n&&n.setState(e)}))}},Object(V.o)(yt,n,a,s,u,l,c,d,h,g,m);var Iw=r(234),Lw=function(e,t,r){return e.fields=t||[],e.fname=r,e};var Nw=function(e){throw Error(e)},Bw=function(e){var t,r,n,i=[],a=null,o=0,s=e.length,u="";function push(){i.push(u+e.substring(t,r)),u="",t=r+1}for(e+="",t=r=0;r<s;++r)if("\\"===(n=e[r]))u+=e.substring(t,r),t=++r;else if(n===a)push(),a=null,o=-1;else{if(a)continue;t===o&&'"'===n?(t=r+1,a=n):t===o&&"'"===n?(t=r+1,a=n):"."!==n||o?"["===n?(r>t&&push(),o=t=r+1):"]"===n&&(o||Nw("Access path missing open bracket: "+e),o>0&&push(),o=0,t=r+1):r>t?push():t=r+1}return o&&Nw("Access path missing closing bracket: "+e),a&&Nw("Access path missing closing quote: "+e),r>t&&(r++,push()),i},Uw=Array.isArray,zw=function(e){return e===Object(e)},qw=function(e){return"string"===typeof e};function stringValue_$(e){return Uw(e)?"["+e.map(stringValue_$)+"]":zw(e)||qw(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}var Ww=[],Gw=(function(e,t){var r=Bw(e),n="return _["+r.map(stringValue_$).join("][")+"];";Lw(Function("_",n),[e=1===r.length?r[0]:e],t||e)}("id"),Lw((function(e){return e}),Ww,"identity"));Lw((function(){return 0}),Ww,"zero"),Lw((function(){return 1}),Ww,"one"),Lw((function(){return!0}),Ww,"true"),Lw((function(){return!1}),Ww,"false");function logger_log(e,t,r){var n,i=[t].concat([].slice.call(r));(n=console)[e].apply(n,Object(Ra.a)(i))}var Hw=function(e){return null!=e?Uw(e)?e:[e]:[]},Vw=function(e){return"function"===typeof e},Yw=function(e){return"boolean"===typeof e},$w=function(e){return"number"===typeof e};var Xw=function(e){for(var t={},r=0,n=e.length;r<n;++r)t[e[r]]=!0;return t},Kw=r(235),Jw=r.n(Kw),Qw=r(236),Zw=r.n(Qw),ek=r(96),tk=r.n(ek);function isLogicalOr(e){return!!e.or}function isLogicalAnd(e){return!!e.and}function isLogicalNot(e){return!!e.not}function normalizeLogicalOperand(e,t){return isLogicalNot(e)?{not:normalizeLogicalOperand(e.not,t)}:isLogicalAnd(e)?{and:e.and.map((function(e){return normalizeLogicalOperand(e,t)}))}:isLogicalOr(e)?{or:e.or.map((function(e){return normalizeLogicalOperand(e,t)}))}:t(e)}var rk=Zw.a,nk=Jw.a;function util_pick(e,t){var r={},n=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var u=o.value;e.hasOwnProperty(u)&&(r[u]=e[u])}}catch(l){i=!0,a=l}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r}function omit(e,t){var r=Object.assign({},e),n=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){delete r[o.value]}}catch(u){i=!0,a=u}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r}Set.prototype.toJSON=function(){return"Set(".concat(Object(Ra.a)(this).map((function(e){return tk()(e)})).join(","),")")};var ik=tk.a;function util_hash(e){if($w(e))return e;var t=qw(e)?e:tk()(e);if(t.length<250)return t;for(var r=0,n=0;n<t.length;n++){r=(r<<5)-r+t.charCodeAt(n),r&=r}return r}function isNullOrFalse(e){return!1===e||null===e}function util_contains(e,t){return e.indexOf(t)>-1}function some(e,t){var r=0,n=!0,i=!1,a=void 0;try{for(var o,s=e.entries()[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var u=o.value,l=Object(qt.a)(u,2),c=l[0];if(t(l[1],c,r++))return!0}}catch(f){i=!0,a=f}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return!1}function every(e,t){var r=0,n=!0,i=!1,a=void 0;try{for(var o,s=e.entries()[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var u=o.value,l=Object(qt.a)(u,2),c=l[0];if(!t(l[1],c,r++))return!1}}catch(f){i=!0,a=f}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return!0}function util_flatten(e){var t;return(t=[]).concat.apply(t,Object(Ra.a)(e))}function mergeDeep(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(var i=0,a=r;i<a.length;i++){e=deepMerge_(e,a[i])}return e}function deepMerge_(e,t){if("object"!==typeof t||null===t)return e;for(var r in t)t.hasOwnProperty(r)&&void 0!==t[r]&&("object"!==typeof t[r]||Uw(t[r])||null===t[r]?e[r]=t[r]:"object"!==typeof e[r]||null===e[r]?e[r]=mergeDeep(Uw(t[r].constructor)?[]:{},t[r]):mergeDeep(e[r],t[r]));return e}function unique(e,t){var r,n=[],i={},a=!0,o=!1,s=void 0;try{for(var u,l=e[Symbol.iterator]();!(a=(u=l.next()).done);a=!0){var c=u.value;(r=t(c))in i||(i[r]=1,n.push(c))}}catch(f){o=!0,s=f}finally{try{a||null==l.return||l.return()}finally{if(o)throw s}}return n}function hasIntersection(e,t){var r=!0,n=!1,i=void 0;try{for(var a,o=e[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;if(t.has(s))return!0}}catch(u){n=!0,i=u}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}return!1}function prefixGenerator(e){var t=new Set,r=!0,n=!1,i=void 0;try{for(var a,o=function _loop(){var e=a.value,r=Bw(e).map((function(e,t){return 0===t?e:"[".concat(e,"]")}));r.map((function(e,t){return r.slice(0,t+1).join("")})).forEach((function(e){return t.add(e)}))},s=e[Symbol.iterator]();!(r=(a=s.next()).done);r=!0)o()}catch(u){n=!0,i=u}finally{try{r||null==s.return||s.return()}finally{if(n)throw i}}return t}function fieldIntersection(e,t){return hasIntersection(prefixGenerator(e),prefixGenerator(t))}var ak=Object.keys;function util_vals(e){var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(e[r]);return t}function util_isBoolean(e){return!0===e||!1===e}function varName(e){var t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function logicalExpr(e,t){return isLogicalNot(e)?"!("+logicalExpr(e.not,t)+")":isLogicalAnd(e)?"("+e.and.map((function(e){return logicalExpr(e,t)})).join(") && (")+")":isLogicalOr(e)?"("+e.or.map((function(e){return logicalExpr(e,t)})).join(") || (")+")":t(e)}function deleteNestedProperty(e,t){if(0===t.length)return!0;var r=t.shift();return deleteNestedProperty(e[r],t)&&delete e[r],0===ak(e).length}function titlecase(e){return e.charAt(0).toUpperCase()+e.substr(1)}function accessPathWithDatum(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"datum",r=Bw(e),n=[],i=1;i<=r.length;i++){var a="[".concat(r.slice(0,i).map(stringValue_$).join("]["),"]");n.push("".concat(t).concat(a))}return n.join(" && ")}function replacePathInField(e){return"".concat(Bw(e).map((function(e){return e.replace(".","\\.")})).join("\\."))}function removePathFromField(e){return"".concat(Bw(e).join("."))}function accessPathDepth(e){return e?Bw(e).length:0}function getFirstDefined(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0,i=t;n<i.length;n++){var a=i[n];if(void 0!==a)return a}}var ok=42;function uniqueId(e){var t=++ok;return e?String(e)+t:t}function normalizeAngle(e){return(e%360+360)%360}var sk="area",uk="bar",lk="line",ck="point",fk="rect",dk="rule",hk="text",pk="tick",gk="trail",mk="circle",vk="square",yk="geoshape",_k={area:1,bar:1,line:1,point:1,text:1,tick:1,trail:1,rect:1,geoshape:1,rule:1,circle:1,square:1};function isPathMark(e){return util_contains(["line","area","trail"],e)}var bk=ak(_k);function isMarkDef(e){return e.type}Xw(bk);var xk=[].concat(["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],["fill","fillOpacity"]),wk=["filled","color","tooltip"],kk={binSpacing:1,continuousBandSize:5},Sk={binSpacing:0,continuousBandSize:5};function isUnitSpec(e){return!!e.mark}var Ek=function(){function CompositeMarkNormalizer(e,t){Object(_d.a)(this,CompositeMarkNormalizer),this.name=e,this.run=t}return Object(bd.a)(CompositeMarkNormalizer,[{key:"hasMatchingType",value:function hasMatchingType(e){return!!isUnitSpec(e)&&function getMarkType(e){return isMarkDef(e)?e.type:e}(e.mark)===this.name}}]),CompositeMarkNormalizer}(),Ck={argmax:1,argmin:1,average:1,count:1,distinct:1,max:1,mean:1,median:1,min:1,missing:1,q1:1,q3:1,ci0:1,ci1:1,stderr:1,stdev:1,stdevp:1,sum:1,valid:1,values:1,variance:1,variancep:1};function isArgminDef(e){return!!e&&!!e.argmin}function isArgmaxDef(e){return!!e&&!!e.argmax}ak(Ck);function isAggregateOp(e){return qw(e)&&!!Ck[e]}var Tk=["count","valid","missing","distinct"];function isCountingAggregateOp(e){return e&&qw(e)&&util_contains(Tk,e)}var Ok=["count","sum","distinct","valid","missing"],Ak=Xw(["mean","average","median","q1","q3","min","max"]),Rk="row",Dk="column",Pk="facet",jk="x",Mk="y",Fk="x2",Ik="y2",Lk="latitude",Nk="longitude",Bk="latitude2",Uk="longitude2",zk="color",qk="fill",Wk="stroke",Gk="shape",Hk="size",Vk="opacity",Yk="fillOpacity",$k="strokeOpacity",Xk="strokeWidth",Kk="text",Jk="order",Qk="detail",Zk="key",eS="tooltip",tS="href",rS={x:1,y:1,x2:1,y2:1};var nS={longitude:1,longitude2:1,latitude:1,latitude2:1};var iS=ak(nS),aS=Object.assign({},rS,nS,{color:1,fill:1,stroke:1,opacity:1,fillOpacity:1,strokeOpacity:1,strokeWidth:1,size:1,shape:1,order:1,text:1,detail:1,key:1,tooltip:1,href:1});function isColorChannel(e){return"color"===e||"fill"===e||"stroke"===e}var oS={row:1,column:1,facet:1},sS=ak(oS),uS=Object.assign({},aS,oS),lS=ak(uS),cS=(uS.order,uS.detail,__rest(uS,["order","detail"])),fS=(uS.order,uS.detail,uS.row,uS.column,uS.facet,__rest(uS,["order","detail","row","column","facet"]));ak(cS),ak(fS);function isChannel(e){return!!uS[e]}var dS=["x2","y2","latitude2","longitude2"];function isSecondaryRangeChannel(e){return getMainRangeChannel(e)!==e}function getMainRangeChannel(e){switch(e){case"x2":return"x";case"y2":return"y";case"latitude2":return"latitude";case"longitude2":return"longitude"}return e}ak(aS),aS.x,aS.y,aS.x2,aS.y2,aS.latitude,aS.longitude,aS.latitude2,aS.longitude2;var hS=__rest(aS,["x","y","x2","y2","latitude","longitude","latitude2","longitude2"]),pS=ak(hS),gS={x:1,y:1},mS=ak(gS),vS=(hS.text,hS.tooltip,hS.href,hS.detail,hS.key,hS.order,__rest(hS,["text","tooltip","href","detail","key","order"])),yS=ak(vS);var _S=Object.assign({},gS,vS),bS=ak(_S);function isScaleChannel(e){return!!_S[e]}function supportMark(e,t){return function getSupportedMark(e){switch(e){case zk:case qk:case Wk:case Qk:case Zk:case eS:case tS:case Jk:case Vk:case Yk:case $k:case Xk:case Pk:case Rk:case Dk:return xS;case jk:case Mk:case Lk:case Nk:return wS;case Fk:case Ik:case Bk:case Uk:return{rule:"always",bar:"always",rect:"always",area:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case Hk:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case Gk:return{point:"always",geoshape:"always"};case Kk:return{text:"always"}}}(e)[t]}var xS={area:"always",bar:"always",circle:"always",geoshape:"always",line:"always",rule:"always",point:"always",rect:"always",square:"always",trail:"always",text:"always",tick:"always"},wS=(xS.geoshape,__rest(xS,["geoshape"]));function rangeType(e){switch(e){case jk:case Mk:case Hk:case Xk:case Vk:case Yk:case $k:case Fk:case Ik:return;case Pk:case Rk:case Dk:case Gk:case Kk:case eS:case tS:return"discrete";case zk:case qk:case Wk:return"flexible";case Lk:case Nk:case Bk:case Uk:case Qk:case Zk:case Jk:return}throw new Error("rangeType not implemented for "+e)}var kS="Invalid spec",SS='Autosize "fit" only works for single views and layered views.',ES='Cannot use a fixed value of "rangeStep" when "autosize" is "fit".';function cannotProjectOnChannelWithoutField(e){return'Cannot project a selection on encoding channel "'.concat(e,'", which has no field.')}function nearestNotSupportForContinuous(e){return'The "nearest" transform is not supported for '.concat(e," marks.")}function selectionNotSupported(e){return"Selection not supported for ".concat(e," yet")}function selectionNotFound(e){return'Cannot find a selection named "'.concat(e,'"')}var CS="Scale bindings are currently only supported for scales with unbinned, continuous domains.",TS="Selections bound to scales cannot be separately initialized.";function noSuchRepeatedValue(e){return'Unknown repeated value "'.concat(e,'".')}function columnsNotSupportByRowCol(e){return'The "columns" property cannot be used when "'.concat(e,'" has nested row/column.')}var OS="Axes cannot be shared in concatenated views yet (https://github.com/vega/vega-lite/issues/2415).",AS="Axes cannot be shared in repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function unrecognizedParse(e){return'Unrecognized parse "'.concat(e,'".')}function differentParse(e,t,r){return'An ancestor parsed field "'.concat(e,'" as ').concat(r," but a child wants to parse the field as ").concat(t,".")}function invalidTransformIgnored(e){return"Ignoring an invalid transform: ".concat(ik(e),".")}var RS='If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.';function encodingOverridden(e){return"Layer's shared ".concat(e.join(",")," channel ").concat(1===e.length?"is":"are"," overriden")}function projectionOverridden(e){var t=e.parentProjection,r=e.projection;return"Layer's shared projection ".concat(ik(t)," is overridden by a child projection ").concat(ik(r),".")}function primitiveChannelDef(e,t,r){return"Channel ".concat(e," is a ").concat(t,". Converted to {value: ").concat(ik(r),"}.")}function invalidFieldType(e){return'Invalid field type "'.concat(e,'"')}function nonZeroScaleUsedWithLengthMark(e,t,r){var n=r.scaleType?"".concat(r.scaleType," scale"):r.zeroFalse?"scale with zero=false":"scale with custom domain that excludes zero";return"A ".concat(n," is used to encode ").concat(e,"'s ").concat(t,". This can be misleading as the ").concat("x"===t?"width":"height"," of the ").concat(e," can be arbitrary based on the scale domain. You may want to use point mark instead.")}function invalidFieldTypeForCountAggregate(e,t){return'Invalid field type "'.concat(e,'" for aggregate: "').concat(t,'", using "quantitative" instead.')}function invalidAggregate(e){return'Invalid aggregation operator "'.concat(e,'"')}function missingFieldType(e,t){return'Missing type for channel "'.concat(e,'", using "').concat(t,'" instead.')}function droppingColor(e,t){var r=t.fill,n=t.stroke;return"Dropping color ".concat(e," as the plot also has ")+(r&&n?"fill and stroke":r?"fill":"stroke")}function emptyFieldDef(e,t){return"Dropping ".concat(ik(e),' from channel "').concat(t,'" since it does not contain data field or value.')}function latLongDeprecated(e,t,r){return"".concat(e,"-encoding with type ").concat(t," is deprecated. Replacing with ").concat(r,"-encoding.")}var DS="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function incompatibleChannel(e,t,r){return"".concat(e,' dropped as it is incompatible with "').concat(t,'"').concat(r?" when ".concat(r):"",".")}function invalidEncodingChannel(e){return"".concat(e,"-encoding is dropped as ").concat(e," is not a valid encoding channel.")}function facetChannelShouldBeDiscrete(e){return"".concat(e," encoding should be discrete (ordinal / nominal / binned).")}function facetChannelDropped(e){return"Facet encoding dropped as ".concat(e.join(" and ")," ").concat(e.length>1?"are":"is"," also specified.")}function discreteChannelCannotEncode(e,t){return'Using discrete channel "'.concat(e,'" to encode "').concat(t,'" field can be misleading as it does not encode ').concat("ordinal"===t?"order":"magnitude",".")}var PS="Bar mark should not be used with point scale when rangeStep is null. Please use band scale instead.";function lineWithRange(e,t){return"Line mark is for continuous lines and thus cannot be used with ".concat(e&&t?"x2 and y2":e?"x2":"y2",". We will use the rule mark (line segments) instead.")}function orientOverridden(e,t){return'Specified orient "'.concat(e,'" overridden with "').concat(t,'"')}var jS="custom domain scale cannot be unioned with default field-based domain";function cannotUseScalePropertyWithNonColor(e){return'Cannot use the scale property "'.concat(e,'" with non-color channel.')}function unaggregateDomainHasNoEffectForRawField(e){return"Using unaggregated domain with raw field has no effect (".concat(ik(e),").")}function unaggregateDomainWithNonSharedDomainOp(e){return'Unaggregated domain not applicable for "'.concat(e,'" since it produces values outside the origin domain of the source data.')}function unaggregatedDomainWithLogScale(e){return"Unaggregated domain is currently unsupported for log scale (".concat(ik(e),").")}function cannotApplySizeToNonOrientedMark(e){return'Cannot apply size to non-oriented mark "'.concat(e,'".')}function rangeStepDropped(e){return'rangeStep for "'.concat(e,'" is dropped as top-level ').concat("x"===e?"width":"height"," is provided.")}function scaleTypeNotWorkWithChannel(e,t,r){return'Channel "'.concat(e,'" does not work with "').concat(t,'" scale. We are using "').concat(r,'" scale instead.')}function scaleTypeNotWorkWithFieldDef(e,t){return'FieldDef does not work with "'.concat(e,'" scale. We are using "').concat(t,'" scale instead.')}function scalePropertyNotWorkWithScaleType(e,t,r){return"".concat(r,"-scale's \"").concat(t,'" is dropped as it does not work with ').concat(e," scale.")}function scaleTypeNotWorkWithMark(e,t){return'Scale type "'.concat(t,'" does not work with mark "').concat(e,'".')}function mergeConflictingProperty(e,t,r,n){return"Conflicting ".concat(t.toString(),' property "').concat(e.toString(),'" (').concat(ik(r)," and ").concat(ik(n),"). Using ").concat(ik(r),".")}function mergeConflictingDomainProperty(e,t,r,n){return"Conflicting ".concat(t.toString(),' property "').concat(e.toString(),'" (').concat(ik(r)," and ").concat(ik(n),"). Using the union of the two domains.")}function independentScaleMeansIndependentGuide(e){return'Setting the scale to be independent for "'.concat(e,'" means we also have to set the guide (axis or legend) to be independent.')}function domainSortDropped(e){return"Dropping sort property ".concat(ik(e)," as unioned domains only support boolean or op 'count'.")}var MS="Unable to merge domains",FS="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",IS="Invalid channel for axis.";function cannotStackRangedMark(e){return'Cannot stack "'.concat(e,'" if there is already "').concat(e,'2"')}function cannotStackNonLinearScale(e){return"Cannot stack non-linear scale (".concat(e,")")}function stackNonSummativeAggregate(e){return'Stacking is applied even though the aggregate function is non-summative ("'.concat(e,'")')}function invalidTimeUnit(e,t){return"Invalid ".concat(e,": ").concat(ik(t))}function dayReplacedWithDate(e){return'Time unit "'.concat(e,'" is not supported. We are replacing it with ').concat(e.replace("day","date"),".")}function droppedDay(e){return"Dropping day from datetime ".concat(ik(e)," as day cannot be combined with other units.")}function errorBarCenterAndExtentAreNotNeeded(e,t){return"".concat(t?"extent ":"").concat(t&&e?"and ":"").concat(e?"center ":"").concat(t&&e?"are ":"is ","not needed when data are aggregated.")}function errorBarCenterIsUsedWithWrongExtent(e,t,r){return"".concat(e," is not usually used with ").concat(t," for ").concat(r,".")}function errorBarContinuousAxisHasCustomizedAggregate(e,t){return"Continuous axis should not have customized aggregation function ".concat(e,"; ").concat(t," already agregates the axis.")}function errorBarCenterIsNotNeeded(e,t){return"Center is not needed to be specified in ".concat(t," when extent is ").concat(e,".")}function errorBand1DNotSupport(e){return"1D error band does not support ".concat(e)}function channelRequiredForBinned(e){return"Channel ".concat(e,' is required for "binned" bin')}function domainRequiredForThresholdScale(e){return"Domain for ".concat(e," is required for threshold scale")}var LS=y,NS=function(e,t){var r=e||0;return{level:function level(e){return arguments.length?(r=+e,this):r},error:function error(){return r>=1&&logger_log(t||"error","ERROR",arguments),this},warn:function warn(){return r>=2&&logger_log(t||"warn","WARN",arguments),this},info:function info(){return r>=3&&logger_log(t||"log","INFO",arguments),this},debug:function debug(){return r>=4&&logger_log(t||"log","DEBUG",arguments),this}}}(2),BS=NS;function log_reset(){return BS=NS}function log_warn(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];BS.warn.apply(BS,arguments)}var US=2006;function isDateTime(e){return!!e&&(!!e.year||!!e.quarter||!!e.month||!!e.date||!!e.day||!!e.hours||!!e.minutes||!!e.seconds||!!e.milliseconds)}var zS,qS=["january","february","march","april","may","june","july","august","september","october","november","december"],WS=qS.map((function(e){return e.substr(0,3)})),GS=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],HS=GS.map((function(e){return e.substr(0,3)}));function dateTimeExpr(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=[];if(t&&void 0!==e.day&&ak(e).length>1&&(log_warn(LS.droppedDay(e)),delete(e=nk(e)).day),void 0!==e.year?n.push(e.year):void 0!==e.day?n.push(US):n.push(0),void 0!==e.month){var i=t?function normalizeMonth(e){if($w(e))return(e-1).toString();var t=e.toLowerCase(),r=qS.indexOf(t);if(-1!==r)return r+"";var n=t.substr(0,3),i=WS.indexOf(n);if(-1!==i)return i+"";throw new Error(LS.invalidTimeUnit("month",e))}(e.month):e.month;n.push(i)}else if(void 0!==e.quarter){var a=t?function normalizeQuarter(e){if($w(e))return e>4&&log_warn(LS.invalidTimeUnit("quarter",e)),(e-1).toString();throw new Error(LS.invalidTimeUnit("quarter",e))}(e.quarter):e.quarter;n.push(a+"*3")}else n.push(0);if(void 0!==e.date)n.push(e.date);else if(void 0!==e.day){var o=t?function normalizeDay(e){if($w(e))return e%7+"";var t=e.toLowerCase(),r=GS.indexOf(t);if(-1!==r)return r+"";var n=t.substr(0,3),i=HS.indexOf(n);if(-1!==i)return i+"";throw new Error(LS.invalidTimeUnit("day",e))}(e.day):e.day;n.push(o+"+1")}else n.push(1);for(var s=0,u=["hours","minutes","seconds","milliseconds"];s<u.length;s++){var l=u[s];void 0!==e[l]?n.push(e[l]):n.push(0)}var c=n.join(", ");return r?e.utc?new Function("return new Date(Date.UTC(".concat(c,"))"))().toJSON():new Function("return new Date(".concat(c,")"))().toJSON():e.utc?"utc(".concat(c,")"):"datetime(".concat(c,")")}function isFacetMapping(e){return!!e.row||!!e.column}function isFacetSpec(e){return void 0!==e.facet}!function(e){e.YEAR="year",e.MONTH="month",e.DAY="day",e.DATE="date",e.HOURS="hours",e.MINUTES="minutes",e.SECONDS="seconds",e.MILLISECONDS="milliseconds",e.YEARMONTH="yearmonth",e.YEARMONTHDATE="yearmonthdate",e.YEARMONTHDATEHOURS="yearmonthdatehours",e.YEARMONTHDATEHOURSMINUTES="yearmonthdatehoursminutes",e.YEARMONTHDATEHOURSMINUTESSECONDS="yearmonthdatehoursminutesseconds",e.MONTHDATE="monthdate",e.MONTHDATEHOURS="monthdatehours",e.HOURSMINUTES="hoursminutes",e.HOURSMINUTESSECONDS="hoursminutesseconds",e.MINUTESSECONDS="minutesseconds",e.SECONDSMILLISECONDS="secondsmilliseconds",e.QUARTER="quarter",e.YEARQUARTER="yearquarter",e.QUARTERMONTH="quartermonth",e.YEARQUARTERMONTH="yearquartermonth",e.UTCYEAR="utcyear",e.UTCMONTH="utcmonth",e.UTCDAY="utcday",e.UTCDATE="utcdate",e.UTCHOURS="utchours",e.UTCMINUTES="utcminutes",e.UTCSECONDS="utcseconds",e.UTCMILLISECONDS="utcmilliseconds",e.UTCYEARMONTH="utcyearmonth",e.UTCYEARMONTHDATE="utcyearmonthdate",e.UTCYEARMONTHDATEHOURS="utcyearmonthdatehours",e.UTCYEARMONTHDATEHOURSMINUTES="utcyearmonthdatehoursminutes",e.UTCYEARMONTHDATEHOURSMINUTESSECONDS="utcyearmonthdatehoursminutesseconds",e.UTCMONTHDATE="utcmonthdate",e.UTCMONTHDATEHOURS="utcmonthdatehours",e.UTCHOURSMINUTES="utchoursminutes",e.UTCHOURSMINUTESSECONDS="utchoursminutesseconds",e.UTCMINUTESSECONDS="utcminutesseconds",e.UTCSECONDSMILLISECONDS="utcsecondsmilliseconds",e.UTCQUARTER="utcquarter",e.UTCYEARQUARTER="utcyearquarter",e.UTCQUARTERMONTH="utcquartermonth",e.UTCYEARQUARTERMONTH="utcyearquartermonth"}(zS||(zS={}));var VS={year:1,quarter:1,month:1,day:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},YS=ak(VS);var $S={utcyear:1,utcquarter:1,utcmonth:1,utcday:1,utcdate:1,utchours:1,utcminutes:1,utcseconds:1,utcmilliseconds:1};var XS={utcyearquarter:1,utcyearquartermonth:1,utcyearmonth:1,utcyearmonthdate:1,utcyearmonthdatehours:1,utcyearmonthdatehoursminutes:1,utcyearmonthdatehoursminutesseconds:1,utcquartermonth:1,utcmonthdate:1,utcmonthdatehours:1,utchoursminutes:1,utchoursminutesseconds:1,utcminutesseconds:1,utcsecondsmilliseconds:1},KS=Object.assign({},$S,XS);function isUTCTimeUnit(e){return!!KS[e]}var JS=Object.assign({},VS,$S,{yearquarter:1,yearquartermonth:1,yearmonth:1,yearmonthdate:1,yearmonthdatehours:1,yearmonthdatehoursminutes:1,yearmonthdatehoursminutesseconds:1,quartermonth:1,monthdate:1,monthdatehours:1,hoursminutes:1,hoursminutesseconds:1,minutesseconds:1,secondsmilliseconds:1},XS);ak(JS);function containsTimeUnit(e,t){var r=e.indexOf(t);return r>-1&&(t!==zS.SECONDS||0===r||"i"!==e.charAt(r-1))}function timeunit_fieldExpr(e,t){var r=accessPathWithDatum(t),n=isUTCTimeUnit(e)?"utc":"";return dateTimeExpr(YS.reduce((function(t,i){return containsTimeUnit(e,i)&&(t[i]=function func(e){return e===zS.QUARTER?"(".concat(n,"quarter(").concat(r,")-1)"):"".concat(n).concat(e,"(").concat(r,")")}(i)),t}),{}))}function getDateTimeComponents(e,t){if(e){var r=[],n=containsTimeUnit(e,zS.YEAR);containsTimeUnit(e,zS.MONTH)&&r.push(!1!==t?"%b":"%B"),containsTimeUnit(e,zS.DAY)?r.push(t?"%a":"%A"):containsTimeUnit(e,zS.DATE)&&r.push("%d"+(n?",":"")),n&&r.push(t?"%y":"%Y");var i=[];containsTimeUnit(e,zS.HOURS)&&i.push("%H"),containsTimeUnit(e,zS.MINUTES)&&i.push("%M"),containsTimeUnit(e,zS.SECONDS)&&i.push("%S"),containsTimeUnit(e,zS.MILLISECONDS)&&i.push("%L");var a=[];return r.length>0&&a.push(r.join(" ")),i.length>0&&a.push(i.join(":")),a}}function normalizeTimeUnit(e){return"day"!==e&&e.indexOf("day")>=0?(log_warn(LS.dayReplacedWithDate(e)),e.replace("day","date")):e}var QS={quantitative:1,ordinal:1,temporal:1,nominal:1,geojson:1};var ZS="quantitative",eE="ordinal",tE="temporal",rE="nominal",nE="geojson";function toFieldDefBase(e){var t=e.field,r=e.timeUnit,n=e.bin,i=e.aggregate;return Object.assign({},r?{timeUnit:r}:{},n?{bin:n}:{},i?{aggregate:i}:{},{field:t})}function isConditionalDef(e){return!!e&&!!e.condition}function hasConditionalFieldDef(e){return!!e&&!!e.condition&&!Uw(e.condition)&&isFieldDef(e.condition)}function isFieldDef(e){return!!e&&(!!e.field||"count"===e.aggregate)}function isTypedFieldDef(e){return!!e&&(!!e.field&&!!e.type||"count"===e.aggregate)}function isStringFieldDef(e){return isFieldDef(e)&&qw(e.field)}function isValueDef(e){return e&&"value"in e&&void 0!==e.value}function isScaleFieldDef(e){return!!e&&(!!e.scale||!!e.sort)}function isTextFieldDef(e){return!!e&&!!e.format}function channeldef_vgField(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.field,n=t.prefix,i=t.suffix,a="";if(function isCount(e){return"count"===e.aggregate}(e))r=function internalField(e){return function isInternalField(e){return 0===e.indexOf("__")}(e)?e:"__".concat(e)}("count");else{var o;if(!t.nofn)if(function isOpFieldDef(e){return!!e.op}(e))o=e.op;else{var s=e.bin,u=e.aggregate,l=e.timeUnit;isBinning(s)?(o=binToString(s),i=(t.binSuffix||"")+(t.suffix||"")):u?isArgmaxDef(u)?(a=".".concat(r),r="argmax_".concat(u.argmax)):isArgminDef(u)?(a=".".concat(r),r="argmin_".concat(u.argmin)):o=String(u):l&&(o=String(l))}o&&(r=r?"".concat(o,"_").concat(r):o)}return i&&(r="".concat(r,"_").concat(i)),n&&(r="".concat(n,"_").concat(r)),t.forAs?r:t.expr?function flatAccessWithDatum(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"datum";return"".concat(t,"[").concat(stringValue_$(Bw(e).join(".")),"]")}(r,t.expr)+a:replacePathInField(r)+a}function channeldef_isContinuous(e){return!function channeldef_isDiscrete(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return!!e.bin;case"temporal":return!1}throw new Error(LS.invalidFieldType(e.type))}(e)}function verbalTitleFormatter(e,t){var r=e.field,n=e.bin,i=e.timeUnit,a=e.aggregate;if("count"===a)return t.countTitle;if(isBinning(n))return"".concat(r," (binned)");if(i){var o=function getTimeUnitParts(e){return YS.reduce((function(t,r){return containsTimeUnit(e,r)?[].concat(Object(Ra.a)(t),[r]):t}),[])}(i).join("-");return"".concat(r," (").concat(o,")")}return a?isArgmaxDef(a)?"".concat(r," for max ").concat(a.argmax):isArgminDef(a)?"".concat(r," for min ").concat(a.argmin):"".concat(titlecase(a)," of ").concat(r):r}var iE=function defaultTitleFormatter(e,t){switch(t.fieldTitle){case"plain":return e.field;case"functional":return function functionalTitleFormatter(e){var t=e.aggregate,r=e.bin,n=e.timeUnit,i=e.field;if(isArgmaxDef(t))return"".concat(i," for argmax(").concat(t.argmax,")");if(isArgminDef(t))return"".concat(i," for argmin(").concat(t.argmin,")");var a=t||n||isBinning(r)&&"bin";return a?a.toUpperCase()+"("+i+")":i}(e);default:return verbalTitleFormatter(e,t)}},aE=iE;function setTitleFormatter(e){aE=e}function channeldef_title(e,t,r){var n=r.allowDisabling,i=r.includeDefault,a=void 0===i||i,o=(getGuide(e)||{}).title,s=a?defaultTitle(e,t):void 0;return n?getFirstDefined(o,e.title,s):o||e.title||s}function getGuide(e){return function isPositionFieldDef(e){return!!e&&(!!e.axis||!!e.stack||!!e.impute)}(e)&&e.axis?e.axis:function isMarkPropFieldDef(e){return!!e&&!!e.legend}(e)&&e.legend?e.legend:function isFacetFieldDef(e){return!!e&&!!e.header}(e)&&e.header?e.header:void 0}function defaultTitle(e,t){return aE(e,t)}function channeldef_format(e){return isTextFieldDef(e)&&e.format?e.format:(getGuide(e)||{}).format}function getFieldDef(e){return isFieldDef(e)?e:hasConditionalFieldDef(e)?e.condition:void 0}function getTypedFieldDef(e){return isFieldDef(e)?e:hasConditionalFieldDef(e)?e.condition:void 0}function channeldef_normalize(e,t){if(qw(e)||$w(e)||Yw(e)){var r=qw(e)?"string":$w(e)?"number":"boolean";return log_warn(LS.primitiveChannelDef(t,r,e)),{value:e}}return isFieldDef(e)?normalizeFieldDef(e,t):hasConditionalFieldDef(e)?Object.assign({},e,{condition:normalizeFieldDef(e.condition,t)}):e}function normalizeFieldDef(e,t){var r=e,n=r.aggregate,i=r.timeUnit,a=r.bin;if(n&&!isAggregateOp(n)&&!isArgmaxDef(n)&&!isArgminDef(n)){e.aggregate;var o=__rest(e,["aggregate"]);log_warn(LS.invalidAggregate(n)),e=o}if(i&&(e=Object.assign({},e,{timeUnit:normalizeTimeUnit(i)})),isBinning(a)&&(e=Object.assign({},e,{bin:normalizeBin(a,t)})),bin_isBinned(a)&&!util_contains(mS,t)&&log_warn("Channel ".concat(t,' should not be used with "binned" bin')),isTypedFieldDef(e)){var s=e.type,u=function getFullName(e){if(e)switch(e=e.toLowerCase()){case"q":case ZS:return"quantitative";case"t":case tE:return"temporal";case"o":case eE:return"ordinal";case"n":case rE:return"nominal";case nE:return"geojson"}}(s);s!==u&&(e=Object.assign({},e,{type:u})),"quantitative"!==s&&isCountingAggregateOp(n)&&(log_warn(LS.invalidFieldTypeForCountAggregate(s,n)),e=Object.assign({},e,{type:"quantitative"}))}else if(!isSecondaryRangeChannel(t)){var l=function defaultType(e,t){if(e.timeUnit)return"temporal";if(isBinning(e.bin))return"quantitative";switch(rangeType(t)){case"continuous":return"quantitative";case"discrete":case"flexible":return"nominal";default:return"quantitative"}}(e,t);log_warn(LS.missingFieldType(t,l)),e=Object.assign({},e,{type:l})}if(isTypedFieldDef(e)){var c=function channelCompatibility(e,t){var r=e.type;if("geojson"===r&&"shape"!==t)return{compatible:!1,warning:"Channel ".concat(t," should not be used with a geojson data.")};switch(t){case"row":case"column":case"facet":return channeldef_isContinuous(e)?{compatible:!1,warning:LS.facetChannelShouldBeDiscrete(t)}:oE;case"x":case"y":case"color":case"fill":case"stroke":case"text":case"detail":case"key":case"tooltip":case"href":return oE;case"longitude":case"longitude2":case"latitude":case"latitude2":return r!==ZS?{compatible:!1,warning:"Channel ".concat(t," should be used with a quantitative field only, not ").concat(e.type," field.")}:oE;case"opacity":case"fillOpacity":case"strokeOpacity":case"strokeWidth":case"size":case"x2":case"y2":return"nominal"!==r||e.sort?oE:{compatible:!1,warning:"Channel ".concat(t," should not be used with an unsorted discrete field.")};case"shape":return util_contains(["ordinal","nominal","geojson"],e.type)?oE:{compatible:!1,warning:"Shape channel should be used with only either discrete or geojson data."};case"order":return"nominal"!==e.type||"sort"in e?oE:{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}}throw new Error("channelCompatability not implemented for channel "+t)}(e,t),f=c.compatible,d=c.warning;f||log_warn(d)}return Object.assign({},e,void 0!==e.field?{field:"".concat(e.field)}:{})}function normalizeBin(e,t){return Yw(e)?{maxbins:autoMaxBins(t)}:"binned"===e?{binned:!0}:e.maxbins||e.step?e:Object.assign({},e,{maxbins:autoMaxBins(t)})}var oE={compatible:!0};function isTimeFormatFieldDef(e){var t=getGuide(e),r=t&&t.formatType||isTextFieldDef(e)&&e.formatType;return"time"===r||!r&&function isTimeFieldDef(e){return"temporal"===e.type||!!e.timeUnit}(e)}function valueExpr(e,t){var r,n,i=t.timeUnit,a=t.type,o=t.time,s=t.undefinedIfExprNotRequired;return isDateTime(e)?r=dateTimeExpr(e,!0):(qw(e)||$w(e))&&(i||"temporal"===a)&&(r=function isLocalSingleTimeUnit(e){return!!VS[e]}(i)?dateTimeExpr(Object(po.a)({},i,e),!0):function isUtcSingleTimeUnit(e){return!!$S[e]}(i)?valueExpr(e,{timeUnit:(n=i,n.substr(3))}):"datetime(".concat(JSON.stringify(e),")")),r?o?"time(".concat(r,")"):r:s?void 0:JSON.stringify(e)}function valueArray(e,t){var r=e.timeUnit,n=e.type;return t.map((function(e){var t=valueExpr(e,{timeUnit:r,type:n,undefinedIfExprNotRequired:!0});return void 0!==t?{signal:t}:e}))}function binRequiresRange(e,t){return isBinning(e.bin)?isScaleChannel(t)&&util_contains(["ordinal","nominal"],e.type):(console.warn("Only use this method with binned field defs"),!1)}function binToString(e){return Yw(e)&&(e=normalizeBin(e,void 0)),"bin"+ak(e).map((function(t){return varName("_".concat(t,"_").concat(e[t]))})).join("")}function isBinning(e){return!0===e||isBinParams(e)&&!e.binned}function bin_isBinned(e){return"binned"===e||isBinParams(e)&&e.binned}function isBinParams(e){return zw(e)}function autoMaxBins(e){switch(e){case Rk:case Dk:case Hk:case zk:case qk:case Wk:case Xk:case Vk:case Yk:case $k:case Gk:return 6;default:return 10}}function encoding_channelHasField(e,t){var r=e&&e[t];return!!r&&(Uw(r)?some(r,(function(e){return!!e.field})):isFieldDef(r)||hasConditionalFieldDef(r))}function encoding_isAggregate(e){return some(lS,(function(t){if(encoding_channelHasField(e,t)){var r=e[t];if(Uw(r))return some(r,(function(e){return!!e.aggregate}));var n=getFieldDef(r);return n&&!!n.aggregate}return!1}))}function extractTransformsFromEncoding(e,t){var r=[],n=[],i=[],a=[],o={};return forEach(e,(function(s,u){if(isFieldDef(s)){var l=s.field,c=s.aggregate,f=s.timeUnit,d=s.bin,h=__rest(s,["field","aggregate","timeUnit","bin"]);if(c||f||d){var p,g=getGuide(s),m=g&&g.title,v=channeldef_vgField(s,{forAs:!0}),y=Object.assign({},m?[]:{title:channeldef_title(s,t,{allowDisabling:!0})},h,{field:v}),_="x"===u||"y"===u;if(c){if(isArgmaxDef(c)?(p="argmax",v=channeldef_vgField({aggregate:"argmax",field:c.argmax},{forAs:!0}),y.field="".concat(v,".").concat(l)):isArgminDef(c)?(p="argmin",v=channeldef_vgField({aggregate:"argmin",field:c.argmin},{forAs:!0}),y.field="".concat(v,".").concat(l)):"boxplot"!==c&&"errorbar"!==c&&"errorband"!==c&&(p=c),p){var b={op:p,as:v};l&&(b.field=l),a.push(b)}}else if(r.push(v),isTypedFieldDef(s)&&isBinning(d)){if(n.push({bin:d,field:l,as:v}),r.push(channeldef_vgField(s,{binSuffix:"end"})),binRequiresRange(s,u)&&r.push(channeldef_vgField(s,{binSuffix:"range"})),_){var x={field:v+"_end"};o[u+"2"]=x}y.bin="binned",isSecondaryRangeChannel(u)||(y.type="quantitative")}else if(f){i.push({timeUnit:f,field:l,as:v});var w=getDateTimeComponents(f,t.axis.shortTimeLabels).join(" "),k=isTypedFieldDef(s)&&s.type!==tE&&"time";"text"===u||"tooltip"===u?(y.format=y.format||w,k&&(y.formatType=k)):!function isNonPositionScaleChannel(e){return!!hS[e]}(u)?_&&(y.axis=Object.assign({format:w},k?{formatType:k}:{},y.axis)):y.legend=Object.assign({format:w},k?{formatType:k}:{},y.legend)}o[u]=y}else r.push(l),o[u]=e[u]}else o[u]=e[u]})),{bins:n,timeUnits:i,aggregate:a,groupby:r,encoding:o}}function normalizeEncoding(e,t){return ak(e).reduce((function(r,n){if(!isChannel(n))return log_warn(LS.invalidEncodingChannel(n)),r;if(!function markChannelCompatible(e,t,r){var n=supportMark(t,r);if(!n)return!1;if("binned"===n){var i=e["x2"===t?"x":"y"];return!!(isFieldDef(i)&&isFieldDef(e[t])&&bin_isBinned(i.bin))}return!0}(e,n,t))return log_warn(LS.incompatibleChannel(n,t)),r;if("size"===n&&"line"===t){var i=getTypedFieldDef(e[n]);if(i&&i.aggregate)return log_warn(LS.LINE_WITH_VARYING_SIZE),r}if("color"===n&&("fill"in e||"stroke"in e))return log_warn(LS.droppingColor("encoding",{fill:"fill"in e,stroke:"stroke"in e})),r;var a=e[n];if("detail"===n||"order"===n&&!Uw(a)&&!isValueDef(a)||"tooltip"===n&&Uw(a))a&&(r[n]=(Uw(a)?a:[a]).reduce((function(e,t){return isFieldDef(t)?e.push(normalizeFieldDef(t,n)):log_warn(LS.emptyFieldDef(t,n)),e}),[]));else{if("tooltip"===n&&null===a)r[n]=null;else if(!isFieldDef(a)&&!isValueDef(a)&&!isConditionalDef(a))return log_warn(LS.emptyFieldDef(a,n)),r;r[n]=channeldef_normalize(a,n)}return r}),{})}function fieldDefs(e){var t=[],r=!0,n=!1,i=void 0;try{for(var a,o=ak(e)[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;if(encoding_channelHasField(e,s)){var u=e[s];(Uw(u)?u:[u]).forEach((function(e){isFieldDef(e)?t.push(e):hasConditionalFieldDef(e)&&t.push(e.condition)}))}}}catch(l){n=!0,i=l}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}return t}function forEach(e,t,r){if(e){var n=!0,i=!1,a=void 0;try{for(var o,s=function _loop(){var n=o.value,i=e[n];Uw(i)?i.forEach((function(e){t.call(r,e,n)})):t.call(r,i,n)},u=ak(e)[Symbol.iterator]();!(n=(o=u.next()).done);n=!0)s()}catch(l){i=!0,a=l}finally{try{n||null==u.return||u.return()}finally{if(i)throw a}}}}function encoding_reduce(e,t,r,n){return e?ak(e).reduce((function(r,i){var a=e[i];return Uw(a)?a.reduce((function(e,r){return t.call(n,e,r,i)}),r):t.call(n,r,a,i)}),r):r}function pathGroupingFields(e,t){return ak(t).reduce((function(r,n){switch(n){case"x":case"y":case"href":case"x2":case"y2":case"latitude":case"longitude":case"latitude2":case"longitude2":case"text":case"shape":case"tooltip":return r;case"order":if("line"===e||"trail"===e)return r;case"detail":case"key":var i=t[n];return(Uw(i)||isFieldDef(i))&&(Uw(i)?i:[i]).forEach((function(e){e.aggregate||r.push(channeldef_vgField(e,{}))})),r;case"size":if("trail"===e)return r;case"color":case"fill":case"stroke":case"opacity":case"fillOpacity":case"strokeOpacity":case"strokeWidth":var a=getTypedFieldDef(t[n]);return a&&!a.aggregate&&r.push(channeldef_vgField(a,{})),r}}),[])}function getCompositeMarkTooltip(e,t,r){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if("tooltip"in r)return{tooltip:r.tooltip};var i=e.map((function(e){var r=e.fieldPrefix,i=e.titlePrefix;return{field:r+t.field,type:t.type,title:i+(n?" of "+t.field:"")}}));return{tooltip:[].concat(Object(Ra.a)(i),Object(Ra.a)(fieldDefs(r)))}}function makeCompositeAggregatePartFactory(e,t,r,n,i){var a=r.scale,o=r.axis;return function(s){var u=s.partName,l=s.mark,c=s.positionPrefix,f=s.endPositionPrefix,d=void 0===f?void 0:f,h=s.extraEncoding,p=void 0===h?{}:h,g=o&&void 0!==o.title?void 0:void 0!==r.title?r.title:r.field;return partLayerMixins(e,u,i,{mark:l,encoding:Object.assign(Object(po.a)({},t,Object.assign({field:c+"_"+r.field,type:r.type},g?{title:g}:{},a?{scale:a}:{},o?{axis:o}:{})),qw(d)?Object(po.a)({},t+"2",{field:d+"_"+r.field,type:r.type}):{},n,p)})}}function partLayerMixins(e,t,r,n){var i=e.clip,a=e.color,o=e.opacity,s=e.type;return e[t]||void 0===e[t]&&r[t]?[Object.assign({},n,{mark:Object.assign({},r[t],i?{clip:i}:{},a?{color:a}:{},o?{opacity:o}:{},isMarkDef(n.mark)?n.mark:{type:n.mark},{style:"".concat(s,"-").concat(t)},Yw(e[t])?{}:e[t])})]:[]}function compositeMarkContinuousAxis(e,t,r){var n=e.encoding,i="vertical"===t?"y":"x",a=n[i],o=n[i+"2"],s=n[i+"Error"],u=n[i+"Error2"];return{continuousAxisChannelDef:filterAggregateFromChannelDef(a,r),continuousAxisChannelDef2:filterAggregateFromChannelDef(o,r),continuousAxisChannelDefError:filterAggregateFromChannelDef(s,r),continuousAxisChannelDefError2:filterAggregateFromChannelDef(u,r),continuousAxis:i}}function filterAggregateFromChannelDef(e,t){if(e&&e.aggregate){var r=e.aggregate,n=__rest(e,["aggregate"]);return r!==t&&log_warn(LS.errorBarContinuousAxisHasCustomizedAggregate(r,t)),n}return e}function compositeMarkOrient(e,t){var r=e.mark,n=e.encoding;if(isFieldDef(n.x)&&channeldef_isContinuous(n.x)){if(isFieldDef(n.y)&&channeldef_isContinuous(n.y)){if(void 0===n.x.aggregate&&n.y.aggregate===t)return"vertical";if(void 0===n.y.aggregate&&n.x.aggregate===t)return"horizontal";if(n.x.aggregate===t&&n.y.aggregate===t)throw new Error("Both x and y cannot have aggregate");return isMarkDef(r)&&r.orient?r.orient:"vertical"}return"horizontal"}if(isFieldDef(n.y)&&channeldef_isContinuous(n.y))return"vertical";throw new Error("Need a valid continuous axis for "+t+"s")}var sE="boxplot",uE=ak({box:1,median:1,outliers:1,rule:1,ticks:1}),lE=new Ek(sE,normalizeBoxPlot);function getBoxPlotType(e){return $w(e)?"tukey":e}function normalizeBoxPlot(e,t){var r=t.config,n=e.mark,i=(e.encoding,e.selection),a=(e.projection,__rest(e,["mark","encoding","selection","projection"])),o=isMarkDef(n)?n:{type:n};i&&log_warn(LS.selectionNotSupported("boxplot"));var s,u=o.extent||r.boxplot.extent,l=getFirstDefined(o.size,r.boxplot.size),c=getBoxPlotType(u),f=function boxParams(e,t,r){var n=compositeMarkOrient(e,sE),i=compositeMarkContinuousAxis(e,n,sE),a=i.continuousAxisChannelDef,o=i.continuousAxis,s=a.field,u=getBoxPlotType(t),l=[].concat(Object(Ra.a)(boxParamsQuartiles(s)),[{op:"median",field:s,as:"mid_box_"+s},{op:"min",field:s,as:("min-max"===u?"lower_whisker_":"min_")+s},{op:"max",field:s,as:("min-max"===u?"upper_whisker_":"max_")+s}]),c="min-max"===u||"tukey"===u?[]:[{calculate:'datum["upper_box_'.concat(s,'"] - datum["lower_box_').concat(s,'"]'),as:"iqr_"+s},{calculate:'min(datum["upper_box_'.concat(s,'"] + datum["iqr_').concat(s,'"] * ').concat(t,', datum["max_').concat(s,'"])'),as:"upper_whisker_"+s},{calculate:'max(datum["lower_box_'.concat(s,'"] - datum["iqr_').concat(s,'"] * ').concat(t,', datum["min_').concat(s,'"])'),as:"lower_whisker_"+s}],f=e.encoding,d=o,h=(f[d],function filterTooltipWithAggregatedField(e){var t,r,n=e.tooltip,i=__rest(e,["tooltip"]);return n?(Uw(n)?(n.forEach((function(e){e.aggregate?(t||(t=[]),t.push(e)):(r||(r=[]),r.push(e))})),t&&(i.tooltip=t)):n.aggregate?i.tooltip=n:r=n,Uw(r)&&1===r.length&&(r=r[0]),{customTooltipWithoutAggregatedField:r,filteredEncoding:i}):{filteredEncoding:e}}(__rest(f,["symbol"===typeof d?d:d+""]))),p=h.customTooltipWithoutAggregatedField,g=extractTransformsFromEncoding(h.filteredEncoding,r),m=g.bins,v=g.timeUnits,y=g.aggregate,_=g.groupby,b=g.encoding,x="vertical"===n?"horizontal":"vertical";return{transform:[].concat(Object(Ra.a)(m),Object(Ra.a)(v),[{aggregate:[].concat(Object(Ra.a)(y),Object(Ra.a)(l)),groupby:_}],c),groupby:_,aggregate:y,continuousAxisChannelDef:a,continuousAxis:o,encodingWithoutContinuousAxis:b,ticksOrient:x,customTooltipWithoutAggregatedField:p}}(e,u,r),d=f.transform,h=f.continuousAxisChannelDef,p=f.continuousAxis,g=f.groupby,m=f.aggregate,v=f.encodingWithoutContinuousAxis,y=f.ticksOrient,_=f.customTooltipWithoutAggregatedField,b=(v.color,v.size),x=__rest(v,["color","size"]),w=function makeBoxPlotPart(e){return makeCompositeAggregatePartFactory(o,p,h,e,r.boxplot)},k=w(x),S=w(v),E=w(Object.assign({},x,b?{size:b}:{})),C=getCompositeMarkTooltip([{fieldPrefix:"min-max"===c?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:"min-max"===c?"lower_whisker_":"min_",titlePrefix:"Min"}],h,v),T={type:"tick",color:"black",opacity:1,orient:y},O="min-max"===c?C:getCompositeMarkTooltip([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],h,v),A=[].concat(Object(Ra.a)(k({partName:"rule",mark:"rule",positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:O})),Object(Ra.a)(k({partName:"rule",mark:"rule",positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:O})),Object(Ra.a)(k({partName:"ticks",mark:T,positionPrefix:"lower_whisker",extraEncoding:O})),Object(Ra.a)(k({partName:"ticks",mark:T,positionPrefix:"upper_whisker",extraEncoding:O}))),R=[].concat(Object(Ra.a)("tukey"!==c?A:[]),Object(Ra.a)(S({partName:"box",mark:Object.assign({type:"bar"},l?{size:l}:{}),positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:C})),Object(Ra.a)(E({partName:"median",mark:Object.assign({type:"tick"},zw(r.boxplot.median)&&r.boxplot.median.color?{color:r.boxplot.median.color}:{},l?{size:l}:{},{orient:y}),positionPrefix:"mid_box",extraEncoding:C})));if("min-max"!==c){var D='datum["lower_box_'.concat(h.field,'"]'),P='datum["upper_box_'.concat(h.field,'"]'),j="(".concat(P," - ").concat(D,")"),M="".concat(D," - ").concat(u," * ").concat(j),F="".concat(P," + ").concat(u," * ").concat(j),I='datum["'.concat(h.field,'"]'),L={joinaggregate:boxParamsQuartiles(h.field),groupby:g},N=void 0;"tukey"===c&&(N={transform:[{filter:"(".concat(M," <= ").concat(I,") && (").concat(I," <= ").concat(F,")")},{aggregate:[{op:"min",field:h.field,as:"lower_whisker_"+h.field},{op:"max",field:h.field,as:"upper_whisker_"+h.field},{op:"min",field:"lower_box_"+h.field,as:"lower_box_"+h.field},{op:"max",field:"upper_box_"+h.field,as:"upper_box_"+h.field}].concat(Object(Ra.a)(m)),groupby:g}],layer:A});x.tooltip;var B=__rest(x,["tooltip"]),U=partLayerMixins(o,"outliers",r.boxplot,{transform:[{filter:"(".concat(I," < ").concat(M,") || (").concat(I," > ").concat(F,")")}],mark:"point",encoding:Object.assign(Object(po.a)({},p,{field:h.field,type:h.type}),B,_?{tooltip:_}:{})})[0];U&&N?s={transform:[L],layer:[U,N]}:U?(s=U).transform.unshift(L):N&&(s=N).transform.unshift(L)}return s?Object.assign({},a,{layer:[].concat(Object(Ra.a)(s?[s]:[]),[{transform:d,layer:R}])}):Object.assign({},a,{transform:(a.transform||[]).concat(d),layer:R})}function boxParamsQuartiles(e){return[{op:"q1",field:e,as:"lower_box_"+e},{op:"q3",field:e,as:"upper_box_"+e}]}var cE="errorbar",fE=ak({ticks:1,rule:1}),dE=new Ek(cE,normalizeErrorBar);function normalizeErrorBar(e,t){var r=t.config,n=errorBarParams(e,cE,r),i=n.transform,a=n.continuousAxisChannelDef,o=n.continuousAxis,s=n.encodingWithoutContinuousAxis,u=n.ticksOrient,l=n.markDef,c=n.outerSpec,f=n.tooltipEncoding,d=makeCompositeAggregatePartFactory(l,o,a,s,r.errorbar),h={type:"tick",orient:u};return Object.assign({},c,{transform:i,layer:[].concat(Object(Ra.a)(d({partName:"ticks",mark:h,positionPrefix:"lower",extraEncoding:f})),Object(Ra.a)(d({partName:"ticks",mark:h,positionPrefix:"upper",extraEncoding:f})),Object(Ra.a)(d({partName:"rule",mark:"rule",positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:f})))})}function errorBarOrientAndInputType(e,t){var r=e.encoding;if(function errorBarIsInputTypeRaw(e){return(isFieldDef(e.x)||isFieldDef(e.y))&&!isFieldDef(e.x2)&&!isFieldDef(e.y2)&&!isFieldDef(e.xError)&&!isFieldDef(e.xError2)&&!isFieldDef(e.yError)&&!isFieldDef(e.yError2)}(r))return{orient:compositeMarkOrient(e,t),inputType:"raw"};var n=function errorBarIsInputTypeAggregatedUpperLower(e){return isFieldDef(e.x2)||isFieldDef(e.y2)}(r),i=function errorBarIsInputTypeAggregatedError(e){return isFieldDef(e.xError)||isFieldDef(e.xError2)||isFieldDef(e.yError)||isFieldDef(e.yError2)}(r),a=r.x,o=r.y;if(n){if(i)throw new Error(t+" cannot be both type aggregated-upper-lower and aggregated-error");var s=r.x2,u=r.y2;if(isFieldDef(s)&&isFieldDef(u))throw new Error(t+" cannot have both x2 and y2");if(isFieldDef(s)){if(isFieldDef(a)&&channeldef_isContinuous(a))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error("Both x and x2 have to be quantitative in "+t)}if(isFieldDef(u)){if(isFieldDef(o)&&channeldef_isContinuous(o))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error("Both y and y2 have to be quantitative in "+t)}throw new Error("No ranged axis")}var l=r.xError,c=r.xError2,f=r.yError,d=r.yError2;if(isFieldDef(c)&&!isFieldDef(l))throw new Error(t+" cannot have xError2 without xError");if(isFieldDef(d)&&!isFieldDef(f))throw new Error(t+" cannot have yError2 without yError");if(isFieldDef(l)&&isFieldDef(f))throw new Error(t+" cannot have both xError and yError with both are quantiative");if(isFieldDef(l)){if(isFieldDef(a)&&channeldef_isContinuous(a))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}if(isFieldDef(f)){if(isFieldDef(o)&&channeldef_isContinuous(o))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}function errorBarParams(e,t,r){var n=e.mark,i=e.encoding,a=e.selection,o=(e.projection,__rest(e,["mark","encoding","selection","projection"])),s=isMarkDef(n)?n:{type:n};a&&log_warn(LS.selectionNotSupported(t));var u=errorBarOrientAndInputType(e,t),l=u.orient,c=u.inputType,f=compositeMarkContinuousAxis(e,l,t),d=f.continuousAxisChannelDef,h=f.continuousAxisChannelDef2,p=f.continuousAxisChannelDefError,g=f.continuousAxisChannelDefError2,m=f.continuousAxis,v=function errorBarAggregationAndCalculation(e,t,r,n,i,a,o,s){var u,l=[],c=[],f=t.field,d=!1;if("raw"===a){var h,p,g,m=e.center?e.center:e.extent?"iqr"===e.extent?"median":"mean":s.errorbar.center,v=e.extent?e.extent:"mean"===m?"stderr":"iqr";if("median"===m!==("iqr"===v)&&log_warn(LS.errorBarCenterIsUsedWithWrongExtent(m,v,o)),"stderr"===v||"stdev"===v)l=[{op:v,field:f,as:"extent_"+f},{op:m,field:f,as:"center_"+f}],c=[{calculate:'datum["center_'.concat(f,'"] + datum["extent_').concat(f,'"]'),as:"upper_"+f},{calculate:'datum["center_'.concat(f,'"] - datum["extent_').concat(f,'"]'),as:"lower_"+f}],u=[{fieldPrefix:"center_",titlePrefix:titlecase(m)},{fieldPrefix:"upper_",titlePrefix:getTitlePrefix(m,v,"+")},{fieldPrefix:"lower_",titlePrefix:getTitlePrefix(m,v,"-")}],d=!0;else e.center&&e.extent&&log_warn(LS.errorBarCenterIsNotNeeded(e.extent,o)),"ci"===v?(h="mean",p="ci0",g="ci1"):(h="median",p="q1",g="q3"),l=[{op:p,field:f,as:"lower_"+f},{op:g,field:f,as:"upper_"+f},{op:h,field:f,as:"center_"+f}],u=[{fieldPrefix:"upper_",titlePrefix:channeldef_title({field:f,aggregate:g,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:channeldef_title({field:f,aggregate:p,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:channeldef_title({field:f,aggregate:h,type:"quantitative"},s,{allowDisabling:!1})}]}else{(e.center||e.extent)&&log_warn(LS.errorBarCenterAndExtentAreNotNeeded(e.center,e.extent)),"aggregated-upper-lower"===a?(u=[],c=[{calculate:'datum["'.concat(r.field,'"]'),as:"upper_"+f},{calculate:'datum["'.concat(f,'"]'),as:"lower_"+f}]):"aggregated-error"===a&&(u=[{fieldPrefix:"",titlePrefix:f}],c=[{calculate:'datum["'.concat(f,'"] + datum["').concat(n.field,'"]'),as:"upper_"+f}],i?c.push({calculate:'datum["'.concat(f,'"] + datum["').concat(i.field,'"]'),as:"lower_"+f}):c.push({calculate:'datum["'.concat(f,'"] - datum["').concat(n.field,'"]'),as:"lower_"+f}));var y=!0,_=!1,b=void 0;try{for(var x,w=c[Symbol.iterator]();!(y=(x=w.next()).done);y=!0){var k=x.value;u.push({fieldPrefix:k.as.substring(0,6),titlePrefix:k.calculate.replace(new RegExp('datum\\[\\"',"g"),"").replace(new RegExp('\\"\\]',"g"),"")})}}catch(S){_=!0,b=S}finally{try{y||null==w.return||w.return()}finally{if(_)throw b}}}return{postAggregateCalculates:c,errorBarSpecificAggregate:l,tooltipSummary:u,tooltipTitleWithFieldName:d}}(s,d,h,p,g,c,t,r),y=v.errorBarSpecificAggregate,_=v.postAggregateCalculates,b=v.tooltipSummary,x=v.tooltipTitleWithFieldName,w=m,k=(i[w],"x"===m?"x2":"y2"),S=(i[k],"x"===m?"xError":"yError"),E=(i[S],"x"===m?"xError2":"yError2"),C=(i[E],extractTransformsFromEncoding(__rest(i,["symbol"===typeof w?w:w+"","symbol"===typeof k?k:k+"","symbol"===typeof S?S:S+"","symbol"===typeof E?E:E+""]),r)),T=C.bins,O=C.timeUnits,A=C.aggregate,R=C.groupby,D=C.encoding,P=[].concat(Object(Ra.a)(A),Object(Ra.a)(y)),j="raw"!==c?[]:R,M=getCompositeMarkTooltip(b,d,D,x);return{transform:[].concat(Object(Ra.a)(o.transform||[]),Object(Ra.a)(T),Object(Ra.a)(O),Object(Ra.a)(P.length?[{aggregate:P,groupby:j}]:[]),Object(Ra.a)(_)),groupby:j,continuousAxisChannelDef:d,continuousAxis:m,encodingWithoutContinuousAxis:D,ticksOrient:"vertical"===l?"horizontal":"vertical",markDef:s,outerSpec:o,tooltipEncoding:M}}function getTitlePrefix(e,t,r){return titlecase(e)+" "+r+" "+t}var hE="errorband",pE=ak({band:1,borders:1}),gE=new Ek(hE,normalizeErrorBand);function normalizeErrorBand(e,t){var r=t.config,n=errorBarParams(e,hE,r),i=n.transform,a=n.continuousAxisChannelDef,o=n.continuousAxis,s=n.encodingWithoutContinuousAxis,u=n.markDef,l=n.outerSpec,c=n.tooltipEncoding,f=u,d=makeCompositeAggregatePartFactory(f,o,a,s,r.errorband),h=void 0!==e.encoding.x&&void 0!==e.encoding.y,p={type:h?"area":"rect"},g={type:h?"line":"rule"},m=Object.assign({},f.interpolate?{interpolate:f.interpolate}:{},f.tension&&f.interpolate?{interpolate:f.tension}:{});return h?(p=Object.assign({},p,m),g=Object.assign({},g,m)):f.interpolate?log_warn(LS.errorBand1DNotSupport("interpolate")):f.tension&&log_warn(LS.errorBand1DNotSupport("tension")),Object.assign({},l,{transform:i,layer:[].concat(Object(Ra.a)(d({partName:"band",mark:p,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:c})),Object(Ra.a)(d({partName:"borders",mark:g,positionPrefix:"lower",extraEncoding:c})),Object(Ra.a)(d({partName:"borders",mark:g,positionPrefix:"upper",extraEncoding:c})))})}var mE={};function compositemark_add(e,t,r){var n=new Ek(e,t);mE[e]={normalizer:n,parts:r}}compositemark_add(sE,normalizeBoxPlot,uE),compositemark_add(cE,normalizeErrorBar,fE),compositemark_add(hE,normalizeErrorBand,pE);var vE,yE=["shortTimeLabels"],_E=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength"],bE={clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1},xE=Object.assign({},bE,{opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,encode:1}),wE=ak(bE),kE=ak(xE);!function(e){e.LINEAR="linear",e.LOG="log",e.POW="pow",e.SQRT="sqrt",e.SYMLOG="symlog",e.TIME="time",e.UTC="utc",e.QUANTILE="quantile",e.QUANTIZE="quantize",e.THRESHOLD="threshold",e.BIN_ORDINAL="bin-ordinal",e.ORDINAL="ordinal",e.POINT="point",e.BAND="band"}(vE||(vE={}));var SE={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"},EE=ak(SE);var CE={linear:0,log:1,pow:1,sqrt:1,symlog:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function scaleTypePrecedence(e){return CE[e]}var TE=["linear","log","pow","sqrt","symlog","time","utc"],OE=Xw(TE),AE=Xw(["quantile","quantize","threshold"]),RE=Xw(TE.concat(["quantile","quantize","threshold"])),DE=Xw(["ordinal","bin-ordinal","point","band"]);function hasDiscreteDomain(e){return e in DE}function hasContinuousDomain(e){return e in RE}function isContinuousToContinuous(e){return e in OE}function isContinuousToDiscrete(e){return e in AE}var PE={textXRangeStep:90,rangeStep:20,pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:9,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4};function isSelectionDomain(e){return e&&e.selection}var jE={type:1,domain:1,align:1,range:1,rangeStep:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},ME=(ak(jE),__rest(jE,["type","domain","range","rangeStep","scheme"])),FE=ak(ME);(function generateScaleTypeIndex(){var e={},t=!0,r=!1,n=void 0;try{for(var i,a=lS[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var o=i.value,s=!0,u=!1,l=void 0;try{for(var c,f=ak(QS)[Symbol.iterator]();!(s=(c=f.next()).done);s=!0){var d=c.value,h=!0,p=!1,g=void 0;try{for(var m,v=EE[Symbol.iterator]();!(h=(m=v.next()).done);h=!0){var y=m.value,_=generateScaleTypeIndexKey(o,d);channelSupportScaleType(o,y)&&scaleTypeSupportDataType(y,d)&&(e[_]=e[_]||[],e[_].push(y))}}catch(b){p=!0,g=b}finally{try{h||null==v.return||v.return()}finally{if(p)throw g}}}}catch(b){u=!0,l=b}finally{try{s||null==f.return||f.return()}finally{if(u)throw l}}}}catch(b){r=!0,n=b}finally{try{t||null==a.return||a.return()}finally{if(r)throw n}}return e})();function scaleTypeSupportProperty(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!util_contains(["point","band","identity"],e);case"bins":return!util_contains(["point","band","identity","ordinal"],e);case"round":return isContinuousToContinuous(e)||"band"===e||"point"===e;case"padding":return isContinuousToContinuous(e)||util_contains(["point","band"],e);case"paddingOuter":case"rangeStep":case"align":return util_contains(["point","band"],e);case"paddingInner":return"band"===e;case"clamp":return isContinuousToContinuous(e);case"nice":return isContinuousToContinuous(e)||"quantize"===e||"threshold"===e;case"exponent":return"pow"===e;case"base":return"log"===e;case"constant":return"symlog"===e;case"zero":return hasContinuousDomain(e)&&!util_contains(["log","time","utc","threshold","quantile"],e)}}function channelScalePropertyIncompatability(e,t){switch(t){case"interpolate":case"scheme":return isColorChannel(e)?void 0:LS.cannotUseScalePropertyWithNonColor(e);case"align":case"type":case"bins":case"domain":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeStep":case"reverse":case"round":case"clamp":case"zero":return}}function scaleTypeSupportDataType(e,t){return util_contains([eE,rE],t)?void 0===e||hasDiscreteDomain(e):t===tE?util_contains([vE.TIME,vE.UTC,void 0],e):t!==ZS||util_contains([vE.LOG,vE.POW,vE.SQRT,vE.SYMLOG,vE.QUANTILE,vE.QUANTIZE,vE.THRESHOLD,vE.LINEAR,void 0],e)}function channelSupportScaleType(e,t){switch(e){case jk:case Mk:return isContinuousToContinuous(t)||util_contains(["band","point"],t);case Hk:case Xk:case Vk:case Yk:case $k:return isContinuousToContinuous(t)||isContinuousToDiscrete(t)||util_contains(["band","point"],t);case zk:case qk:case Wk:return"band"!==t;case Gk:return"ordinal"===t}return!1}function generateScaleTypeIndexKey(e,t){return e+"_"+t}var IE="_vgsid_";function isIntervalSelection(e){return"interval"===e.type}var LE={single:{on:"click",fields:[IE],resolve:"global",empty:"all",clear:"dblclick"},multi:{on:"click",fields:[IE],toggle:"event.shiftKey",resolve:"global",empty:"all",clear:"dblclick"},interval:{on:"[mousedown, window:mouseup] > window:mousemove!",encodings:["x","y"],translate:"[mousedown, window:mouseup] > window:mousemove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function isConcatSpec(e){return void 0!==e.concat}function isVConcatSpec(e){return void 0!==e.vconcat}function isHConcatSpec(e){return void 0!==e.hconcat}function isRepeatSpec(e){return void 0!==e.repeat}var NE=ak({align:1,bounds:1,center:1,columns:1,spacing:1});function extractTitleConfig(e){var t=e.anchor,r=e.frame,n=e.offset,i=e.orient,a=e.color,o=__rest(e,["anchor","frame","offset","orient","color"]);return{mark:Object.assign({},o,a?{fill:a}:{}),nonMark:Object.assign({},t?{anchor:t}:{},r?{frame:r}:{},n?{offset:n}:{},i?{orient:i}:{})}}var BE={padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",invalidValues:"filter",view:{width:200,height:200},mark:{color:"#4c78a8",tooltip:{content:"encoding"}},area:{},bar:kk,circle:{},geoshape:{},line:{},point:{},rect:Sk,rule:{color:"black"},square:{},text:{color:"black"},tick:{thickness:1},trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:PE,projection:{},axis:{},axisX:{},axisY:{},axisLeft:{},axisRight:{},axisTop:{},axisBottom:{},axisBand:{},legend:{gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64},header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:LE,style:{},title:{},facet:{spacing:20},repeat:{spacing:20},concat:{spacing:20}};function initConfig(e){return mergeDeep(nk(BE),e)}var UE=["view"].concat(Object(Ra.a)(bk)),zE=["padding","facet","concat","repeat","numberFormat","timeFormat","countTitle","header","stack","scale","selection","invalidValues","overlay"],qE=Object.assign({view:["width","height"]},{area:["line","point"],bar:["binSpacing","continuousBandSize","discreteBandSize"],rect:["binSpacing","continuousBandSize","discreteBandSize"],line:["point"],text:["shortTimeLabels"],tick:["bandSize","thickness"]});function stripAndRedirectConfig(e){e=nk(e);var t=!0,r=!1,n=void 0;try{for(var i,a=zE[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){delete e[i.value]}}catch(te){r=!0,n=te}finally{try{t||null==a.return||a.return()}finally{if(r)throw n}}if(e.axis){var o=!0,s=!1,u=void 0;try{for(var l,c=yE[Symbol.iterator]();!(o=(l=c.next()).done);o=!0){var f=l.value;delete e.axis[f]}}catch(te){s=!0,u=te}finally{try{o||null==c.return||c.return()}finally{if(s)throw u}}}if(e.legend){var d=!0,h=!1,p=void 0;try{for(var g,m=yE[Symbol.iterator]();!(d=(g=m.next()).done);d=!0){var v=g.value;delete e.legend[v]}}catch(te){h=!0,p=te}finally{try{d||null==m.return||m.return()}finally{if(h)throw p}}var y=!0,_=!1,b=void 0;try{for(var x,w=_E[Symbol.iterator]();!(y=(x=w.next()).done);y=!0){var k=x.value;delete e.legend[k]}}catch(te){_=!0,b=te}finally{try{y||null==w.return||w.return()}finally{if(_)throw b}}}if(e.mark){var S=!0,E=!1,C=void 0;try{for(var T,O=wk[Symbol.iterator]();!(S=(T=O.next()).done);S=!0){var A=T.value;delete e.mark[A]}}catch(te){E=!0,C=te}finally{try{S||null==O.return||O.return()}finally{if(E)throw C}}}var R=!0,D=!1,P=void 0;try{for(var j,M=UE[Symbol.iterator]();!(R=(j=M.next()).done);R=!0){var F=j.value,I=!0,L=!1,N=void 0;try{for(var B,U=wk[Symbol.iterator]();!(I=(B=U.next()).done);I=!0){var z=B.value;delete e[F][z]}}catch(te){L=!0,N=te}finally{try{I||null==U.return||U.return()}finally{if(L)throw N}}var q=qE[F];if(q){var W=!0,G=!1,H=void 0;try{for(var V,Y=q[Symbol.iterator]();!(W=(V=Y.next()).done);W=!0){var $=V.value;delete e[F][$]}}catch(te){G=!0,H=te}finally{try{W||null==Y.return||Y.return()}finally{if(G)throw H}}}redirectConfig(e,F)}}catch(te){D=!0,P=te}finally{try{R||null==M.return||M.return()}finally{if(D)throw P}}var X=!0,K=!1,J=void 0;try{for(var Q,Z=function getAllCompositeMarks(){return ak(mE)}()[Symbol.iterator]();!(X=(Q=Z.next()).done);X=!0){delete e[Q.value]}}catch(te){K=!0,J=te}finally{try{X||null==Z.return||Z.return()}finally{if(K)throw J}}for(var ee in redirectConfig(e,"title","group-title"),e)zw(e[ee])&&0===ak(e[ee]).length&&delete e[ee];return ak(e).length>0?e:void 0}function redirectConfig(e,t,r,n){var i="title"===t?extractTitleConfig(e.title).mark:n?e[t][n]:e[t];"view"===t&&(r="cell");var a=Object.assign({},i,e.style[t]);ak(a).length>0&&(e.style[r||t]=a),n||delete e[t]}var WE=r(8),GE=r(6);function get_get(e,t,r){return(get_get="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function _get(e,t,r){var n=function _superPropBase(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(GE.a)(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(r):i.value}})(e,t,r||e)}var HE=r(9);function isLayerSpec(e){return void 0!==e.layer}var VE=function(){function SpecMapper(){Object(_d.a)(this,SpecMapper)}return Object(bd.a)(SpecMapper,[{key:"map",value:function map(e,t){return isFacetSpec(e)?this.mapFacet(e,t):isRepeatSpec(e)?this.mapRepeat(e,t):isHConcatSpec(e)?this.mapHConcat(e,t):isVConcatSpec(e)?this.mapVConcat(e,t):isConcatSpec(e)?this.mapConcat(e,t):this.mapLayerOrUnit(e,t)}},{key:"mapLayerOrUnit",value:function mapLayerOrUnit(e,t){if(isLayerSpec(e))return this.mapLayer(e,t);if(isUnitSpec(e))return this.mapUnit(e,t);throw new Error(LS.INVALID_SPEC)}},{key:"mapLayer",value:function mapLayer(e,t){var r=this;return Object.assign({},e,{layer:e.layer.map((function(e){return r.mapLayerOrUnit(e,t)}))})}},{key:"mapHConcat",value:function mapHConcat(e,t){var r=this;return Object.assign({},e,{hconcat:e.hconcat.map((function(e){return r.map(e,t)}))})}},{key:"mapVConcat",value:function mapVConcat(e,t){var r=this;return Object.assign({},e,{vconcat:e.vconcat.map((function(e){return r.map(e,t)}))})}},{key:"mapConcat",value:function mapConcat(e,t){var r=this,n=e.concat,i=__rest(e,["concat"]);return Object.assign({},i,{concat:n.map((function(e){return r.map(e,t)}))})}},{key:"mapFacet",value:function mapFacet(e,t){return Object.assign({},e,{spec:this.map(e.spec,t)})}},{key:"mapRepeat",value:function mapRepeat(e,t){return Object.assign({},e,{spec:this.map(e.spec,t)})}}]),SpecMapper}(),YE={zero:1,center:1,normalize:1};var $E=[uk,sk,dk,ck,mk,vk,lk,hk,pk],XE=[uk,sk];function stack_stack(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=isMarkDef(e)?e.type:e;if(!util_contains($E,i))return null;var a=function potentialStackedChannel(e){var t=e.x,r=e.y;if(isFieldDef(t)&&isFieldDef(r))if("quantitative"===t.type&&"quantitative"===r.type){if(t.stack)return"x";if(r.stack)return"y";if(!!t.aggregate!==!!r.aggregate)return t.aggregate?"x":"y"}else{if("quantitative"===t.type)return"x";if("quantitative"===r.type)return"y"}else{if(isFieldDef(t)&&"quantitative"===t.type)return"x";if(isFieldDef(r)&&"quantitative"===r.type)return"y"}}(t);if(!a)return null;var o,s=t[a],u=isStringFieldDef(s)?channeldef_vgField(s,{}):void 0,l="x"===a?"y":"x",c=t[l],f=isStringFieldDef(c)?channeldef_vgField(c,{}):void 0,d=pS.reduce((function(e,r){if("tooltip"!==r&&encoding_channelHasField(t,r)){var n=t[r];(Uw(n)?n:[n]).forEach((function(t){var n=getTypedFieldDef(t);if(!n.aggregate){var i=isStringFieldDef(n)?channeldef_vgField(n,{}):void 0;(!i||i!==f&&i!==u)&&e.push({channel:r,fieldDef:n})}}))}return e}),[]);if(void 0!==s.stack?o=Yw(s.stack)?s.stack?"zero":null:s.stack:d.length>0&&(o=util_contains(XE,i)?getFirstDefined(r,"zero"):r),!o||!function isStackOffset(e){return!!YE[e]}(o))return null;if(s.scale&&s.scale.type&&s.scale.type!==vE.LINEAR){if(n.disallowNonLinearStack)return null;log_warn(LS.cannotStackNonLinearScale(s.scale.type))}return encoding_channelHasField(t,a===jk?Fk:Ik)?(void 0!==s.stack&&log_warn(LS.cannotStackRangedMark(a)),null):(s.aggregate&&!util_contains(Ok,s.aggregate)&&log_warn(LS.stackNonSummativeAggregate(s.aggregate)),{groupbyChannel:c?l:void 0,fieldChannel:a,impute:isPathMark(i),stackBy:d,offset:o})}function dropLineAndPoint(e){e.point,e.line;var t=__rest(e,["point","line"]);return ak(t).length>1?t:t.type}function dropLineAndPointFromConfig(e){for(var t=0,r=["line","area","rule","trail"];t<r.length;t++){var n=r[t];e[n]&&(e=Object.assign({},e,Object(po.a)({},n,omit(e[n],["point","line"]))))}return e}function getPointOverlay(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;return"transparent"===e.point?{opacity:0}:e.point?zw(e.point)?e.point:{}:void 0!==e.point?null:t.point||r.shape?zw(t.point)?t.point:{}:void 0}function getLineOverlay(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.line?!0===e.line?{}:e.line:void 0!==e.line?null:t.line?!0===t.line?{}:t.line:void 0}var KE=function(){function PathOverlayNormalizer(){Object(_d.a)(this,PathOverlayNormalizer),this.name="path-overlay"}return Object(bd.a)(PathOverlayNormalizer,[{key:"hasMatchingType",value:function hasMatchingType(e,t){if(isUnitSpec(e)){var r=e.mark,n=e.encoding,i=isMarkDef(r)?r:{type:r};switch(i.type){case"line":case"rule":case"trail":return!!getPointOverlay(i,t[i.type],n);case"area":return!!getPointOverlay(i,t[i.type],n)||!!getLineOverlay(i,t[i.type])}}return!1}},{key:"run",value:function run(e,t,r){var n=t.config,i=e.selection,a=e.projection,o=e.encoding,s=e.mark,u=__rest(e,["selection","projection","encoding","mark"]),l=isMarkDef(s)?s:{type:s},c=getPointOverlay(l,n[l.type],o),f="area"===l.type&&getLineOverlay(l,n[l.type]),d=[Object.assign({},i?{selection:i}:{},{mark:dropLineAndPoint(Object.assign({},l,"area"===l.type?{opacity:.7}:{})),encoding:omit(o,["shape"])})],h=stack_stack(l,o,n?n.stack:void 0),p=o;if(h){var g=h.fieldChannel,m=h.offset;p=Object.assign({},o,Object(po.a)({},g,Object.assign({},o[g],m?{stack:m}:{})))}return f&&d.push(Object.assign({},a?{projection:a}:{},{mark:Object.assign({type:"line"},util_pick(l,["clip","interpolate","tension","tooltip"]),f),encoding:p})),c&&d.push(Object.assign({},a?{projection:a}:{},{mark:Object.assign({type:"point",opacity:1,filled:!0},util_pick(l,["clip","tooltip"]),c),encoding:p})),r(Object.assign({},u,{layer:d}),Object.assign({},t,{config:dropLineAndPointFromConfig(n)}))}}]),PathOverlayNormalizer}(),JE=function(){function RuleForRangedLineNormalizer(){Object(_d.a)(this,RuleForRangedLineNormalizer),this.name="RuleForRangedLine"}return Object(bd.a)(RuleForRangedLineNormalizer,[{key:"hasMatchingType",value:function hasMatchingType(e){if(isUnitSpec(e)){var t=e.encoding;if("line"===e.mark){var r=!0,n=!1,i=void 0;try{for(var a,o=dS[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value,u=t[getMainRangeChannel(s)];if(t[s]&&isFieldDef(u)&&!bin_isBinned(u.bin))return!0}}catch(l){n=!0,i=l}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}}}return!1}},{key:"run",value:function run(e,t,r){var n=e.encoding;return log_warn(LS.lineWithRange(!!n.x2,!!n.y2)),r(Object.assign({},e,{mark:"rule"}),t)}}]),RuleForRangedLineNormalizer}();function mergeEncoding(e){var t=e.parentEncoding,r=e.encoding;if(t&&r){var n=ak(t).reduce((function(e,t){return r[t]&&e.push(t),e}),[]);n.length>0&&log_warn(LS.encodingOverridden(n))}var i=Object.assign({},t||{},r||{});return ak(i).length>0?i:void 0}function mergeProjection(e){var t=e.parentProjection,r=e.projection;return t&&r&&log_warn(LS.projectionOverridden({parentProjection:t,projection:r})),r||t}function normalize_normalize(e,t){return void 0===t&&(t=initConfig(e.config)),function normalizeGenericSpec(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return QE.map(e,{config:t})}(e,t)}var QE=new(function(e){function CoreNormalizer(){var e;return Object(_d.a)(this,CoreNormalizer),(e=Object(WE.a)(this,Object(GE.a)(CoreNormalizer).apply(this,arguments))).nonFacetUnitNormalizers=[lE,dE,gE,new KE,new JE],e}return Object(HE.a)(CoreNormalizer,e),Object(bd.a)(CoreNormalizer,[{key:"map",value:function map(e,t){if(isUnitSpec(e)){var r=encoding_channelHasField(e.encoding,Rk),n=encoding_channelHasField(e.encoding,Dk),i=encoding_channelHasField(e.encoding,Pk);if(r||n||i)return this.mapFacetedUnit(e,t)}return get_get(Object(GE.a)(CoreNormalizer.prototype),"map",this).call(this,e,t)}},{key:"mapUnit",value:function mapUnit(e,t){var r=t.parentEncoding,n=t.parentProjection;if(r||n)return this.mapUnitWithParentEncodingOrProjection(e,t);var i=this.mapLayerOrUnit.bind(this),a=!0,o=!1,s=void 0;try{for(var u,l=this.nonFacetUnitNormalizers[Symbol.iterator]();!(a=(u=l.next()).done);a=!0){var c=u.value;if(c.hasMatchingType(e,t.config))return c.run(e,t,i)}}catch(f){o=!0,s=f}finally{try{a||null==l.return||l.return()}finally{if(o)throw s}}return e}},{key:"mapRepeat",value:function mapRepeat(e,t){var r=e.repeat;return!Uw(r)&&e.columns&&(e=omit(e,["columns"]),log_warn(LS.columnsNotSupportByRowCol("repeat"))),Object.assign({},e,{spec:this.map(e.spec,t)})}},{key:"mapFacet",value:function mapFacet(e,t){return isFacetMapping(e.facet)&&e.columns&&(e=omit(e,["columns"]),log_warn(LS.columnsNotSupportByRowCol("facet"))),get_get(Object(GE.a)(CoreNormalizer.prototype),"mapFacet",this).call(this,e,t)}},{key:"mapUnitWithParentEncodingOrProjection",value:function mapUnitWithParentEncodingOrProjection(e,t){var r=e.encoding,n=e.projection,i=t.parentEncoding,a=t.parentProjection,o=t.config,s=mergeProjection({parentProjection:a,projection:n}),u=mergeEncoding({parentEncoding:i,encoding:r});return this.mapUnit(Object.assign({},e,s?{projection:s}:{},u?{encoding:u}:{}),{config:o})}},{key:"mapFacetedUnit",value:function mapFacetedUnit(e,t){var r=e.encoding,n=r.row,i=r.column,a=r.facet,o=__rest(r,["row","column","facet"]),s=e.mark,u=e.width,l=e.projection,c=e.height,f=e.selection,d=(e.encoding,__rest(e,["mark","width","projection","height","selection","encoding"]));return a&&(n||i)&&log_warn(LS.facetChannelDropped([].concat(Object(Ra.a)(n?[Rk]:[]),Object(Ra.a)(i?[Dk]:[])))),this.mapFacet(Object.assign({},d,{facet:n||i?Object.assign({},n?{row:n}:{},i?{column:i}:{}):a,spec:Object.assign({},l?{projection:l}:{},{mark:s},u?{width:u}:{},c?{height:c}:{},{encoding:o},f?{selection:f}:{})}),t)}},{key:"mapLayer",value:function mapLayer(e,t){var r=t.parentEncoding,n=t.parentProjection,i=__rest(t,["parentEncoding","parentProjection"]),a=e.encoding,o=e.projection,s=__rest(e,["encoding","projection"]),u=Object.assign({},i,{parentEncoding:mergeEncoding({parentEncoding:r,encoding:a}),parentProjection:mergeProjection({parentProjection:n,projection:o})});return get_get(Object(GE.a)(CoreNormalizer.prototype),"mapLayer",this).call(this,s,u)}}]),CoreNormalizer}(VE));function _normalizeAutoSize(e){return qw(e)?{type:e}:e||{}}var ZE=["background","padding"];function extractTopLevelProperties(e){return ZE.reduce((function(t,r){return e&&void 0!==e[r]&&(t[r]=e[r]),t}),{})}var eC=r(7);function isUrlData(e){return!!e.url}function isInlineData(e){return!!e.values}function isNamedData(e){return!!e.name&&!isUrlData(e)&&!isInlineData(e)&&!isGenerator(e)}function isGenerator(e){return e&&(isSequenceGenerator(e)||isSphereGenerator(e)||isGraticuleGenerator(e))}function isSequenceGenerator(e){return!!e.sequence}function isSphereGenerator(e){return!!e.sphere}function isGraticuleGenerator(e){return!!e.graticule}var tC="main",rC="raw";function isFieldEqualPredicate(e){return e&&!!e.field&&void 0!==e.equal}function isFieldLTPredicate(e){return e&&!!e.field&&void 0!==e.lt}function isFieldLTEPredicate(e){return e&&!!e.field&&void 0!==e.lte}function isFieldGTPredicate(e){return e&&!!e.field&&void 0!==e.gt}function isFieldGTEPredicate(e){return e&&!!e.field&&void 0!==e.gte}function isFieldRangePredicate(e){return!!(e&&e.field&&Uw(e.range)&&2===e.range.length)}function isFieldOneOfPredicate(e){return e&&!!e.field&&(Uw(e.oneOf)||Uw(e.in))}function isFieldPredicate(e){return isFieldOneOfPredicate(e)||isFieldEqualPredicate(e)||isFieldRangePredicate(e)||isFieldLTPredicate(e)||isFieldGTPredicate(e)||isFieldLTEPredicate(e)||isFieldGTEPredicate(e)}function predicateValueExpr(e,t){return valueExpr(e,{timeUnit:t,time:!0})}function fieldFilterExpression(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=e.field,n=e.timeUnit,i=n?"time("+timeunit_fieldExpr(n,r)+")":channeldef_vgField(e,{expr:"datum"});if(isFieldEqualPredicate(e))return i+"==="+predicateValueExpr(e.equal,n);if(isFieldLTPredicate(e)){var a=e.lt;return"".concat(i,"<").concat(predicateValueExpr(a,n))}if(isFieldGTPredicate(e)){var o=e.gt;return"".concat(i,">").concat(predicateValueExpr(o,n))}if(isFieldLTEPredicate(e)){var s=e.lte;return"".concat(i,"<=").concat(predicateValueExpr(s,n))}if(isFieldGTEPredicate(e)){var u=e.gte;return"".concat(i,">=").concat(predicateValueExpr(u,n))}if(isFieldOneOfPredicate(e))return"indexof([".concat(function predicateValuesExpr(e,t){return e.map((function(e){return predicateValueExpr(e,t)}))}(e.oneOf,n).join(","),"], ").concat(i,") !== -1");if(function isFieldValidPredicate(e){return e&&!!e.field&&void 0!==e.valid}(e))return e.valid?"".concat(i,"!==null&&!isNaN(").concat(i,")"):"".concat(i,"===null||isNaN(").concat(i,")");if(isFieldRangePredicate(e)){var l=e.range[0],c=e.range[1];if(null!==l&&null!==c&&t)return"inrange("+i+", ["+predicateValueExpr(l,n)+", "+predicateValueExpr(c,n)+"])";var f=[];return null!==l&&f.push("".concat(i," >= ").concat(predicateValueExpr(l,n))),null!==c&&f.push("".concat(i," <= ").concat(predicateValueExpr(c,n))),f.length>0?f.join(" && "):"true"}throw new Error("Invalid field predicate: ".concat(JSON.stringify(e)))}function normalizePredicate(e){return isFieldPredicate(e)&&e.timeUnit?Object.assign({},e,{timeUnit:normalizeTimeUnit(e.timeUnit)}):e}function isFilter(e){return void 0!==e.filter}function isLookup(e){return void 0!==e.lookup}function isSample(e){return void 0!==e.sample}function isWindow(e){return void 0!==e.window}function isJoinAggregate(e){return void 0!==e.joinaggregate}function isFlatten(e){return void 0!==e.flatten}function isCalculate(e){return void 0!==e.calculate}function isBin(e){return!!e.bin}function isImpute(e){return void 0!==e.impute}function transform_isTimeUnit(e){return void 0!==e.timeUnit}function transform_isAggregate(e){return void 0!==e.aggregate}function isStack(e){return void 0!==e.stack}function isFold(e){return void 0!==e.fold}function isSignalRef(e){return!!e.signal}function isVgRangeStep(e){return!!e.step}function isDataRefDomain(e){return!Uw(e)&&("field"in e&&"data"in e)}var nC=ak({opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeMiterLimit:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,cursor:1,href:1,tooltip:1,cornerRadius:1,x:1,y:1,x2:1,y2:1,width:1,height:1}),iC=["domain","grid","labels","ticks","title"],aC={grid:"grid",gridColor:"grid",gridDash:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",domain:"main",domainColor:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontWeight:"main",labelLimit:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",maxExtent:"main",minExtent:"main",offset:"main",position:"main",tickColor:"main",tickExtra:"main",tickOffset:"both",tickOpacity:"main",tickRound:"main",ticks:"main",tickSize:"main",title:"main",titleAlign:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontWeight:"main",titleLimit:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",tickWidth:"both",tickCount:"both",values:"both",scale:"both",zindex:"both"},oC={orient:1,bandPosition:1,domain:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,values:1,zindex:1},sC=Object.assign({},oC,{encoding:1}),uC=Object.assign({gridScale:1,scale:1},oC,{encode:1});var lC=ak(uC);ak(sC);function assembleAxis(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{header:!1},i=e.combine(),a=i.orient,o=i.scale,s=i.title,u=i.zindex,l=__rest(i,["orient","scale","title","zindex"]);if(ak(l).forEach((function(e){var r=aC[e];r&&r!==t&&"both"!==r&&delete l[e]})),"grid"===t){if(!l.grid)return;if(l.encode){var c=l.encode.grid;l.encode=Object.assign({},c?{grid:c}:{}),0===ak(l.encode).length&&delete l.encode}return Object.assign({scale:o,orient:a},l,{domain:!1,labels:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:getFirstDefined(u,0)})}if(n.header||!e.mainExtracted){if(l.encode){var f=!0,d=!1,h=void 0;try{for(var p,g=iC[Symbol.iterator]();!(f=(p=g.next()).done);f=!0){var m=p.value;e.hasAxisPart(m)||delete l.encode[m]}}catch(y){d=!0,h=y}finally{try{f||null==g.return||g.return()}finally{if(d)throw h}}0===ak(l.encode).length&&delete l.encode}var v=function assemble_assembleTitle(e,t){return Uw(e)?e.map((function(e){return defaultTitle(e,t)})).join(", "):e}(s,r);return Object.assign({scale:o,orient:a,grid:!1},v?{title:v}:{},l,{zindex:getFirstDefined(u,1)})}}function assembleAxisSignals(e){var t=e.component.axes,r=!0,n=!1,i=void 0;try{for(var a,o=mS[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;if(t[s]){var u=!0,l=!1,c=void 0;try{for(var f,d=t[s][Symbol.iterator]();!(u=(f=d.next()).done);u=!0){if(!f.value.get("gridScale")){var h="x"===s?"height":"width";return[{name:h,update:e.getSizeSignalRef(h).signal}]}}}catch(p){l=!0,c=p}finally{try{u||null==d.return||d.return()}finally{if(l)throw c}}}}}catch(p){n=!0,i=p}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}return[]}var cC={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleOrient:"orient",titlePadding:"offset"},fC={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelLimit:"limit",labelOrient:"orient",labelPadding:"offset"},dC=ak(cC),hC=ak(fC),pC="mean";function isSortField(e){return!!e&&("count"===e.op||!!e.field)}function isSortArray(e){return!!e&&Uw(e)}function getAxisConfig(e,t,r,n,i){var a=[].concat(Object(Ra.a)("band"===i?["axisBand"]:[]),["x"===r?"axisX":"axisY"],Object(Ra.a)(n?["axis"+n.substr(0,1).toUpperCase()+n.substr(1)]:[]),["axis"]),o=!0,s=!1,u=void 0;try{for(var l,c=a[Symbol.iterator]();!(o=(l=c.next()).done);o=!0){var f=l.value;if(t[f]&&void 0!==t[f][e])return t[f][e]}}catch(d){s=!0,u=d}finally{try{o||null==c.return||c.return()}finally{if(s)throw u}}}function defaultLabelBaseline(e,t){if(void 0!==e)return e=normalizeAngle(e),"top"===t||"bottom"===t?e<=45||315<=e?"top"===t?"bottom":"top":135<=e&&e<=225?"top"===t?"top":"bottom":"middle":e<=45||315<=e||135<=e&&e<=225?"middle":45<=e&&e<=135?"left"===t?"top":"bottom":"left"===t?"bottom":"top"}function defaultLabelAlign(e,t){if(void 0!==e)return e=normalizeAngle(e),"top"===t||"bottom"===t?e%180===0?"center":0<e&&e<180?"top"===t?"right":"left":"top"===t?"left":"right":(e+90)%180===0?"center":90<=e&&e<270?"left"===t?"left":"right":"left"===t?"right":"left"}function properties_orient(e){switch(e){case jk:return"bottom";case Mk:return"left"}throw new Error(LS.INVALID_CHANNEL_FOR_AXIS)}function getStyles(e){return[].concat(e.type,e.style||[])}function getMarkConfig(e,t,r){var n=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).vgChannel;return getFirstDefined(n?getStyleConfig(e,t,r.style):void 0,getStyleConfig(e,t,r.style),n?r[t.type][n]:void 0,r[t.type][e],n?r.mark[n]:r.mark[e])}function getStyleConfig(e,t,r){var n,i=getStyles(t),a=!0,o=!1,s=void 0;try{for(var u,l=i[Symbol.iterator]();!(a=(u=l.next()).done);a=!0){var c=r[u.value],f=e;c&&void 0!==c[f]&&(n=c[f])}}catch(d){o=!0,s=d}finally{try{a||null==l.return||l.return()}finally{if(o)throw s}}return n}function formatSignalRef(e,t,r,n){if(isTimeFormatFieldDef(e)){var i=isScaleFieldDef(e)&&e.scale&&e.scale.type===vE.UTC;return{signal:timeFormatExpression(channeldef_vgField(e,{expr:r}),e.timeUnit,t,n.text.shortTimeLabels,n.timeFormat,i,!0)}}var a=numberFormat(e,t,n);return isBinning(e.bin)?{signal:binFormatExpression(channeldef_vgField(e,{expr:r}),channeldef_vgField(e,{expr:r,binSuffix:"end"}),a,n)}:"quantitative"===e.type||a?{signal:"".concat(formatExpr(channeldef_vgField(e,{expr:r,binSuffix:"range"}),a))}:{signal:"''+".concat(channeldef_vgField(e,{expr:r}))}}function numberFormat(e,t,r){return t||(e.type===ZS?r.numberFormat:void 0)}function formatExpr(e,t){return"format(".concat(e,', "').concat(t||"",'")')}function numberFormatExpr(e,t,r){return formatExpr(e,t||r.numberFormat)}function binFormatExpression(e,t,r,n){return"".concat(e," === null || isNaN(").concat(e,') ? "null" : ').concat(numberFormatExpr(e,r,n),' + " - " + ').concat(numberFormatExpr(t,r,n))}function timeFormatExpression(e,t,r,n,i,a){var o=arguments.length>6&&void 0!==arguments[6]&&arguments[6];return!t||r?(r=r||i)||o?"".concat(a?"utc":"time","Format(").concat(e,", '").concat(r,"')"):void 0:function formatExpression(e,t,r,n){if(e){var i=getDateTimeComponents(e,r),a="";return containsTimeUnit(e,zS.QUARTER)&&(a="'Q' + quarter(".concat(t,")")),i.length>0&&(a&&(a+=" + ' ' + "),a+=n?"utcFormat(".concat(t,", '").concat(i.join(" "),"')"):"timeFormat(".concat(t,", '").concat(i.join(" "),"')")),a||void 0}}(t,e,n,a)}function sortParams(e,t){return(Uw(e)?e:[e]).reduce((function(e,r){return e.field.push(channeldef_vgField(r,t)),e.order.push(r.sort||"ascending"),e}),{field:[],order:[]})}function mergeTitleFieldDefs(e,t){var r=Object(Ra.a)(e);return t.forEach((function(e){var t=!0,n=!1,i=void 0;try{for(var a,o=r[Symbol.iterator]();!(t=(a=o.next()).done);t=!0){var s=a.value;if(ik(s)===ik(e))return}}catch(u){n=!0,i=u}finally{try{t||null==o.return||o.return()}finally{if(n)throw i}}r.push(e)})),r}function mergeTitle(e,t){return e!==t&&t?e?e+", "+t:t:e}function mergeTitleComponent(e,t){if(Uw(e.value)&&Uw(t.value))return{explicit:e.explicit,value:mergeTitleFieldDefs(e.value,t.value)};if(!Uw(e.value)&&!Uw(t.value))return{explicit:e.explicit,value:mergeTitle(e.value,t.value)};throw new Error("It should never reach here")}var gC=function(){function DataFlowNode(e,t){Object(_d.a)(this,DataFlowNode),this.debugName=t,this._children=[],this._parent=null,e&&(this.parent=e)}return Object(bd.a)(DataFlowNode,[{key:"clone",value:function clone(){throw new Error("Cannot clone node")}},{key:"hash",value:function hash(){return void 0===this._hash&&(this._hash=uniqueId()),this._hash}},{key:"producedFields",value:function producedFields(){return new Set}},{key:"dependentFields",value:function dependentFields(){return new Set}},{key:"numChildren",value:function numChildren(){return this._children.length}},{key:"addChild",value:function addChild(e,t){this._children.indexOf(e)>-1?console.warn("Attempt to add the same child twice."):void 0!==t?this._children.splice(t,0,e):this._children.push(e)}},{key:"removeChild",value:function removeChild(e){var t=this._children.indexOf(e);return this._children.splice(t,1),t}},{key:"remove",value:function remove(){var e=this._parent.removeChild(this),t=!0,r=!1,n=void 0;try{for(var i,a=this._children[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var o=i.value;o._parent=this._parent,this._parent.addChild(o,e++)}}catch(s){r=!0,n=s}finally{try{t||null==a.return||a.return()}finally{if(r)throw n}}}},{key:"insertAsParentOf",value:function insertAsParentOf(e){var t=e.parent;t.removeChild(this),this.parent=t,e.parent=this}},{key:"swapWithParent",value:function swapWithParent(){var e=this._parent,t=e.parent,r=!0,n=!1,i=void 0;try{for(var a,o=this._children[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){a.value.parent=e}}catch(s){n=!0,i=s}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}this._children=[],e.removeChild(this),e.parent.removeChild(e),this.parent=t,e.parent=this}},{key:"parent",get:function get(){return this._parent},set:function set(e){this._parent=e,e&&e.addChild(this)}},{key:"children",get:function get(){return this._children}}]),DataFlowNode}(),mC=function(e){function OutputNode(e,t,r,n){var i;return Object(_d.a)(this,OutputNode),(i=Object(WE.a)(this,Object(GE.a)(OutputNode).call(this,e,t))).type=r,i.refCounts=n,i._source=i._name=t,!i.refCounts||i._name in i.refCounts||(i.refCounts[i._name]=0),i}return Object(HE.a)(OutputNode,e),Object(bd.a)(OutputNode,[{key:"clone",value:function clone(){var e=new this.constructor;return e.debugName="clone_"+this.debugName,e._source=this._source,e._name="clone_"+this._name,e.type=this.type,e.refCounts=this.refCounts,e.refCounts[e._name]=0,e}},{key:"getSource",value:function getSource(){return this.refCounts[this._name]++,this._source}},{key:"isRequired",value:function isRequired(){return!!this.refCounts[this._name]}},{key:"setSource",value:function setSource(e){this._source=e}}]),OutputNode}(gC);function getDependentFields(e){var t=Iv(e),r=new Set;return t.visit((function(e){"MemberExpression"===e.type&&function startsWithDatum(e){return"MemberExpression"===e.object.type?startsWithDatum(e.object):"datum"===e.object.name}(e)&&r.add(function expressions_getName(e){var t=[];return"Identifier"===e.type?[e.name]:"Literal"===e.type?[e.value]:("MemberExpression"===e.type&&(t.push.apply(t,Object(Ra.a)(expressions_getName(e.object))),t.push.apply(t,Object(Ra.a)(expressions_getName(e.property)))),t)}(e).slice(1).join("."))})),r}var vC=function(e){function CalculateNode(e,t){var r;return Object(_d.a)(this,CalculateNode),(r=Object(WE.a)(this,Object(GE.a)(CalculateNode).call(this,e))).transform=t,r._dependentFields=getDependentFields(r.transform.calculate),r}return Object(HE.a)(CalculateNode,e),Object(bd.a)(CalculateNode,[{key:"clone",value:function clone(){return new CalculateNode(null,nk(this.transform))}},{key:"producedFields",value:function producedFields(){return new Set([this.transform.as])}},{key:"dependentFields",value:function dependentFields(){return this._dependentFields}},{key:"assemble",value:function assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}},{key:"hash",value:function hash(){return"Calculate ".concat(util_hash(this.transform))}}],[{key:"parseAllForSortIndex",value:function parseAllForSortIndex(e,t){return t.forEachFieldDef((function(t,r){if(isScaleFieldDef(t)&&isSortArray(t.sort)){var n=t.field,i=t.timeUnit,a=t.sort,o=a.map((function(e,t){return"".concat(fieldFilterExpression({field:n,timeUnit:i,equal:e})," ? ").concat(t," : ")})).join("")+a.length;e=new CalculateNode(e,{calculate:o,as:sortArrayIndexField(t,r,{forAs:!0})})}})),e}}]),CalculateNode}(gC);function sortArrayIndexField(e,t,r){return channeldef_vgField(e,Object.assign({prefix:t,suffix:"sort_index"},r||{}))}function getHeaderChannel(e,t){return util_contains(["top","bottom"],t)?"column":util_contains(["left","right"],t)?"row":"row"===e?"row":"column"}function getHeaderProperty(e,t,r,n){var i="row"===n?r.headerRow:"column"===n?r.headerColumn:r.headerFacet;return getFirstDefined(t&&t.header?t.header[e]:void 0,i[e],r.header[e])}function getHeaderProperties(e,t,r,n){var i={},a=!0,o=!1,s=void 0;try{for(var u,l=e[Symbol.iterator]();!(a=(u=l.next()).done);a=!0){var c=u.value,f=getHeaderProperty(c,t,r,n);void 0!==f&&(i[c]=f)}}catch(d){o=!0,s=d}finally{try{a||null==l.return||l.return()}finally{if(o)throw s}}return i}var yC=["row","column"],_C=["header","footer"];function assembleTitleGroup(e,t){var r=e.component.layoutHeaders[t].title,n=e.config?e.config:void 0,i=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,a=getHeaderProperties(["titleAnchor","titleAngle","titleOrient"],i,n,t),o=a.titleAnchor,s=a.titleAngle,u=getHeaderChannel(t,a.titleOrient);return{name:"".concat(t,"-title"),type:"group",role:"".concat(u,"-title"),title:Object.assign({text:r},"row"===t?{orient:"left"}:{},{style:"guide-title"},defaultHeaderGuideBaseline(s,u),defaultHeaderGuideAlign(u,s,o),assembleHeaderProperties(n,i,t,dC,cC))}}function defaultHeaderGuideAlign(e,t){switch(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"middle"){case"start":return{align:"left"};case"end":return{align:"right"}}var r=defaultLabelAlign(t,"row"===e?"left":"top");return r?{align:r}:{}}function defaultHeaderGuideBaseline(e,t){var r=defaultLabelBaseline(e,"row"===t?"left":"top");return r?{baseline:r}:{}}function assembleHeaderGroups(e,t){var r=e.component.layoutHeaders[t],n=[],i=!0,a=!1,o=void 0;try{for(var s,u=_C[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var l=s.value;if(r[l]){var c=!0,f=!1,d=void 0;try{for(var h,p=r[l][Symbol.iterator]();!(c=(h=p.next()).done);c=!0){var g=h.value;n.push(assembleHeaderGroup(e,t,l,r,g))}}catch(m){f=!0,d=m}finally{try{c||null==p.return||p.return()}finally{if(f)throw d}}}}}catch(m){a=!0,o=m}finally{try{i||null==u.return||u.return()}finally{if(a)throw o}}return n}function getSort(e,t){var r=e.sort;return isSortField(r)?{field:channeldef_vgField(r,{expr:"datum"}),order:r.order||"ascending"}:Uw(r)?{field:sortArrayIndexField(e,t,{expr:"datum"}),order:"ascending"}:{field:channeldef_vgField(e,{expr:"datum"}),order:r||"ascending"}}function assemble_assembleLabelTitle(e,t,r){var n=getHeaderProperties(["format","labelAngle","labelAnchor","labelOrient"],e,r,t),i=n.format,a=n.labelAngle,o=n.labelAnchor,s=getHeaderChannel(t,n.labelOrient);return Object.assign({text:formatSignalRef(e,i,"parent",r)},"row"===t?{orient:"left"}:{},{style:"guide-label",frame:"group"},defaultHeaderGuideBaseline(a,s),defaultHeaderGuideAlign(s,a,o),assembleHeaderProperties(r,e,t,hC,fC))}function assembleHeaderGroup(e,t,r,n,i){if(i){var a=null,o=n.facetFieldDef,s=e.config?e.config:void 0;if(o&&i.labels){var u=getHeaderProperties(["labelOrient"],o,s,t).labelOrient;("row"===t&&!util_contains(["top","bottom"],u)||"column"===t&&!util_contains(["left","right"],u))&&(a=assemble_assembleLabelTitle(o,t,s))}var l=isFacetModel(e)&&!isFacetMapping(e.facet),c=i.axes,f=c&&c.length>0;if(a||f){var d="row"===t?"height":"width";return Object.assign({name:e.getName("".concat(t,"_").concat(r)),type:"group",role:"".concat(t,"-").concat(r)},n.facetFieldDef?{from:{data:e.getName(t+"_domain")},sort:getSort(o,t)}:{},f&&l?{from:{data:e.getName("facet_domain_".concat(t))}}:{},a?{title:a}:{},i.sizeSignal?{encode:{update:Object(po.a)({},d,i.sizeSignal)}}:{},f?{axes:c}:{})}}return null}var bC={column:{start:0,end:1},row:{start:1,end:0}};function getLayoutTitleBand(e,t){return bC[t][e]}function assembleHeaderProperties(e,t,r,n,i){var a={},o=!0,s=!1,u=void 0;try{for(var l,c=n[Symbol.iterator]();!(o=(l=c.next()).done);o=!0){var f=l.value;if(i[f]){var d=getHeaderProperty(f,t,e,r);void 0!==d&&(a[i[f]]=d)}}}catch(h){s=!0,u=h}finally{try{o||null==c.return||c.return()}finally{if(s)throw u}}return a}function assemble_assembleLayoutSignals(e){return[].concat(Object(Ra.a)(sizeSignals(e,"width")),Object(Ra.a)(sizeSignals(e,"height")))}function sizeSignals(e,t){var r="width"===t?"x":"y",n=e.component.layoutSize.get(t);if(!n||"merged"===n)return[];var i=e.getSizeSignalRef(t).signal;if("range-step"===n){var a=e.getScaleComponent(r);if(a){var o=a.get("type"),s=a.get("range");if(hasDiscreteDomain(o)&&isVgRangeStep(s)){var u=e.scaleName(r);if(isFacetModel(e.parent))if("independent"===e.parent.component.resolve.scale[r])return[stepSignal(u,s)];return[stepSignal(u,s),{name:i,update:sizeExpr(u,a,"domain('".concat(u,"').length"))}]}}throw new Error("layout size is range step although there is no rangeStep.")}return[{name:i,value:n}]}function stepSignal(e,t){return{name:e+"_step",value:t.step}}function sizeExpr(e,t,r){var n=t.get("type"),i=t.get("padding"),a=getFirstDefined(t.get("paddingOuter"),i),o=t.get("paddingInner");return o="band"===n?void 0!==o?o:i:1,"bandspace(".concat(r,", ").concat(o,", ").concat(a,") * ").concat(e,"_step")}var xC=function(e){function TimeUnitNode(e,t){var r;return Object(_d.a)(this,TimeUnitNode),(r=Object(WE.a)(this,Object(GE.a)(TimeUnitNode).call(this,e))).formula=t,r}return Object(HE.a)(TimeUnitNode,e),Object(bd.a)(TimeUnitNode,[{key:"clone",value:function clone(){return new TimeUnitNode(null,nk(this.formula))}},{key:"merge",value:function merge(e){this.formula=Object.assign({},this.formula,e.formula);var t=!0,r=!1,n=void 0;try{for(var i,a=e.children[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var o=i.value;e.removeChild(o),o.parent=this}}catch(s){r=!0,n=s}finally{try{t||null==a.return||a.return()}finally{if(r)throw n}}e.remove()}},{key:"producedFields",value:function producedFields(){return new Set(util_vals(this.formula).map((function(e){return e.as})))}},{key:"dependentFields",value:function dependentFields(){return new Set(util_vals(this.formula).map((function(e){return e.field})))}},{key:"hash",value:function hash(){return"TimeUnit ".concat(util_hash(this.formula))}},{key:"assemble",value:function assemble(){return util_vals(this.formula).map((function(e){return{type:"formula",as:e.as,expr:timeunit_fieldExpr(e.timeUnit,e.field)}}))}}],[{key:"makeFromEncoding",value:function makeFromEncoding(e,t){var r=t.reduceFieldDef((function(e,t){var r=t.timeUnit,n=t.field;if(r){var i={as:channeldef_vgField(t,{forAs:!0}),timeUnit:r,field:n};e[util_hash(i)]=i}return e}),{});return 0===ak(r).length?null:new TimeUnitNode(e,r)}},{key:"makeFromTransform",value:function makeFromTransform(e,t){var r=Object.assign({},t);return new TimeUnitNode(e,Object(po.a)({},util_hash(r),r))}}]),TimeUnitNode}(gC),wC={has:function has(e){return"interval"===e.type&&"global"===e.resolve&&e.bind&&"scales"===e.bind},parse:function parse(e,t,r){var n=varName(r.name),i=r.scales=[],a=!0,o=!1,s=void 0;try{for(var u,l=r.project.items[Symbol.iterator]();!(a=(u=l.next()).done);a=!0){var c=u.value,f=c.channel;if(isScaleChannel(f)){var d=e.getScaleComponent(f),h=d?d.get("type"):void 0;if(d&&hasContinuousDomain(h)){if(d.set("domainRaw",{signal:accessPathWithDatum(c.field,n)},!0),i.push(c),e.repeater&&e.repeater.row===e.repeater.column)e.getScaleComponent(f===jk?Mk:jk).set("domainRaw",{signal:accessPathWithDatum(c.field,n)},!0)}else log_warn(LS.SCALE_BINDINGS_CONTINUOUS)}}}catch(p){o=!0,s=p}finally{try{a||null==l.return||l.return()}finally{if(o)throw s}}},topLevelSignals:function topLevelSignals(e,t,r){var n=t.scales.filter((function(e){return!r.filter((function(t){return t.name===e.signals.data})).length}));if(!e.parent||!n.length)return r;var i=r.filter((function(e){return e.name===t.name}))[0],a=i.update;if(a.indexOf(jC)>=0)i.update="{".concat(n.map((function(e){return"".concat(stringValue_$(e.field),": ").concat(e.signals.data)})).join(", "),"}");else{var o=!0,s=!1,u=void 0;try{for(var l,c=n[Symbol.iterator]();!(o=(l=c.next()).done);o=!0){var f=l.value,d=", ".concat(stringValue_$(f.field),": ").concat(f.signals.data);a.indexOf(d)<0&&(i.update=a.substring(0,a.length-1)+d+"}")}}catch(h){s=!0,u=h}finally{try{o||null==c.return||c.return()}finally{if(s)throw u}}}return r.concat(n.map((function(e){return{name:e.signals.data}})))},signals:function signals(e,t,r){if(e.parent){var n=!0,i=!1,a=void 0;try{for(var o,s=function _loop(){var e=o.value,t=r.filter((function(t){return t.name===e.signals.data}))[0];t.push="outer",delete t.value,delete t.update},u=t.scales[Symbol.iterator]();!(n=(o=u.next()).done);n=!0)s()}catch(l){i=!0,a=l}finally{try{n||null==u.return||u.return()}finally{if(i)throw a}}}return r}};function scales_domain(e,t){var r=stringValue_$(e.scaleName(t));return"domain(".concat(r,")")}var kC="_tuple_fields",SC=function SelectionProjectionComponent(){Object(_d.a)(this,SelectionProjectionComponent);for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this.items=t,this.has={}},EC="_scale_trigger",CC={signals:function signals(e,t){var r=t.name,n=r+kC,i=wC.has(t),signals=[],a=[],o=[];if(t.translate&&!i){var s="!event.item || event.item.mark.name !== ".concat(stringValue_$(r+"_brush"));interval_events(t,(function(e,t){var r=t.between[0].filter||(t.between[0].filter=[]);r.indexOf(s)<0&&r.push(s)}))}t.project.items.forEach((function(r,n){var i=r.channel;if(i===jk||i===Mk){var s=t.init?t.init[n]:null,u=function channelSignals(e,t,r,n){var i=r.channel,a=r.signals.visual,o=r.signals.data,s=wC.has(t),u=stringValue_$(e.scaleName(i)),l=e.getScaleComponent(i),c=l?l.get("type"):void 0,f=function scaled(e){return"scale(".concat(u,", ").concat(e,")")},d=e.getSizeSignalRef(i===jk?"width":"height").signal,h="".concat(i,"(unit)"),p=interval_events(t,(function(e,t){return[].concat(Object(Ra.a)(e),[{events:t.between[0],update:"[".concat(h,", ").concat(h,"]")},{events:t,update:"[".concat(a,"[0], clamp(").concat(h,", 0, ").concat(d,")]")}])}));return p.push({events:{signal:t.name+EC},update:hasContinuousDomain(c)?"[".concat(f("".concat(o,"[0]")),", ").concat(f("".concat(o,"[1]")),"]"):"[0, 0]"}),s?[{name:o,on:[]}]:[Object.assign({name:a},n?{init:assembleInit(n,f)}:{value:[]},{on:p}),Object.assign({name:o},n?{init:assembleInit(n)}:{},{on:[{events:{signal:a},update:"".concat(a,"[0] === ").concat(a,"[1] ? null : invert(").concat(u,", ").concat(a,")")}]})]}(e,t,r,s),l=r.signals.data,c=r.signals.visual,f=stringValue_$(e.scaleName(i)),d=hasContinuousDomain(e.getScaleComponent(i).get("type"))?"+":"";signals.push.apply(signals,Object(Ra.a)(u)),a.push(l),o.push({scaleName:e.scaleName(i),expr:"(!isArray(".concat(l,") || ")+"(".concat(d,"invert(").concat(f,", ").concat(c,")[0] === ").concat(d).concat(l,"[0] && ")+"".concat(d,"invert(").concat(f,", ").concat(c,")[1] === ").concat(d).concat(l,"[1]))")})}else log_warn("Interval selections only support x and y encoding channels.")})),i||signals.push({name:r+EC,value:{},on:[{events:o.map((function(e){return{scale:e.scaleName}})),update:o.map((function(e){return e.expr})).join(" && ")+" ? ".concat(r+EC," : {}")}]});var u=t.init,l="unit: ".concat(selection_unitName(e),", fields: ").concat(n,", values");return signals.concat(Object.assign({name:r+RC},u?{init:"{".concat(l,": ").concat(assembleInit(u),"}")}:{},{on:[{events:[{signal:a.join(" || ")}],update:a.join(" && ")+" ? {".concat(l,": [").concat(a,"]} : null")}]}))},modifyExpr:function modifyExpr(e,t){return t.name+RC+", "+("global"===t.resolve?"true":"{unit: ".concat(selection_unitName(e),"}"))},marks:function marks(e,t,r){var n=t.name,i=t.project.has,a=i.x,o=i.y,s=a&&a.signals.visual,u=o&&o.signals.visual,l="data(".concat(stringValue_$(t.name+AC),")");if(wC.has(t))return r;var c={x:void 0!==a?{signal:"".concat(s,"[0]")}:{value:0},y:void 0!==o?{signal:"".concat(u,"[0]")}:{value:0},x2:void 0!==a?{signal:"".concat(s,"[1]")}:{field:{group:"width"}},y2:void 0!==o?{signal:"".concat(u,"[1]")}:{field:{group:"height"}}};if("global"===t.resolve){var f=!0,d=!1,h=void 0;try{for(var p,g=ak(c)[Symbol.iterator]();!(f=(p=g.next()).done);f=!0){var m=p.value;c[m]=[Object.assign({test:"".concat(l,".length && ").concat(l,"[0].unit === ").concat(selection_unitName(e))},c[m]),{value:0}]}}catch(w){d=!0,h=w}finally{try{f||null==g.return||g.return()}finally{if(d)throw h}}}var v=t.mark,y=v.fill,_=v.fillOpacity,b=__rest(v,["fill","fillOpacity"]),x=ak(b).reduce((function(e,t){return e[t]=[{test:[void 0!==a&&"".concat(s,"[0] !== ").concat(s,"[1]"),void 0!==o&&"".concat(u,"[0] !== ").concat(u,"[1]")].filter((function(e){return e})).join(" && "),value:b[t]},{value:null}],e}),{});return[{name:n+"_brush_bg",type:"rect",clip:!0,encode:{enter:{fill:{value:y},fillOpacity:{value:_}},update:c}}].concat(Object(Ra.a)(r),[{name:n+"_brush",type:"rect",clip:!0,encode:{enter:{fill:{value:"transparent"}},update:Object.assign({},c,x)}}])}};function interval_events(e,t){return e.events.reduce((function(e,r){return r.between?t(e,r):(log_warn("".concat(r," is not an ordered event stream for interval selections")),e)}),[])}function singleOrMultiSignals(e,t){var r=t.name,n=r+kC,i=t.project,a="(item().isVoronoi ? datum.datum : datum)",o=i.items.map((function(t){var r=e.fieldDef(t.channel);return r&&r.bin?"[".concat(accessPathWithDatum(e.vgField(t.channel,{}),a),", ")+"".concat(accessPathWithDatum(e.vgField(t.channel,{binSuffix:"end"}),a),"]"):"".concat(accessPathWithDatum(t.field,a))})).join(", "),s="unit: ".concat(selection_unitName(e),", fields: ").concat(n,", values");return[{name:r+RC,on:[{events:t.events,update:"datum && item().mark.marktype !== 'group' ? {".concat(s,": [").concat(o,"]} : null"),force:!0}]}]}var TC={signals:singleOrMultiSignals,modifyExpr:function modifyExpr(e,t){return t.name+RC+", "+("global"===t.resolve?"null":"{unit: ".concat(selection_unitName(e),"}"))}},OC={signals:singleOrMultiSignals,modifyExpr:function modifyExpr(e,t){return t.name+RC+", "+("global"===t.resolve?"true":"{unit: ".concat(selection_unitName(e),"}"))}},AC="_store",RC="_tuple",DC="_modify",PC="_selection_domain_",jC="vlSelectionResolve",MC={single:OC,multi:TC,interval:CC};function forEachSelection(e,t){var r=e.component.selection;for(var n in r)if(r.hasOwnProperty(n)){var i=r[n];t(i,MC[i.type])}}function selection_unitName(e){var t=stringValue_$(e.name),r=function getFacetModel(e){for(var t=e.parent;t&&!isFacetModel(t);)t=t.parent;return t}(e);if(r){var n=r.facet,i=!0,a=!1,o=void 0;try{for(var s,u=sS[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var l=s.value;n[l]&&(t+=" + '__facet_".concat(l,"_' + (").concat(accessPathWithDatum(r.vgField(l),"facet"),")"))}}catch(c){a=!0,o=c}finally{try{i||null==u.return||u.return()}finally{if(a)throw o}}}return t}function requiresSelectionId(e){var t=!1;return forEachSelection(e,(function(e){t=t||e.project.items.some((function(e){return e.field===IE}))})),t}var FC={has:function has(e){return"interval"!==e.type&&e.nearest},marks:function marks(e,t,r){var n=t.project.has,i=n.x,a=n.y,o=e.mark;if(isPathMark(o))return log_warn(LS.nearestNotSupportForContinuous(o)),r;var s={name:e.getName("voronoi"),type:"path",from:{data:e.getName("marks")},encode:{update:Object.assign({fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0}},mixins_tooltip(e,{reactiveGeom:!0}))},transform:[{type:"voronoi",x:{expr:i||!i&&!a?"datum.datum.x || 0":"0"},y:{expr:a||!i&&!a?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]},u=0,l=!1;return r.forEach((function(t,r){var n=t.name||"";n===e.component.mark[0].name?u=r:n.indexOf("voronoi")>=0&&(l=!0)})),l||r.splice(u+1,0,s),r}},IC={has:function has(e){return"single"===e.type&&"global"===e.resolve&&e.bind&&"scales"!==e.bind},topLevelSignals:function topLevelSignals(e,t,r){var n=t.name,i=t.project,a=t.bind,o=t.init&&t.init[0],s=FC.has(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return i.items.forEach((function(e,i){var u=varName("".concat(n,"_").concat(e.field));r.filter((function(e){return e.name===u})).length||r.unshift(Object.assign({name:u},o?{init:assembleInit(o[i])}:{value:null},{on:[{events:t.events,update:"datum && item().mark.marktype !== 'group' ? ".concat(accessPathWithDatum(e.field,s)," : null")}],bind:a[e.field]||a[e.channel]||a}))})),r},signals:function signals(e,t,r){var n=t.name,i=t.project,a=r.filter((function(e){return e.name===n+RC}))[0],o=n+kC,s=i.items.map((function(e){return varName("".concat(n,"_").concat(e.field))})),u=s.map((function(e){return"".concat(e," !== null")})).join(" && ");return s.length&&(a.update="".concat(u," ? {fields: ").concat(o,", values: [").concat(s.join(", "),"]} : null")),delete a.value,delete a.on,r}},LC={has:function has(e){return"multi"===e.type&&e.toggle},signals:function signals(e,t,r){return r.concat({name:t.name+"_toggle",value:!1,on:[{events:t.events,update:t.toggle}]})},modifyExpr:function modifyExpr(e,t){var r=t.name+RC,n=t.name+"_toggle";return"".concat(n," ? null : ").concat(r,", ")+("global"===t.resolve?"".concat(n," ? null : true, "):"".concat(n," ? null : {unit: ").concat(selection_unitName(e),"}, "))+"".concat(n," ? ").concat(r," : null")}},NC={has:function has(e){return!1!==e.clear},parse:function parse(e,t,r){t.clear&&(r.clear=xb(t.clear,"scope"))},topLevelSignals:function topLevelSignals(e,t,r){return IC.has(t)&&t.project.items.forEach((function(e){var n=r.findIndex((function(r){return r.name===varName("".concat(t.name,"_").concat(e.field))}));-1!==n&&r[n].on.push({events:t.clear,update:"null"})})),r},signals:function signals(e,t,r){function addClear(e,n){-1!==e&&r[e].on&&r[e].on.push({events:t.clear,update:n})}if("interval"===t.type)t.project.items.forEach((function(e){var t=r.findIndex((function(t){return t.name===e.signals.visual}));(addClear(t,"[0, 0]"),-1===t)&&addClear(r.findIndex((function(t){return t.name===e.signals.data})),"null")}));else{var n=r.findIndex((function(e){return e.name===t.name+RC}));addClear(n,"null"),LC.has(t)&&addClear(n=r.findIndex((function(e){return e.name===t.name+"_toggle"})),"false")}return r}},BC="_translate_anchor",UC="_translate_delta",zC={has:function has(e){return"interval"===e.type&&e.translate},signals:function signals(e,t,r){var n=t.name,i=wC.has(t),a=n+BC,o=t.project.has,s=o.x,u=o.y,l=xb(t.translate,"scope");return i||(l=l.map((function(e){return e.between[0].markname=n+"_brush",e}))),r.push({name:a,value:{},on:[{events:l.map((function(e){return e.between[0]})),update:"{x: x(unit), y: y(unit)"+(void 0!==s?", extent_x: "+(i?scales_domain(e,jk):"slice(".concat(s.signals.visual,")")):"")+(void 0!==u?", extent_y: "+(i?scales_domain(e,Mk):"slice(".concat(u.signals.visual,")")):"")+"}"}]},{name:n+UC,value:{},on:[{events:l,update:"{x: ".concat(a,".x - x(unit), y: ").concat(a,".y - y(unit)}")}]}),void 0!==s&&onDelta(e,t,s,"width",r),void 0!==u&&onDelta(e,t,u,"height",r),r}};function onDelta(e,t,r,n,i){var a=t.name,o=a+BC,s=a+UC,u=r.channel,l=wC.has(t),c=i.filter((function(e){return e.name===r.signals[l?"data":"visual"]}))[0],f=e.getSizeSignalRef(n).signal,d=e.getScaleComponent(u),h=d.get("type"),p=l&&u===jk?"-":"",g="".concat(o,".extent_").concat(u),m="".concat(p).concat(s,".").concat(u," / ")+(l?"".concat(f):"span(".concat(g,")")),v="".concat(l?"log"===h?"panLog":"pow"===h?"panPow":"panLinear":"panLinear","(").concat(g,", ").concat(m)+(l&&"pow"===h?", ".concat(d.get("exponent")||1):"")+")";c.on.push({events:{signal:s},update:l?v:"clampRange(".concat(v,", 0, ").concat(f,")")})}var qC="_zoom_anchor",WC="_zoom_delta",GC={has:function has(e){return"interval"===e.type&&e.zoom},signals:function signals(e,t,r){var n=t.name,i=wC.has(t),a=n+WC,o=t.project.has,s=o.x,u=o.y,l=stringValue_$(e.scaleName(jk)),c=stringValue_$(e.scaleName(Mk)),f=xb(t.zoom,"scope");return i||(f=f.map((function(e){return e.markname=n+"_brush",e}))),r.push({name:n+qC,on:[{events:f,update:i?"{"+[l?"x: invert(".concat(l,", x(unit))"):"",c?"y: invert(".concat(c,", y(unit))"):""].filter((function(e){return!!e})).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:a,on:[{events:f,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),void 0!==s&&zoom_onDelta(e,t,s,"width",r),void 0!==u&&zoom_onDelta(e,t,u,"height",r),r}};function zoom_onDelta(e,t,r,n,i){var a=t.name,o=r.channel,s=wC.has(t),u=i.filter((function(e){return e.name===r.signals[s?"data":"visual"]}))[0],l=e.getSizeSignalRef(n).signal,c=e.getScaleComponent(o),f=c.get("type"),d=s?scales_domain(e,o):u.name,h=a+WC,p="".concat(a).concat(qC,".").concat(o),g="".concat(s?"log"===f?"zoomLog":"pow"===f?"zoomPow":"zoomLinear":"zoomLinear","(").concat(d,", ").concat(p,", ").concat(h)+(s&&"pow"===f?", ".concat(c.get("exponent")||1):"")+")";u.on.push({events:{signal:h},update:s?g:"clampRange(".concat(g,", 0, ").concat(l,")")})}var HC=[{has:function has(){return!0},parse:function parse(e,t,r){var n=r.name,i=r.project||(r.project=new SC),a={},o={},s=new Set,u=function signalName(e,t){for(var r="visual"===t?e.channel:e.field,i=varName("".concat(n,"_").concat(r)),a=1;s.has(i);a++)i=varName("".concat(n,"_").concat(r,"_").concat(a));return s.add(i),Object(po.a)({},t,i)};if(!t.fields&&!t.encodings){var l=e.config.selection[t.type];if(t.init){var c=!0,f=!1,d=void 0;try{for(var h,p=Hw(t.init)[Symbol.iterator]();!(c=(h=p.next()).done);c=!0){var g=h.value,m=!0,v=!1,y=void 0;try{for(var _,b=ak(g)[Symbol.iterator]();!(m=(_=b.next()).done);m=!0){var x=_.value;fS[x]?(t.encodings||(t.encodings=[])).push(x):isIntervalSelection(t)?(log_warn('Interval selections should be initialized using "x" and/or "y" keys.'),t.encodings=l.encodings):(t.fields||(t.fields=[])).push(x)}}catch(z){v=!0,y=z}finally{try{m||null==b.return||b.return()}finally{if(v)throw y}}}}catch(z){f=!0,d=z}finally{try{c||null==p.return||p.return()}finally{if(f)throw d}}}else t.encodings=l.encodings,t.fields=l.fields}var w=!0,k=!1,S=void 0;try{for(var E,C=(t.fields||[])[Symbol.iterator]();!(w=(E=C.next()).done);w=!0){var T={type:"E",field:E.value};T.signals=Object.assign({},u(T,"data")),i.items.push(T)}}catch(z){k=!0,S=z}finally{try{w||null==C.return||C.return()}finally{if(k)throw S}}var O=!0,A=!1,R=void 0;try{for(var D,P=(t.encodings||[])[Symbol.iterator]();!(O=(D=P.next()).done);O=!0){var j=D.value,M=e.fieldDef(j);if(M){var F=M.field;if(M.timeUnit){var I={as:F=e.vgField(j),field:M.field,timeUnit:M.timeUnit};o[util_hash(I)]=I}if(!a[F]){var L="E";if("interval"===r.type)hasContinuousDomain(e.getScaleComponent(j).get("type"))&&(L="R");else M.bin&&(L="R-RE");var N={field:F,channel:j,type:L};N.signals=Object.assign({},u(N,"data"),u(N,"visual")),i.items.push(a[F]=N),i.has[j]=a[F]}}else log_warn(LS.cannotProjectOnChannelWithoutField(j))}}catch(z){A=!0,R=z}finally{try{O||null==P.return||P.return()}finally{if(A)throw R}}if(t.init)if(wC.has(r))log_warn(LS.NO_INIT_SCALE_BINDINGS);else{var B=function parseInit(e){return i.items.map((function(t){return void 0!==e[t.channel]?e[t.channel]:e[t.field]}))};if(isIntervalSelection(t))r.init=B(t.init);else{var U=Uw(t.init)?t.init:[t.init];r.init=U.map(B)}}ak(o).length&&(i.timeUnit=new xC(null,o))},signals:function signals(e,t,r){var n=t.name+kC;return r.filter((function(e){return e.name===n})).length?r:r.concat({name:n,value:t.project.items.map((function(e){e.signals;return __rest(e,["signals"])}))})}},LC,wC,zC,GC,IC,FC,NC];function forEachTransform(e,t){var r=!0,n=!1,i=void 0;try{for(var a,o=HC[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;s.has(e)&&t(s)}}catch(u){n=!0,i=u}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}}function assembleInit(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Gw;if(Uw(e)){var r=e.map((function(e){return assembleInit(e,t)})).join(", ");return"[".concat(r,"]")}return isDateTime(e)?t(dateTimeExpr(e)):t(JSON.stringify(e))}function assembleUnitSelectionData(e,t){return forEachSelection(e,(function(r){var n={name:r.name+AC};if(r.init){var i=r.project.items.map((function(e){e.signals;return __rest(e,["signals"])})),a=r.init.map((function(e){return function assembleInitData(e){return Uw(e)?e.map((function(e){return assembleInitData(e)})):isDateTime(e)?dateTimeExpr(e,!1,!0):e}(e)}));n.values="interval"===r.type?[{unit:selection_unitName(e),fields:i,values:a}]:a.map((function(t){return{unit:selection_unitName(e),fields:i,values:t}}))}t.filter((function(e){return e.name===r.name+AC})).length||t.push(n)})),t}function assembleUnitSelectionMarks(e,t){return forEachSelection(e,(function(r,n){t=n.marks?n.marks(e,r,t):t,forEachTransform(r,(function(n){n.marks&&(t=n.marks(e,r,t))}))})),t}function assembleSelectionPredicate(e,t,r){var n=[];var i=logicalExpr(t,(function expr(t){var i=varName(t),a=e.getSelectionComponent(i,t),o=stringValue_$(i+AC);if(a.project.timeUnit){var s=r||e.component.data.raw,u=a.project.timeUnit.clone();s.parent?u.insertAsParentOf(s):s.parent=u}return"none"!==a.empty&&n.push(o),"vlSelectionTest(".concat(o,", datum")+("global"===a.resolve?")":", ".concat(stringValue_$(a.resolve),")"))}));return(n.length?"!("+n.map((function(e){return"length(data(".concat(e,"))")})).join(" || ")+") || ":"")+"(".concat(i,")")}function predicate_expression(e,t,r){return logicalExpr(t,(function(t){return qw(t)?t:function isSelectionPredicate(e){return e&&e.selection}(t)?assembleSelectionPredicate(e,t.selection,r):fieldFilterExpression(t)}))}function midPointWithPositionInvalidTest(e){var t=e.channel,r=e.channelDef,n=e.mark,i=e.scale,a=midPoint(e);return isFieldDef(r)&&!isCountingAggregateOp(r.aggregate)&&i&&isContinuousToContinuous(i.get("type"))&&!1===i.get("zero")?wrapPositionInvalidTest({fieldDef:r,channel:t,mark:n,ref:a}):a}function wrapPositionInvalidTest(e){var t=e.fieldDef,r=e.channel,n=e.mark,i=e.ref;return isPathMark(n)?i:[fieldInvalidTestValueRef(t,r),i]}function fieldInvalidTestValueRef(e,t){var r=fieldInvalidPredicate(e,!0),n="x"===getMainRangeChannel(t)?{value:0}:{field:{group:"height"}};return Object.assign({test:r},n)}function fieldInvalidPredicate(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e=qw(e)?e:channeldef_vgField(e,{expr:"datum"});var r=t?"||":"&&",n=t?"===":"!==";return"".concat(e," ").concat(n," null ").concat(r," ").concat(t?"":"!","isNaN(").concat(e,")")}function getOffset(e,t){var r=t[e+"Offset"];if(r)return r}function valueref_bin(e){var t=e.channel,r=e.fieldDef,n=e.scaleName,i=e.mark,a=e.side,o=e.offset;return wrapPositionInvalidTest({fieldDef:r,channel:t,mark:i,ref:valueref_fieldRef(r,n,{binSuffix:"start"===a?void 0:"end"},o?{offset:o}:{})})}function valueref_fieldRef(e,t,r,n){var i=Object.assign({},t?{scale:t}:{},{field:channeldef_vgField(e,r)});if(n){var a=n.offset,o=n.band;return Object.assign({},i,a?{offset:a}:{},o?{band:o}:{})}return i}function bandRef(e){return{scale:e,band:!(arguments.length>1&&void 0!==arguments[1])||arguments[1]}}function binMidSignal(e){var t=e.scaleName,r=e.fieldDef,n=e.fieldDef2,i=e.offset,a=e.band;a=getFirstDefined(a,.5);var o=channeldef_vgField(r,{expr:"datum"}),s=void 0!==n?channeldef_vgField(n,{expr:"datum"}):channeldef_vgField(r,{binSuffix:"end",expr:"datum"});return Object.assign({signal:'scale("'.concat(t,'", ').concat(a," * ").concat(o," + ").concat(1-a," * ").concat(s,")")},i?{offset:i}:{})}function midPoint(e){var t=e.channel,r=e.channelDef,n=e.channel2Def,i=e.scaleName,a=e.scale,o=e.stack,s=e.offset,u=e.defaultRef;if(r){if(isFieldDef(r)){if(isTypedFieldDef(r)){if(isBinning(r.bin))return util_contains([jk,Mk],t)&&r.type===ZS?o&&o.impute?valueref_fieldRef(r,i,{binSuffix:"mid"},{offset:s}):binMidSignal({scaleName:i,fieldDef:r,offset:s}):valueref_fieldRef(r,i,binRequiresRange(r,t)?{binSuffix:"range"}:{},{offset:s});if(bin_isBinned(r.bin)){if(isFieldDef(n))return binMidSignal({scaleName:i,fieldDef:r,fieldDef2:n,offset:s});var l=t===jk?Fk:Ik;log_warn(LS.channelRequiredForBinned(l))}}if(a){var c=a.get("type");if(hasDiscreteDomain(c))return valueref_fieldRef(r,i,{binSuffix:"range"},"band"===c?{band:.5,offset:s}:{offset:s})}return valueref_fieldRef(r,i,{},{offset:s})}if(isValueDef(r)){var f=r.value,d=s?{offset:s}:{};return Object.assign({},vgValueRef(t,f),d)}}return Vw(u)?u():u}function vgValueRef(e,t){return util_contains(["x","x2"],e)&&"width"===t?{field:{group:"width"}}:util_contains(["y","y2"],e)&&"height"===t?{field:{group:"height"}}:{value:t}}function tooltipForEncoding(e,t){var r=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).reactiveGeom,n=[],i={},a={},o=r?"datum.datum":"datum",s=[];function add(r,n){var i=getMainRangeChannel(n),u=isTypedFieldDef(r)?r:Object.assign({},r,{type:e[i].type}),l=channeldef_title(u,t,{allowDisabling:!1}),c=valueref_text(u,t,o).signal;if("x"===n||"y"===n){var f="x"===n?"x2":"y2",d=getFieldDef(e[f]);if(bin_isBinned(u.bin)&&d)c=binFormatExpression(channeldef_vgField(u,{expr:o}),channeldef_vgField(d,{expr:o}),channeldef_format(u),t),a[f]=!0}s.push({channel:n,key:l,value:c})}forEach(e,(function(e,t){isFieldDef(e)?add(e,t):hasConditionalFieldDef(e)&&add(e.condition,t)}));for(var u=0,l=s;u<l.length;u++){var c=l[u],f=c.channel,d=c.key,h=c.value;a[f]||i[d]||(n.push("".concat(stringValue_$(d),": ").concat(h)),i[d]=!0)}return n.length?{signal:"{".concat(n.join(", "),"}")}:void 0}function valueref_text(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"datum";if(e){if(isValueDef(e))return{value:e.value};if(isTypedFieldDef(e))return formatSignalRef(e,channeldef_format(e),r,t)}}function valueref_mid(e){return Object.assign({},e,{mult:.5})}function positionDefault(e){var t=e.markDef,r=e.config,n=e.defaultRef,i=e.channel,a=e.scaleName,o=e.scale,s=e.mark,u=e.checkBarAreaWithoutZero;return function(){var e=getMainRangeChannel(i),l=getFirstDefined(t[i],getMarkConfig(i,t,r));if(void 0!==l)return vgValueRef(i,l);if(qw(n)){if(a){var c=o.get("type");if(util_contains([vE.LOG,vE.TIME,vE.UTC],c))!u||"bar"!==s&&"area"!==s||log_warn(LS.nonZeroScaleUsedWithLengthMark(s,e,{scaleType:c}));else{if(o.domainDefinitelyIncludesZero())return{scale:a,value:0};!u||"bar"!==s&&"area"!==s||log_warn(LS.nonZeroScaleUsedWithLengthMark(s,e,{zeroFalse:!1===o.explicit.zero}))}}return"zeroOrMin"===n?"x"===e?{value:0}:{field:{group:"height"}}:"x"===e?{field:{group:"width"}}:{value:0}}return n}}function isVisible(e){return"transparent"!==e&&null!==e&&void 0!==e}function mixins_color(e){var t=e.markDef,r=e.encoding,n=e.config,i=t.filled,a=t.type,o={fill:getMarkConfig("fill",t,n),stroke:getMarkConfig("stroke",t,n),color:getMarkConfig("color",t,n)},s=util_contains(["bar","point","circle","square","geoshape"],a)?"transparent":void 0,u=getFirstDefined(t.fill,o.fill,s),l=getFirstDefined(t.stroke,o.stroke),c=i?"fill":"stroke",f=Object.assign({},u?{fill:{value:u}}:{},l?{stroke:{value:l}}:{});return r.fill||r.stroke?(t.color&&log_warn(LS.droppingColor("property",{fill:"fill"in r,stroke:"stroke"in r})),Object.assign({},nonPosition("fill",e,{defaultValue:getFirstDefined(u,s)}),nonPosition("stroke",e,{defaultValue:l}))):r.color?Object.assign({},f,nonPosition("color",e,{vgChannel:c,defaultValue:getFirstDefined(t[c],t.color,o[c],o.color,i?s:void 0)})):isVisible(t.fill)||isVisible(t.stroke)?(t.color&&log_warn(LS.droppingColor("property",{fill:"fill"in t,stroke:"stroke"in t})),f):t.color?Object.assign({},f,Object(po.a)({},c,{value:t.color})):isVisible(o.fill)||isVisible(o.stroke)?f:o.color?Object.assign({},s?{fill:{value:"transparent"}}:{},Object(po.a)({},c,{value:o.color})):{}}function baseEncodeEntry(e,t){var r=mixins_color(e),n=r.fill,i=r.stroke;return Object.assign({},function markDefProperties(e,t){return nC.reduce((function(r,n){return void 0!==e[n]&&"ignore"!==t[n]&&(r[n]={value:e[n]}),r}),{})}(e.markDef,t),wrapAllFieldsInvalid(e,"fill",n),wrapAllFieldsInvalid(e,"stroke",i),nonPosition("opacity",e),nonPosition("fillOpacity",e),nonPosition("strokeOpacity",e),nonPosition("strokeWidth",e),mixins_tooltip(e),mixins_text(e,"href"))}function wrapAllFieldsInvalid(e,t,r){var n=e.config,i=e.mark;if("hide"===n.invalidValues&&r&&!isPathMark(i)){var a=allFieldsInvalidPredicate(e,{invalid:!0,channels:bS});if(a)return Object(po.a)({},t,[{test:a,value:null}].concat(Object(Ra.a)(Hw(r))))}return r?Object(po.a)({},t,r):{}}function valueIfDefined(e,t){if(void 0!==t)return Object(po.a)({},e,{value:t})}function allFieldsInvalidPredicate(e,t){var r=t.invalid,n=void 0!==r&&r,i=t.channels.reduce((function(t,r){var n=e.getScaleComponent(r);if(n){var i=n.get("type"),a=e.vgField(r,{expr:"datum"});a&&hasContinuousDomain(i)&&(t[a]=!0)}return t}),{}),a=ak(i);if(a.length>0){var o=n?"||":"&&";return a.map((function(e){return fieldInvalidPredicate(e,n)})).join(" ".concat(o," "))}}function mixins_defined(e){if(e.config.invalidValues){var t=allFieldsInvalidPredicate(e,{channels:["x","y"]});if(t)return{defined:{signal:t}}}return{}}function nonPosition(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t.markDef,i=t.encoding,a=t.config,o=r.vgChannel,s=void 0===o?e:o,u=r.defaultRef,l=r.defaultValue;void 0===u&&(l=l||(s===e?n[e]:getFirstDefined(n[e],n[s],getMarkConfig(e,n,a,{vgChannel:s}))),u=l?{value:l}:void 0);var c=i[e];return wrapCondition(t,c,s,(function(r){return midPoint({channel:e,channelDef:r,scaleName:t.scaleName(e),scale:t.getScaleComponent(e),stack:null,defaultRef:u})}))}function wrapCondition(e,t,r,n){var i=t&&t.condition,a=n(t);if(i){var o=(Uw(i)?i:[i]).map((function(t){var r=n(t),i=function isConditionalSelection(e){return e.selection}(t)?assembleSelectionPredicate(e,t.selection):predicate_expression(e,t.test);return Object.assign({test:i},r)}));return Object(po.a)({},r,[].concat(Object(Ra.a)(o),Object(Ra.a)(void 0!==a?[a]:[])))}return void 0!==a?Object(po.a)({},r,a):{}}function mixins_tooltip(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.encoding,n=e.markDef,i=e.config,a=r.tooltip;return Uw(a)?{tooltip:tooltipForEncoding({tooltip:a},i,t)}:wrapCondition(e,a,"tooltip",(function(a){var o=valueref_text(a,e.config,t.reactiveGeom?"datum.datum":"datum");if(o)return o;if(null!==a){var s=getFirstDefined(n.tooltip,getMarkConfig("tooltip",n,i));return qw(s)?{value:s}:zw(s)?"encoding"===s.content?tooltipForEncoding(r,i,t):{signal:"datum"}:void 0}}))}function mixins_text(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text",r=e.encoding[t];return wrapCondition(e,r,t,(function(t){return valueref_text(t,e.config)}))}function pointPosition(e,t,r,n){var i=t.encoding,a=t.mark,o=t.markDef,s=t.config,u=t.stack,l=i[e],c=i[e===jk?Fk:Ik],f=t.scaleName(e),d=t.getScaleComponent(e),h=getOffset(e,t.markDef),p=l||!i.latitude&&!i.longitude?function valueref_position(e){var t=e.channel,r=e.channelDef,n=e.scaleName,i=e.stack,a=e.offset;return isFieldDef(r)&&i&&t===i.fieldChannel?valueref_fieldRef(r,n,{suffix:"end"},{offset:a}):midPointWithPositionInvalidTest(e)}({channel:e,channelDef:l,channel2Def:c,scaleName:f,scale:d,stack:u,mark:a,offset:h,defaultRef:positionDefault({markDef:o,config:s,defaultRef:r,channel:e,scaleName:f,scale:d,mark:a,checkBarAreaWithoutZero:!c})}):{field:t.getName(e)};return Object(po.a)({},n||e,p)}function pointPosition2(e,t,r){var n,i=e.encoding,a=e.mark,o=e.markDef,s=e.stack,u=e.config,l="x2"===r?"x":"y",c="x2"===r?"width":"height",f=i[l],d=e.scaleName(l),h=e.getScaleComponent(l),p=getOffset(r,e.markDef);if(!f&&(i.latitude||i.longitude))return Object(po.a)({},r,{field:e.getName(r)});var g=function position2(e){var t=e.channel,r=e.channelDef,n=e.channel2Def,i=e.scaleName,a=e.scale,o=e.stack,s=e.mark,u=e.offset,l=e.defaultRef;return isFieldDef(r)&&o&&t.charAt(0)===o.fieldChannel.charAt(0)?valueref_fieldRef(r,i,{suffix:"start"},{offset:u}):midPointWithPositionInvalidTest({channel:t,channelDef:n,scaleName:i,scale:a,stack:o,mark:s,offset:u,defaultRef:l})}({channel:r,channelDef:f,channel2Def:i[r],scaleName:d,scale:h,stack:s,mark:a,offset:p,defaultRef:void 0});return void 0!==g?Object(po.a)({},r,g):getFirstDefined(position2orSize(r,o),position2orSize(r,(n={},Object(po.a)(n,r,getStyleConfig(r,o,u.style)),Object(po.a)(n,c,getStyleConfig(c,o,u.style)),n)),position2orSize(r,u[a]),position2orSize(r,u.mark),Object(po.a)({},r,positionDefault({markDef:o,config:u,defaultRef:t,channel:r,scaleName:d,scale:h,mark:a,checkBarAreaWithoutZero:!i[r]})()))}function position2orSize(e,t){var r="x2"===e?"width":"height";return t[e]?Object(po.a)({},e,vgValueRef(e,t[e])):t[r]?Object(po.a)({},r,{value:t[r]}):void 0}function guideEncodeEntry(e,t){return ak(e).reduce((function(r,n){var i=e[n];return Object.assign({},r,wrapCondition(t,i,n,(function(e){return{value:e.value}})))}),{})}function parseGuideResolve(e,t){var r=e.scale[t],n=util_contains(mS,t)?"axis":"legend";return"independent"===r?("shared"===e[n][t]&&log_warn(LS.independentScaleMeansIndependentGuide(t)),"independent"):e[n][t]||"shared"}var VC=function(){function Split(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(_d.a)(this,Split),this.explicit=e,this.implicit=t}return Object(bd.a)(Split,[{key:"clone",value:function clone(){return new Split(nk(this.explicit),nk(this.implicit))}},{key:"combine",value:function combine(){return Object.assign({},this.explicit,this.implicit)}},{key:"get",value:function get(e){return getFirstDefined(this.explicit[e],this.implicit[e])}},{key:"getWithExplicit",value:function getWithExplicit(e){return void 0!==this.explicit[e]?{explicit:!0,value:this.explicit[e]}:void 0!==this.implicit[e]?{explicit:!1,value:this.implicit[e]}:{explicit:!1,value:void 0}}},{key:"setWithExplicit",value:function setWithExplicit(e,t){void 0!==t.value&&this.set(e,t.value,t.explicit)}},{key:"set",value:function set(e,t,r){return delete this[r?"implicit":"explicit"][e],this[r?"explicit":"implicit"][e]=t,this}},{key:"copyKeyFromSplit",value:function copyKeyFromSplit(e,t){void 0!==t.explicit[e]?this.set(e,t.explicit[e],!0):void 0!==t.implicit[e]&&this.set(e,t.implicit[e],!1)}},{key:"copyKeyFromObject",value:function copyKeyFromObject(e,t){void 0!==t[e]&&this.set(e,t[e],!0)}},{key:"copyAll",value:function copyAll(e){var t=!0,r=!1,n=void 0;try{for(var i,a=ak(e.combine())[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var o=i.value,s=e.getWithExplicit(o);this.setWithExplicit(o,s)}}catch(u){r=!0,n=u}finally{try{t||null==a.return||a.return()}finally{if(r)throw n}}}}]),Split}();function split_makeExplicit(e){return{explicit:!0,value:e}}function makeImplicit(e){return{explicit:!1,value:e}}function tieBreakByComparing(e){return function(t,r,n,i){var a=e(t.value,r.value);return a>0?t:a<0?r:defaultTieBreaker(t,r,n,i)}}function defaultTieBreaker(e,t,r,n){return e.explicit&&t.explicit&&log_warn(LS.mergeConflictingProperty(r,n,e.value,t.value)),e}function mergeValuesWithExplicit(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:defaultTieBreaker;return void 0===e||void 0===e.value?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:ik(e.value)===ik(t.value)?e:i(e,t,r,n)}var YC=function(e){function LegendComponent(){return Object(_d.a)(this,LegendComponent),Object(WE.a)(this,Object(GE.a)(LegendComponent).apply(this,arguments))}return Object(HE.a)(LegendComponent,e),LegendComponent}(VC);function properties_type(e){return getFirstDefined(e.legend.type,properties_defaultType(e))}function properties_defaultType(e){var t=e.channel,r=e.timeUnit,n=e.scaleType,i=e.alwaysReturn;if(isColorChannel(t)){if(util_contains(["quarter","month","day"],r))return"symbol";if(isContinuousToContinuous(n))return i?"gradient":void 0}return i?"symbol":void 0}function properties_direction(e){var t=e.legend,r=e.legendConfig,n=e.timeUnit,i=e.channel,a=e.scaleType,o=getFirstDefined(t.orient,r.orient,"right"),s=properties_type({legend:t,channel:i,timeUnit:n,scaleType:a,alwaysReturn:!0});return getFirstDefined(t.direction,r[s?"gradientDirection":"symbolDirection"],function defaultDirection(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return"gradient"===t?"horizontal":void 0}}(o,s))}function gradientLengthSignal(e,t,r,n){var i=e.getSizeSignalRef(t).signal;return{signal:"clamp(".concat(i,", ").concat(r,", ").concat(n,")")}}function encode_type(e,t,r){var n=t.getScaleComponent(r).get("type");return getFirstDefined(e.get("type"),properties_defaultType({channel:r,scaleType:n,alwaysReturn:!0}))}function encode_symbols(e,t,r,n,i){if("symbol"===encode_type(i,r,n)){var a=Object.assign({},function applyMarkConfig(e,t,r){var n=!0,i=!1,a=void 0;try{for(var o,s=r[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var u=o.value,l=getMarkConfig(u,t.markDef,t.config);void 0!==l&&(e[u]={value:l})}}catch(c){i=!0,a=c}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return e}({},r,xk),mixins_color(r)),o=r.markDef,s=r.encoding,u=r.config,l=o.filled,c=getMaxValue(s.opacity)||o.opacity;if(a.fill)if("fill"===n||l&&n===zk)delete a.fill;else if(a.fill.field)i.get("symbolFillColor")?delete a.fill:(a.fill={value:u.legend.symbolBaseFillColor||"black"},a.fillOpacity={value:c||1});else if(Uw(a.fill)){var f=getFirstConditionValue(s.fill||s.color)||o.fill||l&&o.color;f&&(a.fill={value:f})}if(a.stroke)if("stroke"===n||!l&&n===zk)delete a.stroke;else if(a.stroke.field)delete a.stroke;else if(Uw(a.stroke)){var d=getFirstDefined(getFirstConditionValue(s.stroke||s.color),o.stroke,l?o.color:void 0);d&&(a.stroke={value:d})}return n!==Vk&&c&&(a.opacity={value:c}),a=Object.assign({},a,t),ak(a).length>0?a:void 0}}function legend_encode_gradient(e,t,r,n,i){if("gradient"===encode_type(i,r,n)){var a={},o=getMaxValue(r.encoding.opacity)||r.markDef.opacity;return o&&(a.opacity={value:o}),a=Object.assign({},a,t),ak(a).length>0?a:void 0}}function encode_labels(e,t,r,n){var i=r.legend(n),a=r.config,o={};if(isTimeFormatFieldDef(e)){var s=r.getScaleComponent(n).get("type")===vE.UTC,u=timeFormatExpression("datum.value",e.timeUnit,i.format,a.legend.shortTimeLabels,a.timeFormat,s);t=Object.assign({},u?{text:{signal:u}}:{},t)}return o=Object.assign({},o,t),ak(o).length>0?o:void 0}function getMaxValue(e){return getConditionValue(e,(function(e,t){return Math.max(e,t.value)}))}function getFirstConditionValue(e){return getConditionValue(e,(function(e,t){return getFirstDefined(e,t.value)}))}function getConditionValue(e,t){return function hasConditionalValueDef(e){return!!e&&!!e.condition&&(Uw(e.condition)||isValueDef(e.condition))}(e)?(Uw(e.condition)?e.condition:[e.condition]).reduce(t,e.value):isValueDef(e)?e.value:void 0}function parseLegend(e){isUnitModel(e)?e.component.legends=function parseUnitLegend(e){var t=e.encoding;return[zk,qk,Wk,Xk,Hk,Gk,Vk,Yk,$k].reduce((function(r,n){var i=t[n];return!e.legend(n)||!e.getScaleComponent(n)||isFieldDef(i)&&n===Gk&&i.type===nE||(r[n]=function parseLegendForChannel(e,t){var r=e.fieldDef(t),n=e.legend(t),i=new YC({},function getLegendDefWithScale(e,t){var r=e.scaleName(zk);if("color"===t)return e.markDef.filled?{fill:r}:{stroke:r};return Object(po.a)({},t,e.scaleName(t))}(e,t)),a=!0,o=!1,s=void 0;try{for(var u,l=wE[Symbol.iterator]();!(a=(u=l.next()).done);a=!0){var c=u.value,f=getProperty(c,n,t,e);if(void 0!==f){var d=isExplicit(f,c,n,r);(d||void 0===e.config.legend[c])&&i.set(c,f,d)}}}catch(g){o=!0,s=g}finally{try{a||null==l.return||l.return()}finally{if(o)throw s}}var h=n.encoding||{},p=["labels","legend","title","symbols","gradient"].reduce((function(n,a){var o=guideEncodeEntry(h[a]||{},e),s=x[a]?x[a](r,o,e,t,i):o;return void 0!==s&&ak(s).length>0&&(n[a]={update:s}),n}),{});ak(p).length>0&&i.set("encode",p,!!n.encoding);return i}(e,n)),r}),{})}(e):e.component.legends=function parseNonUnitLegend(e){var t=e.component,r=t.legends,n=t.resolve,i=!0,a=!1,o=void 0;try{for(var s,u=function _loop(){var t=s.value;parseLegend(t),ak(t.component.legends).forEach((function(i){n.legend[i]=parseGuideResolve(e.component.resolve,i),"shared"===n.legend[i]&&(r[i]=mergeLegendComponent(r[i],t.component.legends[i]),r[i]||(n.legend[i]="independent",delete r[i]))}))},l=e.children[Symbol.iterator]();!(i=(s=l.next()).done);i=!0)u()}catch(c){a=!0,o=c}finally{try{i||null==l.return||l.return()}finally{if(a)throw o}}return ak(r).forEach((function(t){var r=!0,i=!1,a=void 0;try{for(var o,s=e.children[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var u=o.value;u.component.legends[t]&&("shared"===n.legend[t]&&delete u.component.legends[t])}}catch(c){i=!0,a=c}finally{try{r||null==s.return||s.return()}finally{if(i)throw a}}})),r}(e)}function isExplicit(e,t,r,n){switch(t){case"values":return!!r.values;case"title":if("title"===t&&e===n.title)return!0}return e===r[t]}function getProperty(e,t,r,n){var i=n.encoding,a=n.mark,o=getTypedFieldDef(i[r]),s=n.config.legend,u=o.timeUnit,l=n.getScaleComponent(r).get("type");switch(e){case"direction":return properties_direction({legend:t,legendConfig:s,timeUnit:u,channel:r,scaleType:l});case"format":if(isTimeFormatFieldDef(o))return;return numberFormat(o,t.format,n.config);case"formatType":if(isTimeFormatFieldDef(o))return;return t.formatType;case"gradientLength":return getFirstDefined(t.gradientLength,s.gradientLength,function defaultGradientLength(e){var t=e.legend,r=e.legendConfig,n=e.model,i=e.channel,a=e.scaleType,o=r.gradientHorizontalMaxLength,s=r.gradientHorizontalMinLength,u=r.gradientVerticalMaxLength,l=r.gradientVerticalMinLength;if("horizontal"===properties_direction({legend:t,legendConfig:r,channel:i,scaleType:a})){var c=getFirstDefined(t.orient,r.orient);return"top"===c||"bottom"===c?gradientLengthSignal(n,"width",s,o):s}return gradientLengthSignal(n,"height",l,u)}({model:n,legend:t,legendConfig:s,channel:r,scaleType:l}));case"labelOverlap":return getFirstDefined(t.labelOverlap,function properties_defaultLabelOverlap(e){if(util_contains(["quantile","threshold","log"],e))return"greedy"}(l));case"symbolType":return getFirstDefined(t.symbolType,function defaultSymbolType(e,t,r,n){if("shape"!==t){var i=getFirstConditionValue(r)||n;if(i)return i}switch(e){case"bar":case"rect":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}(a,r,i.shape,n.markDef.shape));case"title":return channeldef_title(o,n.config,{allowDisabling:!0})||void 0;case"type":return properties_type({legend:t,channel:r,timeUnit:u,scaleType:l,alwaysReturn:!1});case"values":return function legend_properties_values(e,t){var r=e.values;if(r)return valueArray(t,r)}(t,o)}return t[e]}function mergeLegendComponent(e,t){if(!e)return t.clone();var r=e.getWithExplicit("orient"),n=t.getWithExplicit("orient");if(!r.explicit||!n.explicit||r.value===n.value){var i=!1,a=!0,o=!1,s=void 0;try{for(var u,l=function _loop2(){var r=u.value,n=mergeValuesWithExplicit(e.getWithExplicit(r),t.getWithExplicit(r),r,"legend",(function(e,t){switch(r){case"symbolType":return function mergeSymbolType(e,t){if("circle"===t.value)return t;return e}(e,t);case"title":return mergeTitleComponent(e,t);case"type":return i=!0,makeImplicit("symbol")}return defaultTieBreaker(e,t,r,"legend")}));e.setWithExplicit(r,n)},c=kE[Symbol.iterator]();!(a=(u=c.next()).done);a=!0)l()}catch(f){o=!0,s=f}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}return i&&(((e.implicit||{}).encode||{}).gradient&&deleteNestedProperty(e.implicit,["encode","gradient"]),((e.explicit||{}).encode||{}).gradient&&deleteNestedProperty(e.explicit,["encode","gradient"])),e}}function assemble_assembleLegends(e){var t=e.component.legends,r={},n=!0,i=!1,a=void 0;try{for(var o,s=ak(t)[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var u=o.value,l=e.getScaleComponent(u),c=ik(l.get("domains"));if(r[c]){var f=!0,d=!1,h=void 0;try{for(var p,g=r[c][Symbol.iterator]();!(f=(p=g.next()).done);f=!0){mergeLegendComponent(p.value,t[u])||r[c].push(t[u])}}catch(m){d=!0,h=m}finally{try{f||null==g.return||g.return()}finally{if(d)throw h}}}else r[c]=[t[u].clone()]}}catch(m){i=!0,a=m}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return util_flatten(util_vals(r)).map((function(e){var t=e.combine();if(t.encode&&t.encode.symbols){var r=t.encode.symbols.update;!r.fill||"transparent"===r.fill.value||r.stroke||t.stroke||(r.stroke={value:"transparent"}),t.fill&&delete r.fill}return t}))}function assemble_assembleProjections(e){return isLayerModel(e)||isConcatModel(e)||isRepeatModel(e)?function assembleProjectionsForModelAndChildren(e){return e.children.reduce((function(e,t){return e.concat(t.assembleProjections())}),assembleProjectionForModel(e))}(e):assembleProjectionForModel(e)}function assembleProjectionForModel(e){var t=e.component.projection;if(!t||t.merged)return[];var r=t.combine(),n=r.name,i=__rest(r,["name"]);if(t.data){var a={signal:"[".concat(t.size.map((function(e){return e.signal})).join(", "),"]")},o=t.data.reduce((function(t,r){var n=isSignalRef(r)?r.signal:"data('".concat(e.lookupDataSource(r),"')");return util_contains(t,n)||t.push(n),t}),[]);if(o.length<=0)throw new Error("Projection's fit didn't find any data sources");return[Object.assign({name:n,size:a,fit:{signal:o.length>1?"[".concat(o.join(", "),"]"):o[0]}},i)]}return[Object.assign({name:n},{translate:{signal:"[width / 2, height / 2]"}},i)]}var $C=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"],XC=function(e){function ProjectionComponent(e,t,r,n){var i;return Object(_d.a)(this,ProjectionComponent),(i=Object(WE.a)(this,Object(GE.a)(ProjectionComponent).call(this,Object.assign({},t),{name:e}))).specifiedProjection=t,i.size=r,i.data=n,i.merged=!1,i}return Object(HE.a)(ProjectionComponent,e),Object(bd.a)(ProjectionComponent,[{key:"isFit",get:function get(){return!!this.data}}]),ProjectionComponent}(VC);function parse_parseProjection(e){e.component.projection=isUnitModel(e)?function parseUnitProjection(e){if(e.hasProjection){var t=e.specifiedProjection,r=!(t&&(null!=t.scale||null!=t.translate)),n=r?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,i=r?function gatherFitData(e){var t=[];[[Nk,Lk],[Uk,Bk]].forEach((function(r){(e.channelHasField(r[0])||e.channelHasField(r[1]))&&t.push({signal:e.getName("geojson_".concat(t.length))})})),e.channelHasField(Gk)&&e.fieldDef(Gk).type===nE&&t.push({signal:e.getName("geojson_".concat(t.length))});0===t.length&&t.push(e.requestDataName(tC));return t}(e):void 0;return new XC(e.projectionName(!0),Object.assign({},e.config.projection||{},t||{}),n,i)}return}(e):function parseNonUnitProjections(e){if(0===e.children.length)return;var t;e.children.forEach((function(e){return parse_parseProjection(e)}));var r=every(e.children,(function(e){var r=e.component.projection;if(r){if(t){var n=function mergeIfNoConflict(e,t){var r=every($C,(function(r){return!e.explicit.hasOwnProperty(r)&&!t.explicit.hasOwnProperty(r)||!(!e.explicit.hasOwnProperty(r)||!t.explicit.hasOwnProperty(r)||ik(e.get(r))!==ik(t.get(r)))}));if(ik(e.size)===ik(t.size)){if(r)return e;if(ik(e.explicit)===ik({}))return t;if(ik(t.explicit)===ik({}))return e}return null}(t,r);return n&&(t=n),!!n}return t=r,!0}return!0}));if(t&&r){var n=e.projectionName(!0),i=new XC(n,t.specifiedProjection,t.size,nk(t.data));return e.children.forEach((function(e){var t=e.component.projection;if(t){var r;if(t.isFit)(r=i.data).push.apply(r,Object(Ra.a)(e.component.projection.data));e.renameProjection(t.get("name"),n),t.merged=!0}})),i}return}(e)}var KC=r(83),JC=r(85),QC=r(84);function binKey(e,t){return"".concat(binToString(e),"_").concat(t)}function getBinSignalName(e,t,r){var n=binKey(normalizeBin(r,void 0)||{},t);return e.getName("".concat(n,"_bins"))}function createBinComponent(e,t,r){var n;n=function isBinTransform(e){return"as"in e}(e)?qw(e.as)?[e.as,"".concat(e.as,"_end")]:[e.as[0],e.as[1]]:[channeldef_vgField(e,{forAs:!0}),channeldef_vgField(e,{binSuffix:"end",forAs:!0})];var i=normalizeBin(t,void 0)||{},a=binKey(i,e.field),o=function getSignalsFromModel(e,t){return{signal:e.getName("".concat(t,"_bins")),extentSignal:e.getName("".concat(t,"_extent"))}}(r,a),s=o.signal,u=o.extentSignal;return{key:a,binComponent:Object.assign({bin:i,field:e.field,as:[n]},s?{signal:s}:{},u?{extentSignal:u}:{})}}var ZC=function(e){function BinNode(e,t){var r;return Object(_d.a)(this,BinNode),(r=Object(WE.a)(this,Object(GE.a)(BinNode).call(this,e))).bins=t,r}return Object(HE.a)(BinNode,e),Object(bd.a)(BinNode,[{key:"clone",value:function clone(){return new BinNode(null,nk(this.bins))}},{key:"merge",value:function merge(e,t){var r=!0,n=!1,i=void 0;try{for(var a,o=ak(e.bins)[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;s in this.bins?(t(e.bins[s].signal,this.bins[s].signal),this.bins[s].as=unique([].concat(Object(Ra.a)(this.bins[s].as),Object(Ra.a)(e.bins[s].as)),util_hash)):this.bins[s]=e.bins[s]}}catch(p){n=!0,i=p}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}var u=!0,l=!1,c=void 0;try{for(var f,d=e.children[Symbol.iterator]();!(u=(f=d.next()).done);u=!0){var h=f.value;e.removeChild(h),h.parent=this}}catch(p){l=!0,c=p}finally{try{u||null==d.return||d.return()}finally{if(l)throw c}}e.remove()}},{key:"producedFields",value:function producedFields(){return new Set(util_flatten(util_flatten(util_vals(this.bins).map((function(e){return e.as})))))}},{key:"dependentFields",value:function dependentFields(){return new Set(util_vals(this.bins).map((function(e){return e.field})))}},{key:"hash",value:function hash(){return"Bin ".concat(util_hash(this.bins))}},{key:"assemble",value:function assemble(){return util_flatten(util_vals(this.bins).map((function(e){var t=[],r=function _toArray(e){return Object(KC.a)(e)||Object(JC.a)(e)||Object(QC.a)()}(e.as),n=r[0],i=r.slice(1),a=Object.assign({type:"bin",field:replacePathInField(e.field),as:n,signal:e.signal},e.bin);!e.bin.extent&&e.extentSignal&&(t.push({type:"extent",field:replacePathInField(e.field),signal:e.extentSignal}),a.extent={signal:e.extentSignal}),t.push(a);var o=!0,s=!1,u=void 0;try{for(var l,c=i[Symbol.iterator]();!(o=(l=c.next()).done);o=!0)for(var f=l.value,d=0;d<2;d++)t.push({type:"formula",expr:channeldef_vgField({field:n[d]},{expr:"datum"}),as:f[d]})}catch(h){s=!0,u=h}finally{try{o||null==c.return||c.return()}finally{if(s)throw u}}return e.formula&&t.push({type:"formula",expr:e.formula,as:e.formulaAs}),t})))}}],[{key:"makeFromEncoding",value:function makeFromEncoding(e,t){var r=t.reduceFieldDef((function(e,r,n){if(isTypedFieldDef(r)&&isBinning(r.bin)){var i=createBinComponent(r,r.bin,t),a=i.key,o=i.binComponent;e[a]=Object.assign({},o,e[a],function rangeFormula(e,t,r,n){if(binRequiresRange(t,r)){var i=isUnitModel(e)&&(e.axis(r)||e.legend(r))||{},a=channeldef_vgField(t,{expr:"datum"}),o=channeldef_vgField(t,{expr:"datum",binSuffix:"end"});return{formulaAs:channeldef_vgField(t,{binSuffix:"range",forAs:!0}),formula:binFormatExpression(a,o,i.format,n)}}return{}}(t,r,n,t.config))}return e}),{});return 0===ak(r).length?null:new BinNode(e,r)}},{key:"makeFromTransform",value:function makeFromTransform(e,t,r){var n=createBinComponent(t,t.bin,r),i=n.key,a=n.binComponent;return new BinNode(e,Object(po.a)({},i,a))}}]),BinNode}(gC),eT=function(e){function SourceNode(e){var t,r;if(Object(_d.a)(this,SourceNode),t=Object(WE.a)(this,Object(GE.a)(SourceNode).call(this,null)),isGenerator(e=e||{name:"source"})||(r=e.format?Object.assign({},omit(e.format,["parse"])):{}),isInlineData(e))t._data={values:e.values};else if(isUrlData(e)){if(t._data={url:e.url},!r.type){var n=/(?:\.([^.]+))?$/.exec(e.url)[1];util_contains(["json","csv","tsv","dsv","topojson"],n)||(n="json"),r.type=n}}else isSphereGenerator(e)?t._data={values:[{type:"Sphere"}]}:(isNamedData(e)||isGenerator(e))&&(t._data={});return t._generator=isGenerator(e),e.name&&(t._name=e.name),r&&ak(r).length>0&&(t._data.format=r),t}return Object(HE.a)(SourceNode,e),Object(bd.a)(SourceNode,[{key:"hasName",value:function hasName(){return!!this._name}},{key:"remove",value:function remove(){throw new Error("Source nodes are roots and cannot be removed.")}},{key:"hash",value:function hash(){throw new Error("Cannot hash sources")}},{key:"assemble",value:function assemble(){return Object.assign({name:this._name},this._data,{transform:[]})}},{key:"data",get:function get(){return this._data}},{key:"isGenerator",get:function get(){return this._generator}},{key:"dataName",get:function get(){return this._name},set:function set(e){this._name=e}},{key:"parent",set:function set(e){throw new Error("Source nodes have to be roots.")}}]),SourceNode}(gC);function checkLinks(e){var t=!0,r=!1,n=void 0;try{for(var i,a=e[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var o=i.value,s=!0,u=!1,l=void 0;try{for(var c,f=o.children[Symbol.iterator]();!(s=(c=f.next()).done);s=!0){var d=c.value;if(d.parent!==o)return console.error("Dataflow graph is inconsistent.",o,d),!1}}catch(h){u=!0,l=h}finally{try{s||null==f.return||f.return()}finally{if(u)throw l}}if(!checkLinks(o.children))return!1}}catch(h){r=!0,n=h}finally{try{t||null==a.return||a.return()}finally{if(r)throw n}}return!0}var tT=function(e){function GraticuleNode(e,t){var r;return Object(_d.a)(this,GraticuleNode),(r=Object(WE.a)(this,Object(GE.a)(GraticuleNode).call(this,e))).params=t,r}return Object(HE.a)(GraticuleNode,e),Object(bd.a)(GraticuleNode,[{key:"clone",value:function clone(){return new GraticuleNode(null,this.params)}},{key:"assemble",value:function assemble(){return Object.assign({type:"graticule"},!0===this.params?{}:this.params)}}]),GraticuleNode}(gC),rT=function(e){function SequenceNode(e,t){var r;return Object(_d.a)(this,SequenceNode),(r=Object(WE.a)(this,Object(GE.a)(SequenceNode).call(this,e))).params=t,r}return Object(HE.a)(SequenceNode,e),Object(bd.a)(SequenceNode,[{key:"clone",value:function clone(){return new SequenceNode(null,this.params)}},{key:"producedFields",value:function producedFields(){return new Set([this.params.as||"data"])}},{key:"assemble",value:function assemble(){return Object.assign({type:"sequence"},this.params)}}]),SequenceNode}(gC);function isDataSourceNode(e){return e instanceof eT||e instanceof tT||e instanceof rT}var nT=function(){function OptimizerBase(){Object(_d.a)(this,OptimizerBase),this._mutated=!1}return Object(bd.a)(OptimizerBase,[{key:"setMutated",value:function setMutated(){this._mutated=!0}},{key:"mutatedFlag",get:function get(){return this._mutated}}]),OptimizerBase}(),iT=function(e){function BottomUpOptimizer(){var e;return Object(_d.a)(this,BottomUpOptimizer),(e=Object(WE.a)(this,Object(GE.a)(BottomUpOptimizer).call(this)))._continue=!1,e}return Object(HE.a)(BottomUpOptimizer,e),Object(bd.a)(BottomUpOptimizer,[{key:"setContinue",value:function setContinue(){this._continue=!0}},{key:"reset",value:function reset(){}},{key:"optimizeNextFromLeaves",value:function optimizeNextFromLeaves(e){if(isDataSourceNode(e))return!1;var t=e.parent;return this.run(e).continueFlag&&this.optimizeNextFromLeaves(t),this.mutatedFlag}},{key:"continueFlag",get:function get(){return this._continue}},{key:"flags",get:function get(){return{continueFlag:this.continueFlag,mutatedFlag:this.mutatedFlag}},set:function set(e){var t=e.continueFlag,r=e.mutatedFlag;t&&this.setContinue(),r&&this.setMutated()}}]),BottomUpOptimizer}(nT),aT=function(e){function TopDownOptimizer(){return Object(_d.a)(this,TopDownOptimizer),Object(WE.a)(this,Object(GE.a)(TopDownOptimizer).apply(this,arguments))}return Object(HE.a)(TopDownOptimizer,e),TopDownOptimizer}(nT);function addDimension(e,t,r,n){if(isTypedFieldDef(r)&&isBinning(r.bin))e.add(channeldef_vgField(r,{})),e.add(channeldef_vgField(r,{binSuffix:"end"})),binRequiresRange(r,t)&&e.add(channeldef_vgField(r,{binSuffix:"range"}));else if(function isGeoPositionChannel(e){return e in nS}(t)){var i=function getPositionChannelFromLatLong(e){switch(e){case Lk:return"y";case Bk:return"y2";case Nk:return"x";case Uk:return"x2"}}(t);e.add(n.getName(i))}else e.add(channeldef_vgField(r));return e}var oT=function(e){function AggregateNode(e,t,r){var n;return Object(_d.a)(this,AggregateNode),(n=Object(WE.a)(this,Object(GE.a)(AggregateNode).call(this,e))).dimensions=t,n.measures=r,n}return Object(HE.a)(AggregateNode,e),Object(bd.a)(AggregateNode,[{key:"clone",value:function clone(){return new AggregateNode(null,new Set(this.dimensions),nk(this.measures))}},{key:"merge",value:function merge(e){return function setEqual(e,t){if(e.size!==t.size)return!1;var r=!0,n=!1,i=void 0;try{for(var a,o=e[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;if(!t.has(s))return!1}}catch(u){n=!0,i=u}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}return!0}(this.dimensions,e.dimensions)?(function mergeMeasures(e,t){var r=!0,n=!1,i=void 0;try{for(var a,o=ak(t)[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value,u=t[s],l=!0,c=!1,f=void 0;try{for(var d,h=ak(u)[Symbol.iterator]();!(l=(d=h.next()).done);l=!0){var p=d.value;s in e?e[s][p]=new Set([].concat(Object(Ra.a)(e[s][p]||[]),Object(Ra.a)(u[p]))):e[s]=Object(po.a)({},p,u[p])}}catch(g){c=!0,f=g}finally{try{l||null==h.return||h.return()}finally{if(c)throw f}}}}catch(g){n=!0,i=g}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}}(this.measures,e.measures),!0):(function log_debug(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];BS.debug.apply(BS,arguments)}("different dimensions, cannot merge"),!1)}},{key:"addDimensions",value:function addDimensions(e){e.forEach(this.dimensions.add,this.dimensions)}},{key:"dependentFields",value:function dependentFields(){return new Set([].concat(Object(Ra.a)(this.dimensions),Object(Ra.a)(ak(this.measures))))}},{key:"producedFields",value:function producedFields(){var e=new Set,t=!0,r=!1,n=void 0;try{for(var i,a=ak(this.measures)[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var o=i.value,s=!0,u=!1,l=void 0;try{for(var c,f=ak(this.measures[o])[Symbol.iterator]();!(s=(c=f.next()).done);s=!0){var d=c.value,h=this.measures[o][d];0===h.size?e.add("".concat(d,"_").concat(o)):h.forEach(e.add,e)}}catch(p){u=!0,l=p}finally{try{s||null==f.return||f.return()}finally{if(u)throw l}}}}catch(p){r=!0,n=p}finally{try{t||null==a.return||a.return()}finally{if(r)throw n}}return e}},{key:"hash",value:function hash(){return"Aggregate ".concat(util_hash({dimensions:this.dimensions,measures:this.measures}))}},{key:"assemble",value:function assemble(){var e=[],t=[],r=[],n=!0,i=!1,a=void 0;try{for(var o,s=ak(this.measures)[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var u=o.value,l=!0,c=!1,f=void 0;try{for(var d,h=ak(this.measures[u])[Symbol.iterator]();!(l=(d=h.next()).done);l=!0){var p=d.value,g=!0,m=!1,v=void 0;try{for(var y,_=this.measures[u][p][Symbol.iterator]();!(g=(y=_.next()).done);g=!0){var b=y.value;r.push(b),e.push(p),t.push("*"===u?null:replacePathInField(u))}}catch(x){m=!0,v=x}finally{try{g||null==_.return||_.return()}finally{if(m)throw v}}}}catch(x){c=!0,f=x}finally{try{l||null==h.return||h.return()}finally{if(c)throw f}}}}catch(x){i=!0,a=x}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return{type:"aggregate",groupby:Object(Ra.a)(this.dimensions),ops:e,fields:t,as:r}}},{key:"groupBy",get:function get(){return this.dimensions}}],[{key:"makeFromEncoding",value:function makeFromEncoding(e,t){var r=!1;t.forEachFieldDef((function(e){e.aggregate&&(r=!0)}));var n={},i=new Set;return r?(t.forEachFieldDef((function(e,r){var a=e.aggregate,o=e.field;if(a)if("count"===a)n["*"]=n["*"]||{},n["*"].count=new Set([channeldef_vgField(e,{forAs:!0})]);else{if(isArgminDef(a)||isArgmaxDef(a)){var s=isArgminDef(a)?"argmin":"argmax",u=a[s];n[u]=n[u]||{},n[u][s]=new Set([channeldef_vgField({op:s,field:u},{forAs:!0})])}else n[o]=n[o]||{},n[o][a]=new Set([channeldef_vgField(e,{forAs:!0})]);isScaleChannel(r)&&"unaggregated"===t.scaleDomain(r)&&(n[o]=n[o]||{},n[o].min=new Set([channeldef_vgField({field:o,aggregate:"min"},{forAs:!0})]),n[o].max=new Set([channeldef_vgField({field:o,aggregate:"max"},{forAs:!0})]))}else addDimension(i,r,e,t)})),i.size+ak(n).length===0?null:new AggregateNode(e,i,n)):null}},{key:"makeFromTransform",value:function makeFromTransform(e,t){var r=new Set,n={},i=!0,a=!1,o=void 0;try{for(var s,u=t.aggregate[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var l=s.value,c=l.op,f=l.field,d=l.as;c&&("count"===c?(n["*"]=n["*"]||{},n["*"].count=new Set([d||channeldef_vgField(l,{forAs:!0})])):(n[f]=n[f]||{},n[f][c]=new Set([d||channeldef_vgField(l,{forAs:!0})])))}}catch(_){a=!0,o=_}finally{try{i||null==u.return||u.return()}finally{if(a)throw o}}var h=!0,p=!1,g=void 0;try{for(var m,v=(t.groupby||[])[Symbol.iterator]();!(h=(m=v.next()).done);h=!0){var y=m.value;r.add(y)}}catch(_){p=!0,g=_}finally{try{h||null==v.return||v.return()}finally{if(p)throw g}}return r.size+ak(n).length===0?null:new AggregateNode(e,r,n)}}]),AggregateNode}(gC),sT=function(e){function FacetNode(e,t,r,n){var i;Object(_d.a)(this,FacetNode),(i=Object(WE.a)(this,Object(GE.a)(FacetNode).call(this,e))).model=t,i.name=r,i.data=n;var a=!0,o=!1,s=void 0;try{for(var u,l=sS[Symbol.iterator]();!(a=(u=l.next()).done);a=!0){var c=u.value,f=t.facet[c];if(f){var d=f.bin,h=f.sort;i[c]=Object.assign({name:t.getName("".concat(c,"_domain")),fields:[channeldef_vgField(f)].concat(Object(Ra.a)(isBinning(d)?[channeldef_vgField(f,{binSuffix:"end"})]:[]))},isSortField(h)?{sortField:h}:Uw(h)?{sortIndexField:sortArrayIndexField(f,c)}:{})}}}catch(p){o=!0,s=p}finally{try{a||null==l.return||l.return()}finally{if(o)throw s}}return i.childModel=t.child,i}return Object(HE.a)(FacetNode,e),Object(bd.a)(FacetNode,[{key:"hash",value:function hash(){var e="Facet",t=!0,r=!1,n=void 0;try{for(var i,a=sS[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var o=i.value;this[o]&&(e+=" ".concat(o.charAt(0),":").concat(util_hash(this[o])))}}catch(s){r=!0,n=s}finally{try{t||null==a.return||a.return()}finally{if(r)throw n}}return e}},{key:"getSource",value:function getSource(){return this.name}},{key:"getChildIndependentFieldsWithStep",value:function getChildIndependentFieldsWithStep(){for(var e={},t=0,r=["x","y"];t<r.length;t++){var n=r[t],i=this.childModel.component.scales[n];if(i&&!i.merged){var a=i.get("type"),o=i.get("range");if(hasDiscreteDomain(a)&&isVgRangeStep(o)){var s=getFieldFromDomain(assembleDomain(this.childModel,n));s?e[n]=s:log_warn("Unknown field for ${channel}. Cannot calculate view size.")}}}return e}},{key:"assembleRowColumnHeaderData",value:function assembleRowColumnHeaderData(e,t,r){var n={row:"y",column:"x"}[e],i=[],a=[],o=[];r&&r[n]&&(t?(i.push("distinct_".concat(r[n])),a.push("max")):(i.push(r[n]),a.push("distinct")),o.push("distinct_".concat(r[n])));var s=this[e],u=s.sortField,l=s.sortIndexField;if(u){var c=u.op,f=void 0===c?pC:c,d=u.field;i.push(d),a.push(f),o.push(channeldef_vgField(u,{forAs:!0}))}else l&&(i.push(l),a.push("max"),o.push(l));return{name:this[e].name,source:t||this.data,transform:[Object.assign({type:"aggregate",groupby:this[e].fields},i.length?{fields:i,ops:a,as:o}:{})]}}},{key:"assembleFacetHeaderData",value:function assembleFacetHeaderData(e){var t=this.model.layout.columns,r=this.model.component.layoutHeaders,n=[],i={},a=!0,o=!1,s=void 0;try{for(var u,l=yC[Symbol.iterator]();!(a=(u=l.next()).done);a=!0){var c=u.value,f=!0,d=!1,h=void 0;try{for(var p,g=_C[Symbol.iterator]();!(f=(p=g.next()).done);f=!0){var m=p.value,v=r[c]&&r[c][m]||[],y=!0,_=!1,b=void 0;try{for(var x,w=v[Symbol.iterator]();!(y=(x=w.next()).done);y=!0){var k=x.value;if(k.axes&&k.axes.length>0){i[c]=!0;break}}}catch(O){_=!0,b=O}finally{try{y||null==w.return||w.return()}finally{if(_)throw b}}}}catch(O){d=!0,h=O}finally{try{f||null==g.return||g.return()}finally{if(d)throw h}}if(i[c]){var S='length(data("'.concat(this.facet.name,'"))'),E="row"===c?t?{signal:"ceil(".concat(S," / ").concat(t,")")}:1:t?{signal:"min(".concat(S,", ").concat(t,")")}:{signal:S};n.push({name:"".concat(this.facet.name,"_").concat(c),transform:[{type:"sequence",start:0,stop:E}]})}}}catch(O){o=!0,s=O}finally{try{a||null==l.return||l.return()}finally{if(o)throw s}}var C=i.row,T=i.column;return(C||T)&&n.unshift(this.assembleRowColumnHeaderData("facet",null,e)),n}},{key:"assemble",value:function assemble(){var e=[],t=null,r=this.getChildIndependentFieldsWithStep(),n=this.column,i=this.row,a=this.facet;if(n&&i&&(r.x||r.y)){t="cross_".concat(this.column.name,"_").concat(this.row.name);var o=[].concat(r.x||[],r.y||[]),s=o.map((function(){return"distinct"}));e.push({name:t,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:o,ops:s}]})}for(var u=0,l=[Dk,Rk];u<l.length;u++){var c=l[u];this[c]&&e.push(this.assembleRowColumnHeaderData(c,t,r))}if(a){var f=this.assembleFacetHeaderData(r);f&&e.push.apply(e,Object(Ra.a)(f))}return e}},{key:"fields",get:function get(){var e=[],t=!0,r=!1,n=void 0;try{for(var i,a=sS[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var o=i.value;this[o]&&this[o].fields&&e.push.apply(e,Object(Ra.a)(this[o].fields))}}catch(s){r=!0,n=s}finally{try{t||null==a.return||a.return()}finally{if(r)throw n}}return e}}]),FacetNode}(gC),uT=function(e){function FilterNode(e,t,r){var n;return Object(_d.a)(this,FilterNode),(n=Object(WE.a)(this,Object(GE.a)(FilterNode).call(this,e))).model=t,n.filter=r,n.expr=predicate_expression(n.model,n.filter,Object(eC.a)(n)),n._dependentFields=getDependentFields(n.expr),n}return Object(HE.a)(FilterNode,e),Object(bd.a)(FilterNode,[{key:"clone",value:function clone(){return new FilterNode(null,this.model,nk(this.filter))}},{key:"dependentFields",value:function dependentFields(){return this._dependentFields}},{key:"assemble",value:function assemble(){return{type:"filter",expr:this.expr}}},{key:"hash",value:function hash(){return"Filter ".concat(this.expr)}}]),FilterNode}(gC);function unquote(e){return"'"===e[0]&&"'"===e[e.length-1]||'"'===e[0]&&'"'===e[e.length-1]?e.slice(1,-1):e}function formatparse_parseExpression(e,t){var r=accessPathWithDatum(e);if("number"===t)return"toNumber(".concat(r,")");if("boolean"===t)return"toBoolean(".concat(r,")");if("string"===t)return"toString(".concat(r,")");if("date"===t)return"toDate(".concat(r,")");if("flatten"===t)return r;if(0===t.indexOf("date:")){var n=unquote(t.slice(5,t.length));return"timeParse(".concat(r,",'").concat(n,"')")}if(0===t.indexOf("utc:")){var i=unquote(t.slice(4,t.length));return"utcParse(".concat(r,",'").concat(i,"')")}return log_warn(LS.unrecognizedParse(t)),null}var lT=function(e){function ParseNode(e,t){var r;return Object(_d.a)(this,ParseNode),(r=Object(WE.a)(this,Object(GE.a)(ParseNode).call(this,e)))._parse=t,r}return Object(HE.a)(ParseNode,e),Object(bd.a)(ParseNode,[{key:"clone",value:function clone(){return new ParseNode(null,nk(this._parse))}}]),Object(bd.a)(ParseNode,[{key:"hash",value:function hash(){return"Parse ".concat(util_hash(this._parse))}},{key:"merge",value:function merge(e){this._parse=Object.assign({},this._parse,e.parse),e.remove()}},{key:"assembleFormatParse",value:function assembleFormatParse(){var e={},t=!0,r=!1,n=void 0;try{for(var i,a=ak(this._parse)[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var o=i.value,s=this._parse[o];1===accessPathDepth(o)&&(e[o]=s)}}catch(u){r=!0,n=u}finally{try{t||null==a.return||a.return()}finally{if(r)throw n}}return e}},{key:"producedFields",value:function producedFields(){return new Set(ak(this._parse))}},{key:"dependentFields",value:function dependentFields(){return new Set(ak(this._parse))}},{key:"assembleTransforms",value:function assembleTransforms(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return ak(this._parse).filter((function(e){return!t||accessPathDepth(e)>1})).map((function(t){var r=formatparse_parseExpression(t,e._parse[t]);return r?{type:"formula",expr:r,as:removePathFromField(t)}:null})).filter((function(e){return null!==e}))}},{key:"parse",get:function get(){return this._parse}}],[{key:"makeExplicit",value:function makeExplicit(e,t,r){var n={},i=t.data;return!isGenerator(i)&&i&&i.format&&i.format.parse&&(n=i.format.parse),this.makeWithAncestors(e,n,{},r)}},{key:"makeImplicitFromFilterTransform",value:function makeImplicitFromFilterTransform(e,t,r){var n={};return function forEachLeaf(e,t){if(isLogicalNot(e))forEachLeaf(e.not,t);else if(isLogicalAnd(e)){var r=!0,n=!1,i=void 0;try{for(var a,o=e.and[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){forEachLeaf(a.value,t)}}catch(d){n=!0,i=d}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}}else if(isLogicalOr(e)){var s=!0,u=!1,l=void 0;try{for(var c,f=e.or[Symbol.iterator]();!(s=(c=f.next()).done);s=!0){forEachLeaf(c.value,t)}}catch(d){u=!0,l=d}finally{try{s||null==f.return||f.return()}finally{if(u)throw l}}}else t(e)}(t.filter,(function(e){if(isFieldPredicate(e)){var t=null;isFieldEqualPredicate(e)?t=e.equal:isFieldRangePredicate(e)?t=e.range[0]:isFieldOneOfPredicate(e)&&(t=(e.oneOf||e.in)[0]),t&&(isDateTime(t)?n[e.field]="date":$w(t)?n[e.field]="number":qw(t)&&(n[e.field]="string")),e.timeUnit&&(n[e.field]="date")}})),0===ak(n).length?null:this.makeWithAncestors(e,{},n,r)}},{key:"makeImplicitFromEncoding",value:function makeImplicitFromEncoding(e,t,r){var n={};function add(e){isTimeFormatFieldDef(e)?n[e.field]="date":"quantitative"===e.type&&function isMinMaxOp(e){return e&&qw(e)&&util_contains(["min","max"],e)}(e.aggregate)?n[e.field]="number":accessPathDepth(e.field)>1?e.field in n||(n[e.field]="flatten"):isScaleFieldDef(e)&&isSortField(e.sort)&&accessPathDepth(e.sort.field)>1&&(e.sort.field in n||(n[e.sort.field]="flatten"))}if((isUnitModel(t)||isFacetModel(t))&&t.forEachFieldDef((function(e,r){if(isTypedFieldDef(e))add(e);else{var n=getMainRangeChannel(r),i=t.fieldDef(n);add(Object.assign({},e,{type:i.type}))}})),isUnitModel(t)){var i=t.mark,a=t.markDef,o=t.encoding;if(isPathMark(i)&&!t.encoding.order){var s=o["horizontal"===a.orient?"y":"x"];!isFieldDef(s)||"quantitative"!==s.type||s.field in n||(n[s.field]="number")}}return this.makeWithAncestors(e,{},n,r)}},{key:"makeWithAncestors",value:function makeWithAncestors(e,t,r,n){var i=!0,a=!1,o=void 0;try{for(var s,u=ak(r)[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var l=s.value,c=n.getWithExplicit(l);void 0!==c.value&&(c.explicit||c.value===r[l]||"derived"===c.value||"flatten"===r[l]?delete r[l]:log_warn(LS.differentParse(l,r[l],c.value)))}}catch(T){a=!0,o=T}finally{try{i||null==u.return||u.return()}finally{if(a)throw o}}var f=!0,d=!1,h=void 0;try{for(var p,g=ak(t)[Symbol.iterator]();!(f=(p=g.next()).done);f=!0){var m=p.value,v=n.get(m);void 0!==v&&(v===t[m]?delete t[m]:log_warn(LS.differentParse(m,t[m],v)))}}catch(T){d=!0,h=T}finally{try{f||null==g.return||g.return()}finally{if(d)throw h}}var y=new VC(t,r);n.copyAll(y);var _={},b=!0,x=!1,w=void 0;try{for(var k,S=ak(y.combine())[Symbol.iterator]();!(b=(k=S.next()).done);b=!0){var E=k.value,C=y.get(E);null!==C&&(_[E]=C)}}catch(T){x=!0,w=T}finally{try{b||null==S.return||S.return()}finally{if(x)throw w}}return 0===ak(_).length||n.parseNothing?null:new ParseNode(e,_)}}]),ParseNode}(gC),cT=function(e){function JoinAggregateTransformNode(e,t){var r;return Object(_d.a)(this,JoinAggregateTransformNode),(r=Object(WE.a)(this,Object(GE.a)(JoinAggregateTransformNode).call(this,e))).transform=t,r}return Object(HE.a)(JoinAggregateTransformNode,e),Object(bd.a)(JoinAggregateTransformNode,[{key:"clone",value:function clone(){return new JoinAggregateTransformNode(null,nk(this.transform))}},{key:"addDimensions",value:function addDimensions(e){this.transform.groupby=unique(this.transform.groupby.concat(e),(function(e){return e}))}},{key:"dependentFields",value:function dependentFields(){var e=new Set;return this.transform.groupby&&this.transform.groupby.forEach((function(t){return e.add(t)})),this.transform.joinaggregate.map((function(e){return e.field})).filter((function(e){return void 0!==e})).forEach((function(t){return e.add(t)})),e}},{key:"producedFields",value:function producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}},{key:"getDefaultName",value:function getDefaultName(e){return e.as||channeldef_vgField(e)}},{key:"hash",value:function hash(){return"JoinAggregateTransform ".concat(util_hash(this.transform))}},{key:"assemble",value:function assemble(){var e=[],t=[],r=[],n=!0,i=!1,a=void 0;try{for(var o,s=this.transform.joinaggregate[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var u=o.value;t.push(u.op),r.push(this.getDefaultName(u)),e.push(void 0===u.field?null:u.field)}}catch(c){i=!0,a=c}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}var l=this.transform.groupby;return Object.assign({type:"joinaggregate",as:r,ops:t,fields:e},void 0!==l?{groupby:l}:{})}}]),JoinAggregateTransformNode}(gC);var fT=function(e){function StackNode(e,t){var r;return Object(_d.a)(this,StackNode),(r=Object(WE.a)(this,Object(GE.a)(StackNode).call(this,e)))._stack=t,r}return Object(HE.a)(StackNode,e),Object(bd.a)(StackNode,[{key:"clone",value:function clone(){return new StackNode(null,nk(this._stack))}}]),Object(bd.a)(StackNode,[{key:"addDimensions",value:function addDimensions(e){var t;(t=this._stack.facetby).push.apply(t,Object(Ra.a)(e))}},{key:"dependentFields",value:function dependentFields(){var e=new Set;return e.add(this._stack.stackField),this.getGroupbyFields().forEach((function(t){return e.add(t)})),this._stack.facetby.forEach((function(t){return e.add(t)})),this._stack.sort.field.forEach((function(t){return e.add(t)})),e}},{key:"producedFields",value:function producedFields(){return new Set(this._stack.as)}},{key:"hash",value:function hash(){return"Stack ".concat(util_hash(this._stack))}},{key:"getGroupbyFields",value:function getGroupbyFields(){var e=this._stack,t=e.dimensionFieldDef,r=e.impute,n=e.groupby;return t?t.bin?r?[channeldef_vgField(t,{binSuffix:"mid"})]:[channeldef_vgField(t,{}),channeldef_vgField(t,{binSuffix:"end"})]:[channeldef_vgField(t)]:n||[]}},{key:"assemble",value:function assemble(){var e=[],t=this._stack,r=t.facetby,n=t.dimensionFieldDef,i=t.stackField,a=t.stackby,o=t.sort,s=t.offset,u=t.impute,l=t.as;return u&&n&&(n.bin&&e.push({type:"formula",expr:"0.5*"+channeldef_vgField(n,{expr:"datum"})+"+0.5*"+channeldef_vgField(n,{expr:"datum",binSuffix:"end"}),as:channeldef_vgField(n,{binSuffix:"mid",forAs:!0})}),e.push({type:"impute",field:i,groupby:[].concat(Object(Ra.a)(a),Object(Ra.a)(r)),key:channeldef_vgField(n,{binSuffix:"mid"}),method:"value",value:0})),e.push({type:"stack",groupby:[].concat(Object(Ra.a)(this.getGroupbyFields()),Object(Ra.a)(r)),field:i,sort:o,as:l,offset:s}),e}},{key:"stack",get:function get(){return this._stack}}],[{key:"makeFromTransform",value:function makeFromTransform(e,t){var r=t.stack,n=t.groupby,i=t.as,a=t.offset,o=void 0===a?"zero":a,s=[],u=[];if(void 0!==t.sort){var l=!0,c=!1,f=void 0;try{for(var d,h=t.sort[Symbol.iterator]();!(l=(d=h.next()).done);l=!0){var p=d.value;s.push(p.field),u.push(getFirstDefined(p.order,"ascending"))}}catch(g){c=!0,f=g}finally{try{l||null==h.return||h.return()}finally{if(c)throw f}}}return new StackNode(e,{stackField:r,groupby:n,offset:o,sort:{field:s,order:u},facetby:[],as:function isValidAsArray(e){return Uw(e)&&e.every((function(e){return qw(e)}))&&e.length>1}(i)?i:qw(i)?[i,i+"_end"]:[t.stack+"_start",t.stack+"_end"]})}},{key:"makeFromEncoding",value:function makeFromEncoding(e,t){var r,n=t.stack,i=t.encoding;if(!n)return null;n.groupbyChannel&&(r=getTypedFieldDef(i[n.groupbyChannel]));var a,o=function getStackByFields(e){return e.stack.stackBy.reduce((function(e,t){var r=channeldef_vgField(t.fieldDef);return r&&e.push(r),e}),[])}(t),s=t.encoding.order;return a=Uw(s)||isFieldDef(s)?sortParams(s):o.reduce((function(e,t){return e.field.push(t),e.order.push("descending"),e}),{field:[],order:[]}),new StackNode(e,{dimensionFieldDef:r,stackField:t.vgField(n.fieldChannel),facetby:[],stackby:o,sort:a,offset:n.offset,impute:n.impute,as:[t.vgField(n.fieldChannel,{suffix:"start",forAs:!0}),t.vgField(n.fieldChannel,{suffix:"end",forAs:!0})]})}}]),StackNode}(gC),dT=function(e){function WindowTransformNode(e,t){var r;return Object(_d.a)(this,WindowTransformNode),(r=Object(WE.a)(this,Object(GE.a)(WindowTransformNode).call(this,e))).transform=t,r}return Object(HE.a)(WindowTransformNode,e),Object(bd.a)(WindowTransformNode,[{key:"clone",value:function clone(){return new WindowTransformNode(null,nk(this.transform))}},{key:"addDimensions",value:function addDimensions(e){this.transform.groupby=unique(this.transform.groupby.concat(e),(function(e){return e}))}},{key:"dependentFields",value:function dependentFields(){var e=new Set;return(this.transform.groupby||[]).forEach((function(t){return e.add(t)})),(this.transform.sort||[]).forEach((function(t){return e.add(t.field)})),this.transform.window.map((function(e){return e.field})).filter((function(e){return void 0!==e})).forEach((function(t){return e.add(t)})),e}},{key:"producedFields",value:function producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}},{key:"getDefaultName",value:function getDefaultName(e){return e.as||channeldef_vgField(e)}},{key:"hash",value:function hash(){return"WindowTransform ".concat(util_hash(this.transform))}},{key:"assemble",value:function assemble(){var e=[],t=[],r=[],n=[],i=!0,a=!1,o=void 0;try{for(var s,u=this.transform.window[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var l=s.value;t.push(l.op),r.push(this.getDefaultName(l)),n.push(void 0===l.param?null:l.param),e.push(void 0===l.field?null:l.field)}}catch(w){a=!0,o=w}finally{try{i||null==u.return||u.return()}finally{if(a)throw o}}var c=this.transform.frame,f=this.transform.groupby;if(c&&null===c[0]&&null===c[1]&&t.every((function(e){return isAggregateOp(e)})))return Object.assign({type:"joinaggregate",as:r,ops:t,fields:e},void 0!==f?{groupby:f}:{});var d=[],h=[];if(void 0!==this.transform.sort){var p=!0,g=!1,m=void 0;try{for(var v,y=this.transform.sort[Symbol.iterator]();!(p=(v=y.next()).done);p=!0){var _=v.value;d.push(_.field),h.push(_.order||"ascending")}}catch(w){g=!0,m=w}finally{try{p||null==y.return||y.return()}finally{if(g)throw m}}}var b={field:d,order:h},x=this.transform.ignorePeers;return Object.assign({type:"window",params:n,as:r,ops:t,fields:e,sort:b},void 0!==x?{ignorePeers:x}:{},void 0!==f?{groupby:f}:{},void 0!==c?{frame:c}:{})}}]),WindowTransformNode}(gC),hT=function(e){function MoveParseUp(){return Object(_d.a)(this,MoveParseUp),Object(WE.a)(this,Object(GE.a)(MoveParseUp).apply(this,arguments))}return Object(HE.a)(MoveParseUp,e),Object(bd.a)(MoveParseUp,[{key:"run",value:function run(e){var t=e.parent;if(e instanceof lT){if(isDataSourceNode(t))return this.flags;if(t.numChildren()>1)return this.setContinue(),this.flags;if(t instanceof lT)this.setMutated(),t.merge(e);else{if(fieldIntersection(t.producedFields(),e.dependentFields()))return this.setContinue(),this.flags;this.setMutated(),e.swapWithParent()}}return this.setContinue(),this.flags}}]),MoveParseUp}(iT),pT=function(e){function MergeIdenticalNodes(){return Object(_d.a)(this,MergeIdenticalNodes),Object(WE.a)(this,Object(GE.a)(MergeIdenticalNodes).apply(this,arguments))}return Object(HE.a)(MergeIdenticalNodes,e),Object(bd.a)(MergeIdenticalNodes,[{key:"mergeNodes",value:function mergeNodes(e,t){var r=t.shift(),n=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var u=o.value;e.removeChild(u),u.parent=r,u.remove()}}catch(l){i=!0,a=l}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}}},{key:"run",value:function run(e){for(var t=e.children.map((function(e){return e.hash()})),r={},n=0;n<t.length;n++)void 0===r[t[n]]?r[t[n]]=[e.children[n]]:r[t[n]].push(e.children[n]);var i=!0,a=!1,o=void 0;try{for(var s,u=ak(r)[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var l=s.value;r[l].length>1&&(this.setMutated(),this.mergeNodes(e,r[l]))}}catch(m){a=!0,o=m}finally{try{i||null==u.return||u.return()}finally{if(a)throw o}}var c=!0,f=!1,d=void 0;try{for(var h,p=e.children[Symbol.iterator]();!(c=(h=p.next()).done);c=!0){var g=h.value;this.run(g)}}catch(m){f=!0,d=m}finally{try{c||null==p.return||p.return()}finally{if(f)throw d}}return this.mutatedFlag}}]),MergeIdenticalNodes}(aT),gT=function(e){function RemoveUnusedSubtrees(){return Object(_d.a)(this,RemoveUnusedSubtrees),Object(WE.a)(this,Object(GE.a)(RemoveUnusedSubtrees).apply(this,arguments))}return Object(HE.a)(RemoveUnusedSubtrees,e),Object(bd.a)(RemoveUnusedSubtrees,[{key:"run",value:function run(e){return e instanceof mC||e.numChildren()>0||e instanceof sT?this.flags:(this.setMutated(),e.remove(),this.flags)}}]),RemoveUnusedSubtrees}(iT),mT=function(e){function RemoveDuplicateTimeUnits(){var e;return Object(_d.a)(this,RemoveDuplicateTimeUnits),(e=Object(WE.a)(this,Object(GE.a)(RemoveDuplicateTimeUnits).apply(this,arguments))).fields=new Set,e}return Object(HE.a)(RemoveDuplicateTimeUnits,e),Object(bd.a)(RemoveDuplicateTimeUnits,[{key:"run",value:function run(e){if(this.setContinue(),e instanceof xC){var t=e.producedFields();hasIntersection(t,this.fields)?(this.setMutated(),e.remove()):this.fields=new Set([].concat(Object(Ra.a)(this.fields),Object(Ra.a)(t)))}return this.flags}},{key:"reset",value:function reset(){this.fields.clear()}}]),RemoveDuplicateTimeUnits}(iT),vT=function(e){function MergeTimeUnits(){return Object(_d.a)(this,MergeTimeUnits),Object(WE.a)(this,Object(GE.a)(MergeTimeUnits).apply(this,arguments))}return Object(HE.a)(MergeTimeUnits,e),Object(bd.a)(MergeTimeUnits,[{key:"run",value:function run(e){this.setContinue();var t=e.parent.children.filter((function(e){return e instanceof xC})),r=t.pop(),n=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var u=o.value;this.setMutated(),r.merge(u)}}catch(l){i=!0,a=l}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return this.flags}}]),MergeTimeUnits}(iT);function moveFacetDown(e){if(e instanceof sT)if(1!==e.numChildren()||e.children[0]instanceof mC){var t=e.model.component.data.main;!function moveMainDownToFacet(e){if(e instanceof mC&&e.type===tC&&1===e.numChildren()){var t=e.children[0];t instanceof sT||(t.swapWithParent(),moveMainDownToFacet(e))}}(t);var r=function cloneSubtree(e){return function clone(t){if(!(t instanceof sT)){var r=t.clone();if(r instanceof mC){var n=kT+r.getSource();r.setSource(n),e.model.component.data.outputNodes[n]=r}else(r instanceof oT||r instanceof fT||r instanceof dT||r instanceof cT)&&r.addDimensions(e.fields);return util_flatten(t.children.map(clone)).forEach((function(e){return e.parent=r})),[r]}return util_flatten(t.children.map(clone))}}(e),n=util_flatten(e.children.map(r)),i=!0,a=!1,o=void 0;try{for(var s,u=n[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){s.value.parent=t}}catch(c){a=!0,o=c}finally{try{i||null==u.return||u.return()}finally{if(a)throw o}}}else{var l=e.children[0];(l instanceof oT||l instanceof fT||l instanceof dT||l instanceof cT)&&l.addDimensions(e.fields),l.swapWithParent(),moveFacetDown(e)}else e.children.map(moveFacetDown)}var yT=function(e){function RemoveUnnecessaryNodes(){return Object(_d.a)(this,RemoveUnnecessaryNodes),Object(WE.a)(this,Object(GE.a)(RemoveUnnecessaryNodes).apply(this,arguments))}return Object(HE.a)(RemoveUnnecessaryNodes,e),Object(bd.a)(RemoveUnnecessaryNodes,[{key:"run",value:function run(e){e instanceof mC&&!e.isRequired()&&(this.setMutated(),e.remove());var t=!0,r=!1,n=void 0;try{for(var i,a=e.children[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var o=i.value;this.run(o)}}catch(s){r=!0,n=s}finally{try{t||null==a.return||a.return()}finally{if(r)throw n}}return this.mutatedFlag}}]),RemoveUnnecessaryNodes}(aT),_T=function(e){function MergeParse(){return Object(_d.a)(this,MergeParse),Object(WE.a)(this,Object(GE.a)(MergeParse).apply(this,arguments))}return Object(HE.a)(MergeParse,e),Object(bd.a)(MergeParse,[{key:"run",value:function run(e){var t=e.parent,r=Object(Ra.a)(t.children),n=t.children.filter((function(e){return e instanceof lT}));if(t.numChildren()>1&&n.length>=1){var i={},a=new Set,o=!0,s=!1,u=void 0;try{for(var l,c=n[Symbol.iterator]();!(o=(l=c.next()).done);o=!0){var f=l.value.parse,d=!0,h=!1,p=void 0;try{for(var g,m=ak(f)[Symbol.iterator]();!(d=(g=m.next()).done);d=!0){var v=g.value;v in i?i[v]!==f[v]&&a.add(v):i[v]=f[v]}}catch(I){h=!0,p=I}finally{try{d||null==m.return||m.return()}finally{if(h)throw p}}}}catch(I){s=!0,u=I}finally{try{o||null==c.return||c.return()}finally{if(s)throw u}}var y=!0,_=!1,b=void 0;try{for(var x,w=a[Symbol.iterator]();!(y=(x=w.next()).done);y=!0){delete i[x.value]}}catch(I){_=!0,b=I}finally{try{y||null==w.return||w.return()}finally{if(_)throw b}}if(0!==ak(i).length){this.setMutated();var k=new lT(t,i),S=!0,E=!1,C=void 0;try{for(var T,O=r[Symbol.iterator]();!(S=(T=O.next()).done);S=!0){var A=T.value;if(A instanceof lT){var R=!0,D=!1,P=void 0;try{for(var j,M=ak(i)[Symbol.iterator]();!(R=(j=M.next()).done);R=!0){var F=j.value;delete A.parse[F]}}catch(I){D=!0,P=I}finally{try{R||null==M.return||M.return()}finally{if(D)throw P}}}t.removeChild(A),A.parent=k,A instanceof lT&&0===ak(A.parse).length&&A.remove()}}catch(I){E=!0,C=I}finally{try{S||null==O.return||O.return()}finally{if(E)throw C}}}}return this.setContinue(),this.flags}}]),MergeParse}(iT),bT=function(e){function MergeAggregates(){return Object(_d.a)(this,MergeAggregates),Object(WE.a)(this,Object(GE.a)(MergeAggregates).apply(this,arguments))}return Object(HE.a)(MergeAggregates,e),Object(bd.a)(MergeAggregates,[{key:"run",value:function run(e){var t=e.parent,r=t.children.filter((function(e){return e instanceof oT})),n={},i=!0,a=!1,o=void 0;try{for(var s,u=r[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var l=s.value,c=util_hash(l.groupBy);c in n||(n[c]=[]),n[c].push(l)}}catch(S){a=!0,o=S}finally{try{i||null==u.return||u.return()}finally{if(a)throw o}}var f=!0,d=!1,h=void 0;try{for(var p,g=ak(n)[Symbol.iterator]();!(f=(p=g.next()).done);f=!0){var m=n[p.value];if(m.length>1){var v=m.pop(),y=!0,_=!1,b=void 0;try{for(var x,w=m[Symbol.iterator]();!(y=(x=w.next()).done);y=!0){var k=x.value;v.merge(k)&&(t.removeChild(k),k.parent=v,k.remove(),this.setMutated())}}catch(S){_=!0,b=S}finally{try{y||null==w.return||w.return()}finally{if(_)throw b}}}}}catch(S){d=!0,h=S}finally{try{f||null==g.return||g.return()}finally{if(d)throw h}}return this.setContinue(),this.flags}}]),MergeAggregates}(iT),xT=function(e){function MergeBins(e){var t;return Object(_d.a)(this,MergeBins),(t=Object(WE.a)(this,Object(GE.a)(MergeBins).call(this))).model=e,t}return Object(HE.a)(MergeBins,e),Object(bd.a)(MergeBins,[{key:"run",value:function run(e){var t=e.parent,r=!(isDataSourceNode(t)||t instanceof uT||t instanceof lT),n=[],i=[],a=!0,o=!1,s=void 0;try{for(var u,l=t.children[Symbol.iterator]();!(a=(u=l.next()).done);a=!0){var c=u.value;c instanceof ZC&&(r&&!fieldIntersection(t.producedFields(),c.dependentFields())?n.push(c):i.push(c))}}catch(E){o=!0,s=E}finally{try{a||null==l.return||l.return()}finally{if(o)throw s}}if(n.length>0){var f=n.pop(),d=!0,h=!1,p=void 0;try{for(var g,m=n[Symbol.iterator]();!(d=(g=m.next()).done);d=!0){var v=g.value;f.merge(v,this.model.renameSignal.bind(this.model))}}catch(E){h=!0,p=E}finally{try{d||null==m.return||m.return()}finally{if(h)throw p}}this.setMutated(),t instanceof ZC?t.merge(f,this.model.renameSignal.bind(this.model)):f.swapWithParent()}if(i.length>1){var y=i.pop(),_=!0,b=!1,x=void 0;try{for(var w,k=i[Symbol.iterator]();!(_=(w=k.next()).done);_=!0){var S=w.value;y.merge(S,this.model.renameSignal.bind(this.model))}}catch(E){b=!0,x=E}finally{try{_||null==k.return||k.return()}finally{if(b)throw x}}this.setMutated()}return this.setContinue(),this.flags}}]),MergeBins}(iT),wT=function(e){function MergeOutputs(){return Object(_d.a)(this,MergeOutputs),Object(WE.a)(this,Object(GE.a)(MergeOutputs).apply(this,arguments))}return Object(HE.a)(MergeOutputs,e),Object(bd.a)(MergeOutputs,[{key:"run",value:function run(e){var t=e.parent,r=Object(Ra.a)(t.children);if(!some(r,(function(e){return e instanceof mC}))||t.numChildren()<=1)return this.setContinue(),this.flags;var n,i=[],a=!0,o=!1,s=void 0;try{for(var u,l=r[Symbol.iterator]();!(a=(u=l.next()).done);a=!0){var c=u.value;if(c instanceof mC){for(var f=c;1===f.numChildren();){var d=f.children[0];if(!(d instanceof mC))break;f=d}i.push.apply(i,Object(Ra.a)(f.children)),n?(t.removeChild(c),c.parent=n.parent,n.parent.removeChild(n),n.parent=f,this.setMutated()):n=f}else i.push(c)}}catch(_){o=!0,s=_}finally{try{a||null==l.return||l.return()}finally{if(o)throw s}}if(i.length){this.setMutated();var h=!0,p=!1,g=void 0;try{for(var m,v=i[Symbol.iterator]();!(h=(m=v.next()).done);h=!0){var y=m.value;y.parent.removeChild(y),y.parent=n}}catch(_){p=!0,g=_}finally{try{h||null==v.return||v.return()}finally{if(p)throw g}}}return this.setContinue(),this.flags}}]),MergeOutputs}(iT),kT="scale_",ST=5;function getLeaves(e){var t=[];return e.forEach((function append(e){0===e.numChildren()?t.push(e):e.children.forEach(append)})),t}function isTrue(e){return e}function runOptimizer(e,t){return t.map((function(t){if(e instanceof iT){var r=e.optimizeNextFromLeaves(t);return e.reset(),r}return e.run(t)})).some(isTrue)}function optimizationDataflowHelper(e,t){var r=e.sources,n=new Set;return n.add(runOptimizer(new yT,r)),r=r.filter((function(e){return e.numChildren()>0})),n.add(runOptimizer(new gT,getLeaves(r))),r=r.filter((function(e){return e.numChildren()>0})),n.add(runOptimizer(new hT,getLeaves(r))),n.add(runOptimizer(new xT(t),getLeaves(r))),n.add(runOptimizer(new mT,getLeaves(r))),n.add(runOptimizer(new _T,getLeaves(r))),n.add(runOptimizer(new bT,getLeaves(r))),n.add(runOptimizer(new vT,getLeaves(r))),n.add(runOptimizer(new pT,r)),n.add(runOptimizer(new wT,getLeaves(r))),e.sources=r,n.has(!0)}var ET=function(){function SignalRefWrapper(e){Object(_d.a)(this,SignalRefWrapper),Object.defineProperty(this,"signal",{enumerable:!0,get:e})}return Object(bd.a)(SignalRefWrapper,null,[{key:"fromName",value:function fromName(e,t){return new SignalRefWrapper((function(){return e(t)}))}}]),SignalRefWrapper}();function domain_parseScaleDomain(e){isUnitModel(e)?function parseUnitScaleDomain(e){var t=e.specifiedScales,r=e.component.scales;ak(r).forEach((function(n){var i=t[n],a=i?i.domain:void 0,o=function parseDomainForChannel(e,t){var r=e.getScaleComponent(t).get("type"),n=function normalizeUnaggregatedDomain(e,t,r,n){if("unaggregated"===e){var i=canUseUnaggregatedDomain(t,r),a=i.valid,o=i.reason;if(!a)return void log_warn(o)}else if(void 0===e&&n.useUnaggregatedDomain){if(canUseUnaggregatedDomain(t,r).valid)return"unaggregated"}return e}(e.scaleDomain(t),e.fieldDef(t),r,e.config.scale);n!==e.scaleDomain(t)&&(e.specifiedScales[t]=Object.assign({},e.specifiedScales[t],{domain:n}));if("x"===t&&e.channelHasField("x2"))return e.channelHasField("x")?mergeValuesWithExplicit(parseSingleChannelDomain(r,n,e,"x"),parseSingleChannelDomain(r,n,e,"x2"),"domain","scale",domainsTieBreaker):parseSingleChannelDomain(r,n,e,"x2");if("y"===t&&e.channelHasField("y2"))return e.channelHasField("y")?mergeValuesWithExplicit(parseSingleChannelDomain(r,n,e,"y"),parseSingleChannelDomain(r,n,e,"y2"),"domain","scale",domainsTieBreaker):parseSingleChannelDomain(r,n,e,"y2");return parseSingleChannelDomain(r,n,e,t)}(e,n),s=r[n];if(s.setWithExplicit("domains",o),isSelectionDomain(a)&&s.set("domainRaw",{signal:PC+util_hash(a)},!0),e.component.data.isFaceted){for(var u=e;!isFacetModel(u)&&u.parent;)u=u.parent;if("shared"===u.component.resolve.scale[n]){var l=!0,c=!1,f=void 0;try{for(var d,h=o.value[Symbol.iterator]();!(l=(d=h.next()).done);l=!0){var p=d.value;isDataRefDomain(p)&&(p.data=kT+p.data.replace(kT,""))}}catch(g){c=!0,f=g}finally{try{l||null==h.return||h.return()}finally{if(c)throw f}}}}}))}(e):function parseNonUnitScaleDomain(e){var t=!0,r=!1,n=void 0;try{for(var i,a=e.children[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){domain_parseScaleDomain(i.value)}}catch(s){r=!0,n=s}finally{try{t||null==a.return||a.return()}finally{if(r)throw n}}var o=e.component.scales;ak(o).forEach((function(t){var r,n=null,i=!0,a=!1,u=void 0;try{for(var l,c=e.children[Symbol.iterator]();!(i=(l=c.next()).done);i=!0){var f=l.value.component.scales[t];if(f){r=void 0===r?f.getWithExplicit("domains"):mergeValuesWithExplicit(r,f.getWithExplicit("domains"),"domains","scale",domainsTieBreaker);var d=f.get("domainRaw");n&&d&&n.signal!==d.signal&&log_warn("The same selection must be used to override scale domains in a layered view."),n=d}}}catch(s){a=!0,u=s}finally{try{i||null==c.return||c.return()}finally{if(a)throw u}}o[t].setWithExplicit("domains",r),n&&o[t].set("domainRaw",n,!0)}))}(e)}function parseSingleChannelDomain(e,t,r,n){var i=r.fieldDef(n);if(t&&"unaggregated"!==t&&!isSelectionDomain(t)){var a=i.type,o=i.timeUnit;return split_makeExplicit("temporal"===a||o?function mapDomainToDataSignal(e,t,r){return e.map((function(e){var n=valueExpr(e,{timeUnit:r,type:t});return{signal:"{data: ".concat(n,"}")}}))}(t,a,o):[t])}var s=r.stack;if(s&&n===s.fieldChannel){if("normalize"===s.offset)return makeImplicit([[0,1]]);var u=r.requestDataName(tC);return makeImplicit([{data:u,field:r.vgField(n,{suffix:"start"})},{data:u,field:r.vgField(n,{suffix:"end"})}])}var l=isScaleChannel(n)?function domainSort(e,t,r){if(!hasDiscreteDomain(r))return;var n=e.fieldDef(t),i=n.sort;if(isSortArray(i))return{op:"min",field:sortArrayIndexField(n,t),order:"ascending"};var a=null!==e.stack;if(isSortField(i))return normalizeSortField(i,a);if(function isSortByEncoding(e){return!!e&&!!e.encoding}(i)){var o=i.encoding,s=i.order,u=e.fieldDef(o),l=u.aggregate,c=u.field;return normalizeSortField({op:l,field:c,order:s},a)}if("descending"===i)return{op:"min",field:e.vgField(t),order:"descending"};if(util_contains(["ascending",void 0],i))return!0;return}(r,n,e):void 0;if("unaggregated"===t){var c=r.requestDataName(tC),f=i.field;return makeImplicit([{data:c,field:channeldef_vgField({field:f,aggregate:"min"})},{data:c,field:channeldef_vgField({field:f,aggregate:"max"})}])}if(isBinning(i.bin)){if(hasDiscreteDomain(e))return makeImplicit("bin-ordinal"===e?[]:[{data:util_isBoolean(l)?r.requestDataName(tC):r.requestDataName(rC),field:r.vgField(n,binRequiresRange(i,n)?{binSuffix:"range"}:{}),sort:!0!==l&&zw(l)?l:{field:r.vgField(n,{}),op:"min"}}]);var d=i.bin;if(isBinning(d)){var h=getBinSignalName(r,i.field,d);return makeImplicit([new ET((function(){var e=r.getSignalName(h);return"[".concat(e,".start, ").concat(e,".stop]")}))])}return makeImplicit([{data:r.requestDataName(tC),field:r.vgField(n,{})}])}return makeImplicit(l?[{data:util_isBoolean(l)?r.requestDataName(tC):r.requestDataName(rC),field:r.vgField(n),sort:l}]:[{data:r.requestDataName(tC),field:r.vgField(n)}])}function normalizeSortField(e,t){var r=e.op,n=e.field,i=e.order;return Object.assign({op:r||(t?"sum":pC)},n?{field:replacePathInField(n)}:{},i?{order:i}:{})}function canUseUnaggregatedDomain(e,t){var r=e.aggregate,n=e.type;return r?qw(r)&&!Ak[r]?{valid:!1,reason:LS.unaggregateDomainWithNonSharedDomainOp(r)}:"quantitative"===n&&"log"===t?{valid:!1,reason:LS.unaggregatedDomainWithLogScale(e)}:{valid:!0}:{valid:!1,reason:LS.unaggregateDomainHasNoEffectForRawField(e)}}function domainsTieBreaker(e,t,r,n){return e.explicit&&t.explicit&&log_warn(LS.mergeConflictingDomainProperty(r,n,e.value,t.value)),{explicit:e.explicit,value:[].concat(Object(Ra.a)(e.value),Object(Ra.a)(t.value))}}function getFieldFromDomain(e){if(isDataRefDomain(e)&&qw(e.field))return e.field;if(function isDataRefUnionedDomain(e){return!Uw(e)&&("fields"in e&&!("data"in e))}(e)){var t,r=!0,n=!1,i=void 0;try{for(var a,o=e.fields[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;if(isDataRefDomain(s)&&qw(s.field))if(t){if(t!==s.field)return log_warn("Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect."),t}else t=s.field}}catch(l){n=!0,i=l}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}return log_warn("Detected faceted independent scales that union domain of identical fields from different source detected. We will assume that this is the same field from a different fork of the same data source. However, if this is not case, the result view size maybe incorrect."),t}if(function isFieldRefUnionDomain(e){return!Uw(e)&&("fields"in e&&"data"in e)}(e)){log_warn("Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.");var u=e.fields[0];return qw(u)?u:void 0}}function assembleDomain(e,t){return function mergeDomains(e){var t=unique(e.map((function(e){if(isDataRefDomain(e)){e.sort;return __rest(e,["sort"])}return e})),util_hash),r=unique(e.map((function(e){if(isDataRefDomain(e)){var t=e.sort;return void 0===t||util_isBoolean(t)||("count"===t.op&&delete t.field,"ascending"===t.order&&delete t.order),t}})).filter((function(e){return void 0!==e})),util_hash);if(0!==t.length){if(1===t.length){var n=e[0];if(isDataRefDomain(n)&&r.length>0){var i=r[0];return r.length>1&&(log_warn(LS.MORE_THAN_ONE_SORT),i=!0),Object.assign({},n,{sort:i})}return n}var a,o=unique(r.map((function(e){return util_isBoolean(e)||"count"===e.op?e:(log_warn(LS.domainSortDropped(e)),!0)})),util_hash);1===o.length?a=o[0]:o.length>1&&(log_warn(LS.MORE_THAN_ONE_SORT),a=!0);var s=unique(e.map((function(e){return isDataRefDomain(e)?e.data:null})),(function(e){return e}));return 1===s.length&&null!==s[0]?Object.assign({data:s[0],fields:t.map((function(e){return e.field}))},a?{sort:a}:{}):Object.assign({fields:t},a?{sort:a}:{})}}(e.component.scales[t].get("domains").map((function(t){return isDataRefDomain(t)&&(t.data=e.lookupDataSource(t.data)),t})))}function assembleScales(e){return isLayerModel(e)||isConcatModel(e)||isRepeatModel(e)?e.children.reduce((function(e,t){return e.concat(assembleScales(t))}),assembleScalesForModel(e)):assembleScalesForModel(e)}function assembleScalesForModel(e){return ak(e.component.scales).reduce((function(t,r){var n=e.component.scales[r];if(n.merged)return t;var i=n.combine(),a=i.domainRaw,o=i.name,s=i.type,u=(i.domains,i.domainRaw,i.range,__rest(i,["name","type","domains","domainRaw","range"])),l=function assembleScaleRange(e,t,r){if(("x"===r||"y"===r)&&isVgRangeStep(e))return{step:{signal:t+"_step"}};return e}(i.range,o,r);a&&function isRawSelectionDomain(e){return e.signal.indexOf(PC)>=0}(a)&&(a=function assembleSelectionScaleDomain(e,t){var r=JSON.parse(t.signal.replace(PC,"")),n=varName(r.selection),i=r.encoding,a=r.field,o=e.component.selection&&e.component.selection[n];if(!o){if(o=e.getSelectionComponent(n,r.selection),i||a){if(i&&!a){var s=o.project.items.filter((function(e){return e.channel===i}));!s.length||s.length>1?(a=o.project.items[0].field,log_warn((s.length?"Multiple ":"No ")+"matching ".concat(stringValue_$(i)," encoding found for selection ").concat(stringValue_$(r.selection),". ")+'Using "field": '.concat(stringValue_$(a),"."))):a=s[0].field}}else a=o.project.items[0].field,o.project.items.length>1&&log_warn('A "field" or "encoding" must be specified when using a selection as a scale domain. '+'Using "field": '.concat(stringValue_$(a),"."));return{signal:accessPathWithDatum(a,n)}}return log_warn('Use "bind": "scales" to setup a binding for scales and selections within the same view.'),{signal:"null"}}(e,a));var c=assembleDomain(e,r);return t.push(Object.assign({name:o,type:s},c?{domain:c}:{},a?{domainRaw:a}:{},{range:l},u)),t}),[])}var CT=function(e){function ScaleComponent(e,t){var r;return Object(_d.a)(this,ScaleComponent),(r=Object(WE.a)(this,Object(GE.a)(ScaleComponent).call(this,{},{name:e}))).merged=!1,r.setWithExplicit("type",t),r}return Object(HE.a)(ScaleComponent,e),Object(bd.a)(ScaleComponent,[{key:"domainDefinitelyIncludesZero",value:function domainDefinitelyIncludesZero(){return!1!==this.get("zero")||some(this.get("domains"),(function(e){return Uw(e)&&2===e.length&&e[0]<=0&&e[1]>=0}))}}]),ScaleComponent}(VC),TT=["range","rangeStep","scheme"];function getSizeType(e){return"x"===e?"width":"y"===e?"height":void 0}function parseUnitScaleRange(e){var t=e.component.scales;bS.forEach((function(r){var n=t[r];if(n){var i=e.getScaleComponent(r),a=e.specifiedScales[r],o=e.fieldDef(r),s=getSizeType(r),u=s?!!e.component.layoutSize.get(s):void 0,l=i.get("type"),c=util_contains(["point","band"],l)||!!a.rangeStep;s&&e.fit&&!u&&c&&(log_warn(LS.CANNOT_FIX_RANGE_STEP_WITH_FIT),u=!0);var f=function getXYRangeStep(e){var t=[],r=!0,n=!1,i=void 0;try{for(var a,o=mS[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value,u=getRangeStep(e,s);void 0!==u&&t.push(u)}}catch(l){n=!0,i=l}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}return t}(e),d=function parseRangeForChannel(e,t,r,n,i,a,o,s,u,l,c){var f=u||null===i.rangeStep,d=!0,h=!1,p=void 0;try{for(var g,m=TT[Symbol.iterator]();!(d=(g=m.next()).done);d=!0){var v=g.value;if(void 0!==i[v]){var y=scaleTypeSupportProperty(r,v),_=channelScalePropertyIncompatability(e,v);if(y)if(_)log_warn(_);else switch(v){case"range":return split_makeExplicit(i[v]);case"scheme":return split_makeExplicit(parseScheme(i[v]));case"rangeStep":var b=i[v];if(null!==b){if(!u)return split_makeExplicit({step:b});log_warn(LS.rangeStepDropped(e))}}else log_warn(LS.scalePropertyNotWorkWithScaleType(r,v,e))}}}catch(x){h=!0,p=x}finally{try{d||null==m.return||m.return()}finally{if(h)throw p}}return makeImplicit(function defaultRange(e,t,r,n,i,a,o,s,u,l,c){switch(e){case jk:case Mk:if(util_contains(["point","band"],r)&&!l)if(e===jk&&"text"===o){if(i.scale.textXRangeStep)return{step:i.scale.textXRangeStep}}else if(i.scale.rangeStep)return{step:i.scale.rangeStep};return e===Mk&&hasContinuousDomain(r)?[ET.fromName(t,s),0]:[0,ET.fromName(t,s)];case Hk:var f=function sizeRangeMin(e,t,r){if(t)return 0;switch(e){case"bar":case"tick":return r.scale.minBandSize;case"line":case"trail":case"rule":return r.scale.minStrokeWidth;case"text":return r.scale.minFontSize;case"point":case"square":case"circle":return r.scale.minSize}throw new Error(LS.incompatibleChannel("size",e))}(o,a,i),d=function sizeRangeMax(e,t,r){var n=r.scale;switch(e){case"bar":case"tick":if(void 0!==r.scale.maxBandSize)return r.scale.maxBandSize;var i=minXYRangeStep(t,r.scale);return $w(i)?i-1:new ET((function(){return"".concat(i.signal," - 1")}));case"line":case"trail":case"rule":return r.scale.maxStrokeWidth;case"text":return r.scale.maxFontSize;case"point":case"square":case"circle":if(r.scale.maxSize)return r.scale.maxSize;var a=minXYRangeStep(t,n);return $w(a)?Math.pow(OT*a,2):new ET((function(){return"pow(".concat(OT," * ").concat(a.signal,", 2)")}))}throw new Error(LS.incompatibleChannel("size",e))}(o,u,i);return isContinuousToDiscrete(r)?function range_interpolateRange(e,t,r){var n=function f(){var n=isSignalRef(t)?t.signal:t,i="(".concat(n," - ").concat(e,") / (").concat(r," - 1)");return"sequence(".concat(e,", ").concat(t," + ").concat(i,", ").concat(i,")")};return isSignalRef(t)?new ET(n):{signal:n()}}(f,d,function defaultContinuousToDiscreteCount(e,t,r,n){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return void 0!==r&&Uw(r)?r.length+1:(log_warn(LS.domainRequiredForThresholdScale(n)),3)}}(r,i,c,e)):[f,d];case Xk:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case Gk:return"symbol";case zk:case qk:case Wk:return"ordinal"===r?"nominal"===n?"category":"ordinal":"rect"===o||"geoshape"===o?"heatmap":"ramp";case Vk:case Yk:case $k:return[i.scale.minOpacity,i.scale.maxOpacity]}throw new Error("Scale range undefined for channel ".concat(e))}(e,t,r,n,a,o,s,l,c,f,i.domain))}(r,e.getSignalName.bind(e),l,o.type,a,e.config,n.get("zero"),e.mark,u,e.getName(s),f);n.setWithExplicit("range",d)}}))}function getRangeStep(e,t){var r=e.getScaleComponent(t);if(r){var n=r.get("type"),i=e.fieldDef(t);if(hasDiscreteDomain(n)){var a=r&&r.get("range");if(a&&isVgRangeStep(a)&&$w(a.step))return a.step}else if(i&&i.bin&&isBinning(i.bin)){var o=getBinSignalName(e,i.field,i.bin),s=getSizeType(t),u=e.getName(s);return new ET((function(){var t=e.getSignalName(o),r="(".concat(t,".stop - ").concat(t,".start) / ").concat(t,".step");return"".concat(e.getSignalName(u)," / (").concat(r,")")}))}}}function parseScheme(e){return function isExtendedScheme(e){return e&&!!e.name}(e)?Object.assign({scheme:e.name},omit(e,["name"])):{scheme:e}}var OT=.95;function minXYRangeStep(e,t){if(e.length>0){var r=1/0,n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var u=o.value;isSignalRef(u)?r=void 0:void 0!==r&&u<r&&(r=u)}}catch(l){i=!0,a=l}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return void 0!==r?r:new ET((function(){var t=e.map((function(e){return isSignalRef(e)?e.signal:e}));return"min(".concat(t.join(", "),")")}))}return t.rangeStep?t.rangeStep:21}function parseScaleProperty(e,t){isUnitModel(e)?function parseUnitScaleProperty(e,t){var r=e.component.scales;ak(r).forEach((function(n){var i=e.specifiedScales[n],a=r[n],o=e.getScaleComponent(n),s=e.fieldDef(n),u=e.config,l=i[t],c=o.get("type"),f=scaleTypeSupportProperty(c,t),d=channelScalePropertyIncompatability(n,t);if(void 0!==l&&(f?d&&log_warn(d):log_warn(LS.scalePropertyNotWorkWithScaleType(c,t,n))),f&&void 0===d)if(void 0!==l)a.copyKeyFromObject(t,i);else{var h=function getDefaultValue(e,t,r,n,i,a,o,s,u,l){var c=l.scale,f=n.type,d=n.sort;switch(e){case"bins":return function properties_bins(e,t){var r=t.bin;if(isBinning(r)){var n=getBinSignalName(e,t.field,r);return new ET((function(){return e.getSignalName(n)}))}if(bin_isBinned(r)&&isBinParams(r)&&void 0!==r.step)return{step:r.step};return}(t,n);case"interpolate":return function properties_interpolate(e,t){if(util_contains([zk,qk,Wk],e)&&"nominal"!==t)return"hcl";return}(r,f);case"nice":return function properties_nice(e,t,r){if(r.bin||util_contains([vE.TIME,vE.UTC],e))return;return!!util_contains([jk,Mk],t)||void 0}(i,r,n);case"padding":return function properties_padding(e,t,r,n,i,a){if(util_contains([jk,Mk],e)){if(isContinuousToContinuous(t)){if(void 0!==r.continuousPadding)return r.continuousPadding;var o=i.type,s=i.orient;if("bar"===o&&!n.bin&&("vertical"===s&&"x"===e||"horizontal"===s&&"y"===e))return a.continuousBandSize}if(t===vE.POINT)return r.pointPadding}return}(r,i,c,n,u,l.bar);case"paddingInner":return function properties_paddingInner(e,t,r,n){if(void 0!==e)return;if(util_contains([jk,Mk],t)){var i=n.bandPaddingInner,a=n.barBandPaddingInner,o=n.rectBandPaddingInner;return getFirstDefined(i,"bar"===r?a:o)}return}(a,r,u.type,c);case"paddingOuter":return function properties_paddingOuter(e,t,r,n,i,a){if(void 0!==e)return;if(util_contains([jk,Mk],t)&&r===vE.BAND){var o=a.bandPaddingOuter,s=a.barBandPaddingOuter,u=a.rectBandPaddingOuter;return getFirstDefined(o,"bar"===n?s:u,i/2)}return}(a,r,i,u.type,o,c);case"reverse":return function properties_reverse(e,t){if(hasContinuousDomain(e)&&"descending"===t)return!0;return}(i,d);case"zero":return function properties_zero(e,t,r,n,i){if(r&&"unaggregated"!==r&&hasContinuousDomain(i)){if(Uw(r)){var a=r[0],o=r[r.length-1];if(a<=0&&o>=0)return!0}return!1}if("size"===e&&"quantitative"===t.type&&!isContinuousToDiscrete(i))return!0;if(!t.bin&&util_contains([jk,Mk],e)){var s=n.orient;return!util_contains(["bar","area","line","trail"],n.type)||!("horizontal"===s&&"y"===e||"vertical"===s&&"x"===e)}return!1}(r,n,s,u,i)}return c[e]}(t,e,n,s,o.get("type"),o.get("padding"),o.get("paddingInner"),i.domain,e.markDef,u);void 0!==h&&a.set(t,h,!1)}}))}(e,t):parseNonUnitScaleProperty(e,t)}function properties_parseScaleRange(e){isUnitModel(e)?parseUnitScaleRange(e):parseNonUnitScaleProperty(e,"range")}function parseNonUnitScaleProperty(e,t){var r=e.component.scales,n=!0,i=!1,a=void 0;try{for(var o,s=e.children[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var u=o.value;"range"===t?properties_parseScaleRange(u):parseScaleProperty(u,t)}}catch(l){i=!0,a=l}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}ak(r).forEach((function(n){var i,a=!0,o=!1,s=void 0;try{for(var u,c=e.children[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var f=u.value.component.scales[n];if(f)i=mergeValuesWithExplicit(i,f.getWithExplicit(t),t,"scale",tieBreakByComparing((function(e,r){switch(t){case"range":return e.step&&r.step?e.step-r.step:0}return 0})))}}catch(l){o=!0,s=l}finally{try{a||null==c.return||c.return()}finally{if(o)throw s}}r[n].setWithExplicit(t,i)}))}function type_scaleType(e,t,r,n){var i=function type_defaultType(e,t,r){switch(t.type){case"nominal":case"ordinal":if(isColorChannel(e)||"discrete"===rangeType(e))return"shape"===e&&"ordinal"===t.type&&log_warn(LS.discreteChannelCannotEncode(e,"ordinal")),"ordinal";if(util_contains(["x","y"],e)){if(util_contains(["rect","bar","rule"],r))return"band";if("bar"===r)return"band"}return"point";case"temporal":return isColorChannel(e)?"time":"discrete"===rangeType(e)?(log_warn(LS.discreteChannelCannotEncode(e,"temporal")),"ordinal"):"time";case"quantitative":return isColorChannel(e)?isBinning(t.bin)?"bin-ordinal":"linear":"discrete"===rangeType(e)?(log_warn(LS.discreteChannelCannotEncode(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(LS.invalidFieldType(t.type))}(t,r,n),a=e.type;return isScaleChannel(t)?void 0!==a?channelSupportScaleType(t,a)?scaleTypeSupportDataType(a,r.type)?a:(log_warn(LS.scaleTypeNotWorkWithFieldDef(a,i)),i):(log_warn(LS.scaleTypeNotWorkWithChannel(t,a,i)),i):i:null}function parseScaleCore(e){isUnitModel(e)?e.component.scales=function parseUnitScaleCore(e){var t=e.encoding,r=e.mark;return bS.reduce((function(n,i){var a,o,s=t[i];if(isFieldDef(s)&&r===yk&&i===Gk&&s.type===nE)return n;if(isFieldDef(s)?(a=s,o=s.scale):hasConditionalFieldDef(s)&&(a=s.condition,o=s.condition.scale),a&&null!==o&&!1!==o){var u=type_scaleType(o=o||{},i,a,r);n[i]=new CT(e.scaleName(i+"",!0),{value:u,explicit:o.type===u})}return n}),{})}(e):e.component.scales=function parseNonUnitScaleCore(e){var t=e.component.scales={},r={},n=e.component.resolve,i=!0,a=!1,o=void 0;try{for(var s,u=function _loop(){var t=s.value;parseScaleCore(t),ak(t.component.scales).forEach((function(i){if(n.scale[i]=n.scale[i]||function defaultScaleResolve(e,t){if(isLayerModel(t)||isFacetModel(t))return"shared";if(isConcatModel(t)||isRepeatModel(t))return util_contains(mS,e)?"independent":"shared";throw new Error("invalid model type for resolve")}(i,e),"shared"===n.scale[i]){var a=r[i],o=t.component.scales[i].getWithExplicit("type");a?!function scaleCompatible(e,t){var r=SE[e],n=SE[t];return r===n||"ordinal-position"===r&&"time"===n||"ordinal-position"===n&&"time"===r}(a.value,o.value)?(n.scale[i]="independent",delete r[i]):r[i]=mergeValuesWithExplicit(a,o,"type","scale",AT):r[i]=o}}))},l=e.children[Symbol.iterator]();!(i=(s=l.next()).done);i=!0)u()}catch(c){a=!0,o=c}finally{try{i||null==l.return||l.return()}finally{if(a)throw o}}return ak(r).forEach((function(n){var i=e.scaleName(n,!0),a=r[n];t[n]=new CT(i,a);var o=!0,s=!1,u=void 0;try{for(var l,f=e.children[Symbol.iterator]();!(o=(l=f.next()).done);o=!0){var d=l.value,h=d.component.scales[n];h&&(d.renameScale(h.get("name"),i),h.merged=!0)}}catch(c){s=!0,u=c}finally{try{o||null==f.return||f.return()}finally{if(s)throw u}}})),t}(e)}var AT=tieBreakByComparing((function(e,t){return scaleTypePrecedence(e)-scaleTypePrecedence(t)}));var RT=function(){function NameMap(){Object(_d.a)(this,NameMap),this.nameMap={}}return Object(bd.a)(NameMap,[{key:"rename",value:function rename(e,t){this.nameMap[e]=t}},{key:"has",value:function has(e){return void 0!==this.nameMap[e]}},{key:"get",value:function get(e){for(;this.nameMap[e]&&e!==this.nameMap[e];)e=this.nameMap[e];return e}}]),NameMap}();function isUnitModel(e){return e&&"unit"===e.type}function isFacetModel(e){return e&&"facet"===e.type}function isRepeatModel(e){return e&&"repeat"===e.type}function isConcatModel(e){return e&&"concat"===e.type}function isLayerModel(e){return e&&"layer"===e.type}var DT=function(){function Model(e,t,r,n,i,a,o,s){var u=this;Object(_d.a)(this,Model),this.type=t,this.parent=r,this.config=i,this.repeater=a,this.view=s,this.children=[],this.correctDataNames=function(e){return e.from&&e.from.data&&(e.from.data=u.lookupDataSource(e.from.data)),e.from&&e.from.facet&&e.from.facet.data&&(e.from.facet.data=u.lookupDataSource(e.from.facet.data)),e},this.parent=r,this.config=i,this.repeater=a,this.name=e.name||n,this.title=qw(e.title)?{text:e.title}:e.title,this.scaleNameMap=r?r.scaleNameMap:new RT,this.projectionNameMap=r?r.projectionNameMap:new RT,this.signalNameMap=r?r.signalNameMap:new RT,this.data=e.data,this.description=e.description,this.transforms=function normalizeTransform(e){return e.map((function(e){return isFilter(e)?{filter:normalizeLogicalOperand(e.filter,normalizePredicate)}:e}))}(e.transform||[]),this.layout=isUnitSpec(e)||isLayerSpec(e)?{}:function extractCompositionLayout(e,t,r){var n=r[t],i={},a=n.spacing,o=n.columns;void 0!==a&&(i.spacing=a),void 0!==o&&(isFacetSpec(e)&&!isFacetMapping(e.facet)||isRepeatSpec(e)&&Uw(e.repeat)||isConcatSpec(e))&&(i.columns=o);var s=!0,u=!1,l=void 0;try{for(var c,f=NE[Symbol.iterator]();!(s=(c=f.next()).done);s=!0){var d=c.value;if(void 0!==e[d])if("spacing"===d){var h=e[d];i[d]=$w(h)?h:{row:h.row||a,column:h.column||a}}else i[d]=e[d]}}catch(p){u=!0,l=p}finally{try{s||null==f.return||f.return()}finally{if(u)throw l}}return i}(e,t,i),this.component={data:{sources:r?r.component.data.sources:[],outputNodes:r?r.component.data.outputNodes:{},outputNodeRefCounts:r?r.component.data.outputNodeRefCounts:{},isFaceted:isFacetSpec(e)||r&&r.component.data.isFaceted&&void 0===e.data},layoutSize:new VC,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:Object.assign({scale:{},axis:{},legend:{}},o?nk(o):{}),selection:null,scales:null,projection:null,axes:{},legends:{}}}return Object(bd.a)(Model,[{key:"initSize",value:function initSize(e){var t=e.width,r=e.height;t&&this.component.layoutSize.set("width",t,!0),r&&this.component.layoutSize.set("height",r,!0)}},{key:"parse",value:function parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}},{key:"parseScale",value:function parseScale(){!function parseScales(e){parseScaleCore(e),domain_parseScaleDomain(e);var t=!0,r=!1,n=void 0;try{for(var i,a=FE[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){parseScaleProperty(e,i.value)}}catch(o){r=!0,n=o}finally{try{t||null==a.return||a.return()}finally{if(r)throw n}}properties_parseScaleRange(e)}(this)}},{key:"parseProjection",value:function parseProjection(){parse_parseProjection(this)}},{key:"renameTopLevelLayoutSizeSignal",value:function renameTopLevelLayoutSizeSignal(){"width"!==this.getName("width")&&this.renameSignal(this.getName("width"),"width"),"height"!==this.getName("height")&&this.renameSignal(this.getName("height"),"height")}},{key:"parseLegends",value:function parseLegends(){parseLegend(this)}},{key:"assembleGroupStyle",value:function assembleGroupStyle(){if("unit"===this.type||"layer"===this.type)return this.view&&this.view.style||"cell"}},{key:"assembleEncodeFromView",value:function assembleEncodeFromView(e){e.style;var t=__rest(e,["style"]),r={};for(var n in t)if(t.hasOwnProperty(n)){var i=t[n];void 0!==i&&(r[n]={value:i})}return r}},{key:"assembleGroupEncodeEntry",value:function assembleGroupEncodeEntry(e){var t=void 0;return this.view&&(t=this.assembleEncodeFromView(this.view)),e||"unit"!==this.type&&"layer"!==this.type?t:Object.assign({width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height")},t||{})}},{key:"assembleLayout",value:function assembleLayout(){if(this.layout){var e=this.layout,t=e.spacing,r=__rest(e,["spacing"]),n=this.component,i=this.config,a=function assembleLayoutTitleBand(e,t){var r={},n=!0,i=!1,a=void 0;try{for(var o,s=sS[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var u=o.value,l=e[u];if(l&&l.facetFieldDef){var c=getHeaderProperties(["titleAnchor","titleOrient"],l.facetFieldDef,t,u),f=c.titleAnchor,d=getHeaderChannel(u,c.titleOrient),h=getLayoutTitleBand(f,d);void 0!==h&&(r[d]=h)}}}catch(p){i=!0,a=p}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return ak(r).length>0?r:void 0}(n.layoutHeaders,i);return Object.assign({padding:t},this.assembleDefaultLayout(),r,a?{titleBand:a}:{})}}},{key:"assembleDefaultLayout",value:function assembleDefaultLayout(){return{}}},{key:"assembleHeaderMarks",value:function assembleHeaderMarks(){var e=this.component.layoutHeaders,t=[],r=!0,n=!1,i=void 0;try{for(var a,o=sS[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;e[s].title&&t.push(assembleTitleGroup(this,s))}}catch(p){n=!0,i=p}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}var u=!0,l=!1,c=void 0;try{for(var f,d=yC[Symbol.iterator]();!(u=(f=d.next()).done);u=!0){var h=f.value;t=t.concat(assembleHeaderGroups(this,h))}}catch(p){l=!0,c=p}finally{try{u||null==d.return||d.return()}finally{if(l)throw c}}return t}},{key:"assembleAxes",value:function assembleAxes(){return function assemble_assembleAxes(e,t){var r=e.x,n=void 0===r?[]:r,i=e.y,a=void 0===i?[]:i;return[].concat(Object(Ra.a)(n.map((function(e){return assembleAxis(e,"main",t)}))),Object(Ra.a)(n.map((function(e){return assembleAxis(e,"grid",t)}))),Object(Ra.a)(a.map((function(e){return assembleAxis(e,"main",t)}))),Object(Ra.a)(a.map((function(e){return assembleAxis(e,"grid",t)})))).filter((function(e){return e}))}(this.component.axes,this.config)}},{key:"assembleLegends",value:function assembleLegends(){return assemble_assembleLegends(this)}},{key:"assembleProjections",value:function assembleProjections(){return assemble_assembleProjections(this)}},{key:"assembleTitle",value:function assembleTitle(){var e=this.title||{},t=e.encoding,r=__rest(e,["encoding"]),n=Object.assign({},extractTitleConfig(this.config.title).nonMark,r,t?{encode:{update:t}}:{});if(n.text)return util_contains(["unit","layer"],this.type)?util_contains(["middle",void 0],n.anchor)&&(n.frame=n.frame||"group"):n.anchor=n.anchor||"start",ak(n).length>0?n:void 0}},{key:"assembleGroup",value:function assembleGroup(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t={};(e=e.concat(this.assembleSignals())).length>0&&(t.signals=e);var r=this.assembleLayout();r&&(t.layout=r),t.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());var n=!this.parent||isFacetModel(this.parent)?assembleScales(this):[];n.length>0&&(t.scales=n);var i=this.assembleAxes();i.length>0&&(t.axes=i);var a=this.assembleLegends();return a.length>0&&(t.legends=a),t}},{key:"hasDescendantWithFieldOnChannel",value:function hasDescendantWithFieldOnChannel(e){var t=!0,r=!1,n=void 0;try{for(var i,a=this.children[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var o=i.value;if(isUnitModel(o)){if(o.channelHasField(e))return!0}else if(o.hasDescendantWithFieldOnChannel(e))return!0}}catch(s){r=!0,n=s}finally{try{t||null==a.return||a.return()}finally{if(r)throw n}}return!1}},{key:"getName",value:function getName(e){return varName((this.name?this.name+"_":"")+e)}},{key:"requestDataName",value:function requestDataName(e){var t=this.getName(e),r=this.component.data.outputNodeRefCounts;return r[t]=(r[t]||0)+1,t}},{key:"getSizeSignalRef",value:function getSizeSignalRef(e){if(isFacetModel(this.parent)){var t="width"===e?"x":"y",r=this.component.scales[t];if(r&&!r.merged){var n=r.get("type"),i=r.get("range");if(hasDiscreteDomain(n)&&isVgRangeStep(i)){var a=r.get("name"),o=getFieldFromDomain(assembleDomain(this,t));return o?{signal:sizeExpr(a,r,channeldef_vgField({aggregate:"distinct",field:o},{expr:"datum"}))}:(log_warn("Unknown field for ${channel}. Cannot calculate view size."),null)}}}return{signal:this.signalNameMap.get(this.getName(e))}}},{key:"lookupDataSource",value:function lookupDataSource(e){var t=this.component.data.outputNodes[e];return t?t.getSource():e}},{key:"getSignalName",value:function getSignalName(e){return this.signalNameMap.get(e)}},{key:"renameSignal",value:function renameSignal(e,t){this.signalNameMap.rename(e,t)}},{key:"renameScale",value:function renameScale(e,t){this.scaleNameMap.rename(e,t)}},{key:"renameProjection",value:function renameProjection(e,t){this.projectionNameMap.rename(e,t)}},{key:"scaleName",value:function scaleName(e,t){return t?this.getName(e):isChannel(e)&&isScaleChannel(e)&&this.component.scales[e]||this.scaleNameMap.has(this.getName(e))?this.scaleNameMap.get(this.getName(e)):void 0}},{key:"projectionName",value:function projectionName(e){return e?this.getName("projection"):this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection"))?this.projectionNameMap.get(this.getName("projection")):void 0}},{key:"getScaleComponent",value:function getScaleComponent(e){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");var t=this.component.scales[e];return t&&!t.merged?t:this.parent?this.parent.getScaleComponent(e):void 0}},{key:"getSelectionComponent",value:function getSelectionComponent(e,t){var r=this.component.selection[e];if(!r&&this.parent&&(r=this.parent.getSelectionComponent(e,t)),!r)throw new Error(LS.selectionNotFound(t));return r}},{key:"width",get:function get(){return this.getSizeSignalRef("width")}},{key:"height",get:function get(){return this.getSizeSignalRef("height")}}]),Model}(),PT=function(e){function ModelWithField(){return Object(_d.a)(this,ModelWithField),Object(WE.a)(this,Object(GE.a)(ModelWithField).apply(this,arguments))}return Object(HE.a)(ModelWithField,e),Object(bd.a)(ModelWithField,[{key:"vgField",value:function vgField(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.fieldDef(e);if(r)return channeldef_vgField(r,t)}},{key:"reduceFieldDef",value:function reduceFieldDef(e,t,r){return encoding_reduce(this.getMapping(),(function(t,r,n){var i=getFieldDef(r);return i?e(t,i,n):t}),t,r)}},{key:"forEachFieldDef",value:function forEachFieldDef(e,t){forEach(this.getMapping(),(function(t,r){var n=getFieldDef(t);n&&e(n,r)}),t)}}]),ModelWithField}(DT),jT=function(e){function FilterInvalidNode(e,t){var r;return Object(_d.a)(this,FilterInvalidNode),(r=Object(WE.a)(this,Object(GE.a)(FilterInvalidNode).call(this,e))).filter=t,r}return Object(HE.a)(FilterInvalidNode,e),Object(bd.a)(FilterInvalidNode,[{key:"clone",value:function clone(){return new FilterInvalidNode(null,Object.assign({},this.filter))}},{key:"dependentFields",value:function dependentFields(){return new Set(ak(this.filter))}},{key:"assemble",value:function assemble(){var e=this,t=ak(this.filter).reduce((function(t,r){var n=e.filter[r],i=channeldef_vgField(n,{expr:"datum"});return null!==n&&(t.push("".concat(i," !== null")),t.push("!isNaN(".concat(i,")"))),t}),[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}}],[{key:"make",value:function make(e,t){var r=t.config,n=t.mark;if("filter"!==r.invalidValues)return null;var i=t.reduceFieldDef((function(e,r,i){var a=isScaleChannel(i)&&t.getScaleComponent(i);a&&(!hasContinuousDomain(a.get("type"))||r.aggregate||isPathMark(n)||(e[r.field]=r));return e}),{});return ak(i).length?new FilterInvalidNode(e,i):null}}]),FilterInvalidNode}(gC),MT=function(e){function FlattenTransformNode(e,t){var r;Object(_d.a)(this,FlattenTransformNode),(r=Object(WE.a)(this,Object(GE.a)(FlattenTransformNode).call(this,e))).transform=t,r.transform=nk(t);var n=r.transform,i=n.flatten,a=n.as,o=void 0===a?[]:a;return r.transform.as=i.map((function(e,t){return o[t]||e})),r}return Object(HE.a)(FlattenTransformNode,e),Object(bd.a)(FlattenTransformNode,[{key:"clone",value:function clone(){return new FlattenTransformNode(this.parent,nk(this.transform))}},{key:"producedFields",value:function producedFields(){return new Set(this.transform.as)}},{key:"hash",value:function hash(){return"FlattenTransform ".concat(util_hash(this.transform))}},{key:"assemble",value:function assemble(){var e=this.transform;return{type:"flatten",fields:e.flatten,as:e.as}}}]),FlattenTransformNode}(gC),FT=function(e){function FoldTransformNode(e,t){var r;Object(_d.a)(this,FoldTransformNode),(r=Object(WE.a)(this,Object(GE.a)(FoldTransformNode).call(this,e))).transform=t,r.transform=nk(t);var n=r.transform.as||[void 0,void 0];return r.transform.as=[n[0]||"key",n[1]||"value"],r}return Object(HE.a)(FoldTransformNode,e),Object(bd.a)(FoldTransformNode,[{key:"clone",value:function clone(){return new FoldTransformNode(null,nk(this.transform))}},{key:"producedFields",value:function producedFields(){return new Set(this.transform.as)}},{key:"hash",value:function hash(){return"FoldTransform ".concat(util_hash(this.transform))}},{key:"assemble",value:function assemble(){var e=this.transform;return{type:"fold",fields:e.fold,as:e.as}}}]),FoldTransformNode}(gC),IT=function(e){function GeoJSONNode(e,t,r,n){var i;return Object(_d.a)(this,GeoJSONNode),(i=Object(WE.a)(this,Object(GE.a)(GeoJSONNode).call(this,e))).fields=t,i.geojson=r,i.signal=n,i}return Object(HE.a)(GeoJSONNode,e),Object(bd.a)(GeoJSONNode,[{key:"clone",value:function clone(){return new GeoJSONNode(null,nk(this.fields),this.geojson,this.signal)}},{key:"assemble",value:function assemble(){return Object.assign({type:"geojson"},this.fields?{fields:this.fields}:{},this.geojson?{geojson:this.geojson}:{},{signal:this.signal})}}],[{key:"parseAll",value:function parseAll(e,t){if(t.component.projection&&!t.component.projection.isFit)return e;var r=0;if([[Nk,Lk],[Uk,Bk]].forEach((function(n){var i=n.map((function(e){return t.channelHasField(e)?t.fieldDef(e).field:isValueDef(t.encoding[e])?{expr:t.encoding[e].value+""}:void 0}));(i[0]||i[1])&&(e=new GeoJSONNode(e,i,null,t.getName("geojson_".concat(r++))))})),t.channelHasField(Gk)){var n=t.fieldDef(Gk);n.type===nE&&(e=new GeoJSONNode(e,null,n.field,t.getName("geojson_".concat(r++))))}return e}}]),GeoJSONNode}(gC),LT=function(e){function GeoPointNode(e,t,r,n){var i;return Object(_d.a)(this,GeoPointNode),(i=Object(WE.a)(this,Object(GE.a)(GeoPointNode).call(this,e))).projection=t,i.fields=r,i.as=n,i}return Object(HE.a)(GeoPointNode,e),Object(bd.a)(GeoPointNode,[{key:"clone",value:function clone(){return new GeoPointNode(null,this.projection,nk(this.fields),nk(this.as))}},{key:"assemble",value:function assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}],[{key:"parseAll",value:function parseAll(e,t){return t.projectionName()?([[Nk,Lk],[Uk,Bk]].forEach((function(r){var n=r.map((function(e){return t.channelHasField(e)?t.fieldDef(e).field:isValueDef(t.encoding[e])?{expr:t.encoding[e].value+""}:void 0})),i=r[0]===Uk?"2":"";(n[0]||n[1])&&(e=new GeoPointNode(e,t.projectionName(),n,[t.getName("x"+i),t.getName("y"+i)]))})),e):e}}]),GeoPointNode}(gC),NT=function(e){function IdentifierNode(e){return Object(_d.a)(this,IdentifierNode),Object(WE.a)(this,Object(GE.a)(IdentifierNode).call(this,e))}return Object(HE.a)(IdentifierNode,e),Object(bd.a)(IdentifierNode,[{key:"clone",value:function clone(){return new IdentifierNode(null)}}]),Object(bd.a)(IdentifierNode,[{key:"producedFields",value:function producedFields(){return new Set([IE])}},{key:"hash",value:function hash(){return"Identifier"}},{key:"assemble",value:function assemble(){return{type:"identifier",as:IE}}}]),IdentifierNode}(gC),BT=function(e){function ImputeNode(e,t){var r;return Object(_d.a)(this,ImputeNode),(r=Object(WE.a)(this,Object(GE.a)(ImputeNode).call(this,e))).transform=t,r}return Object(HE.a)(ImputeNode,e),Object(bd.a)(ImputeNode,[{key:"clone",value:function clone(){return new ImputeNode(null,nk(this.transform))}},{key:"producedFields",value:function producedFields(){return new Set([this.transform.impute])}},{key:"processSequence",value:function processSequence(e){var t=e.start,r=void 0===t?0:t,n=e.stop,i=e.step,a=[r,n].concat(Object(Ra.a)(i?[i]:[])).join(",");return{signal:"sequence(".concat(a,")")}}},{key:"hash",value:function hash(){return"Impute ".concat(util_hash(this.transform))}},{key:"assemble",value:function assemble(){var e,t,r=this.transform,n=r.impute,i=r.key,a=r.keyvals,o=r.method,s=r.groupby,u=r.value,l=r.frame,c=void 0===l?[null,null]:l,f=Object.assign({type:"impute",field:n,key:i},a?{keyvals:(e=a,e&&void 0!==e.stop?this.processSequence(a):a)}:{},{method:"value"},s?{groupby:s}:{},{value:null});o&&"value"!==o?t=[Object.assign({type:"window",as:["imputed_".concat(n,"_value")],ops:[o],fields:[n],frame:c,ignorePeers:!1},s?{groupby:s}:{}),{type:"formula",expr:"datum.".concat(n," === null ? datum.imputed_").concat(n,"_value : datum.").concat(n),as:n}]:t=[{type:"formula",expr:"datum.".concat(n," === null ? ").concat(u," : datum.").concat(n),as:n}];return[f].concat(Object(Ra.a)(t))}}],[{key:"makeFromTransform",value:function makeFromTransform(e,t){return new ImputeNode(e,t)}},{key:"makeFromEncoding",value:function makeFromEncoding(e,t){var r=t.encoding,n=r.x,i=r.y;if(isFieldDef(n)&&isFieldDef(i)){var a=n.impute?n:i.impute?i:void 0;if(void 0===a)return;var o=n.impute?i:i.impute?n:void 0,s=a.impute,u=s.method,l=s.value,c=s.frame,f=s.keyvals,d=pathGroupingFields(t.mark,r);return new ImputeNode(e,Object.assign({impute:a.field,key:o.field},u?{method:u}:{},void 0!==l?{value:l}:{},c?{frame:c}:{},void 0!==f?{keyvals:f}:{},d.length?{groupby:d}:{}))}return null}}]),ImputeNode}(gC),UT=function(e){function AncestorParse(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Object(_d.a)(this,AncestorParse),(e=Object(WE.a)(this,Object(GE.a)(AncestorParse).call(this,t,r))).explicit=t,e.implicit=r,e.parseNothing=n,e}return Object(HE.a)(AncestorParse,e),Object(bd.a)(AncestorParse,[{key:"clone",value:function clone(){var clone=get_get(Object(GE.a)(AncestorParse.prototype),"clone",this).call(this);return clone.parseNothing=this.parseNothing,clone}}]),AncestorParse}(VC),zT=function(e){function LookupNode(e,t,r){var n;return Object(_d.a)(this,LookupNode),(n=Object(WE.a)(this,Object(GE.a)(LookupNode).call(this,e))).transform=t,n.secondary=r,n}return Object(HE.a)(LookupNode,e),Object(bd.a)(LookupNode,[{key:"clone",value:function clone(){return new LookupNode(null,nk(this.transform),this.secondary)}},{key:"producedFields",value:function producedFields(){return new Set(this.transform.from.fields||(this.transform.as instanceof Array?this.transform.as:[this.transform.as]))}},{key:"hash",value:function hash(){return"Lookup ".concat(util_hash({transform:this.transform,secondary:this.secondary}))}},{key:"assemble",value:function assemble(){var e;if(this.transform.from.fields)e=Object.assign({values:this.transform.from.fields},this.transform.as?{as:this.transform.as instanceof Array?this.transform.as:[this.transform.as]}:{});else{var t=this.transform.as;qw(t)||(log_warn(LS.NO_FIELDS_NEEDS_AS),t="_lookup"),e={as:[t]}}return Object.assign({type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup]},e,this.transform.default?{default:this.transform.default}:{})}}],[{key:"make",value:function make(e,t,r,n){var i=t.component.data.sources,a=findSource(r.from.data,i);a||(a=new eT(r.from.data),i.push(a));var o=t.getName("lookup_".concat(n)),s=new mC(a,o,"lookup",t.component.data.outputNodeRefCounts);return t.component.data.outputNodes[o]=s,new LookupNode(e,r,s.getSource())}}]),LookupNode}(gC),qT=function(e){function SampleTransformNode(e,t){var r;return Object(_d.a)(this,SampleTransformNode),(r=Object(WE.a)(this,Object(GE.a)(SampleTransformNode).call(this,e))).transform=t,r}return Object(HE.a)(SampleTransformNode,e),Object(bd.a)(SampleTransformNode,[{key:"clone",value:function clone(){return new SampleTransformNode(null,nk(this.transform))}},{key:"hash",value:function hash(){return"SampleTransform ".concat(util_hash(this.transform))}},{key:"assemble",value:function assemble(){return{type:"sample",size:this.transform.sample}}}]),SampleTransformNode}(gC);function makeWalkTree(e){var t=0;return function walkTree(r,n){var i,a,o;r instanceof eT&&(r.isGenerator||isUrlData(r.data)||(e.push(n),n={name:null,source:n.name,transform:[]}));r instanceof lT&&(r.parent instanceof eT&&!n.source?(n.format=Object.assign({},n.format||{},{parse:r.assembleFormatParse()}),(i=n.transform).push.apply(i,Object(Ra.a)(r.assembleTransforms(!0)))):(a=n.transform).push.apply(a,Object(Ra.a)(r.assembleTransforms())));if(r instanceof sT)return n.name||(n.name="data_".concat(t++)),!n.source||n.transform.length>0?(e.push(n),r.data=n.name):r.data=n.source,void r.assemble().forEach((function(t){return e.push(t)}));(r instanceof tT||r instanceof rT||r instanceof jT||r instanceof uT||r instanceof vC||r instanceof LT||r instanceof IT||r instanceof oT||r instanceof zT||r instanceof dT||r instanceof cT||r instanceof FT||r instanceof MT||r instanceof NT||r instanceof qT)&&n.transform.push(r.assemble()),(r instanceof ZC||r instanceof xC||r instanceof BT||r instanceof fT)&&(o=n.transform).push.apply(o,Object(Ra.a)(r.assemble()));if(r instanceof mC)if(n.source&&0===n.transform.length)r.setSource(n.source);else if(r.parent instanceof mC)r.setSource(n.name);else{if(n.name||(n.name="data_".concat(t++)),r.setSource(n.name),1===r.numChildren())e.push(n),n={name:null,source:n.name,transform:[]}}switch(r.numChildren()){case 0:r instanceof mC&&(!n.source||n.transform.length>0)&&e.push(n);break;case 1:walkTree(r.children[0],n);break;default:n.name||(n.name="data_".concat(t++));var s=n.name;!n.source||n.transform.length>0?e.push(n):s=n.source,r.children.forEach((function(e){walkTree(e,{name:null,source:s,transform:[]})}))}}}function parseFacetHeader(e,t){if(e.channelHasField(t)){var r=e.facet[t],n=getHeaderProperty("title",null,e.config,t),i=channeldef_title(r,e.config,{allowDisabling:!0,includeDefault:void 0===n||!!n});e.child.component.layoutHeaders[t].title&&(i+=" / "+e.child.component.layoutHeaders[t].title,e.child.component.layoutHeaders[t].title=null);var a=getHeaderProperty("labelOrient",r,e.config,t),o=getFirstDefined((r.header||{}).labels,!0),s=util_contains(["bottom","right"],a)?"footer":"header";e.component.layoutHeaders[t]=Object(po.a)({title:i,facetFieldDef:r},s,"facet"===t?[]:[makeHeaderComponent(e,t,o)])}}function makeHeaderComponent(e,t,r){var n="row"===t?"height":"width";return{labels:r,sizeSignal:e.child.component.layoutSize.get(n)?e.child.getSizeSignalRef(n):void 0,axes:[]}}function mergeChildAxis(e,t){var r,n=e.child;if(n.component.axes[t]){var i=e.component,a=i.layoutHeaders,o=i.resolve;if(o.axis[t]=parseGuideResolve(o,t),"shared"===o.axis[t]){var s="x"===t?"column":"row",u=a[s],l=!0,c=!1,f=void 0;try{for(var d,h=n.component.axes[t][Symbol.iterator]();!(l=(d=h.next()).done);l=!0){var p=d.value,g="top"===(r=p.get("orient"))||"left"===r?"header":"footer";u[g]=u[g]||[makeHeaderComponent(e,s,!1)];var m=assembleAxis(p,"main",e.config,{header:!0});u[g][0].axes.push(m),p.mainExtracted=!0}}catch(v){c=!0,f=v}finally{try{l||null==h.return||h.return()}finally{if(c)throw f}}}}}function parseLayerLayoutSize(e){parseChildrenLayoutSize(e);var t=e.component.layoutSize;t.setWithExplicit("width",parseNonUnitLayoutSizeForChannel(e,"width")),t.setWithExplicit("height",parseNonUnitLayoutSizeForChannel(e,"height"))}var WT=parseLayerLayoutSize,GT={vconcat:"width",hconcat:"height"};function parseChildrenLayoutSize(e){var t=!0,r=!1,n=void 0;try{for(var i,a=e.children[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){i.value.parseLayoutSize()}}catch(o){r=!0,n=o}finally{try{t||null==a.return||a.return()}finally{if(r)throw n}}}function parseNonUnitLayoutSizeForChannel(e,t){var r,n="width"===t?"x":"y",i=e.component.resolve,a=!0,o=!1,s=void 0;try{for(var u,l=e.children[Symbol.iterator]();!(a=(u=l.next()).done);a=!0){var c=u.value.component.layoutSize.getWithExplicit(t),f=i.scale[n];if("independent"===f&&"range-step"===c.value){r=void 0;break}if(r){if("independent"===f&&r.value!==c.value){r=void 0;break}r=mergeValuesWithExplicit(r,c,t,"")}else r=c}}catch(y){o=!0,s=y}finally{try{a||null==l.return||l.return()}finally{if(o)throw s}}if(r){var d=!0,h=!1,p=void 0;try{for(var g,m=e.children[Symbol.iterator]();!(d=(g=m.next()).done);d=!0){var v=g.value;e.renameSignal(v.getName(t),e.getName(t)),v.component.layoutSize.set(t,"merged",!1)}}catch(y){h=!0,p=y}finally{try{d||null==m.return||m.return()}finally{if(h)throw p}}return r}return{explicit:!1,value:void 0}}function defaultUnitSize(e,t){var r="width"===t?"x":"y",n=e.config,i=e.getScaleComponent(r);if(i){var a=i.get("type"),o=i.get("range");return hasDiscreteDomain(a)&&isVgRangeStep(o)?"range-step":n.view[t]}return e.hasProjection?n.view[t]:"width"===t&&"text"===e.mark?n.scale.textXRangeStep:n.scale.rangeStep||PE.rangeStep}function replaceRepeat(e,t){return function isRepeatRef(e){return e&&!qw(e)&&"repeat"in e}(e.field)?e.field.repeat in t?Object.assign({},e,{field:t[e.field.repeat]}):void log_warn(LS.noSuchRepeatedValue(e.field.repeat)):e}function replaceRepeaterInFieldDef(e,t){if(void 0!==(e=replaceRepeat(e,t))){if(null===e)return null;if(function isSortableFieldDef(e){return isTypedFieldDef(e)&&!!e.sort}(e)&&isSortField(e.sort)){var r=replaceRepeat(e.sort,t);e=Object.assign({},e,r?{sort:r}:{})}return e}}function replaceRepeaterInChannelDef(e,t){if(!isFieldDef(e)){if(hasConditionalFieldDef(e)){var r=replaceRepeaterInFieldDef(e.condition,t);if(r)return Object.assign({},e,{condition:r});e.condition;return __rest(e,["condition"])}return e}var n=replaceRepeaterInFieldDef(e,t);return n||(isConditionalDef(e)?{condition:e.condition}:void 0)}function replaceRepeater(e,t){var r={};for(var n in e)if(e.hasOwnProperty(n)){var i=e[n];if(Uw(i))r[n]=i.map((function(e){return replaceRepeaterInChannelDef(e,t)})).filter((function(e){return e}));else{var a=replaceRepeaterInChannelDef(i,t);void 0!==a&&(r[n]=a)}}return r}function facetSortFieldName(e,t,r){return channeldef_vgField(t,Object.assign({suffix:"by_".concat(channeldef_vgField(e))},r||{}))}var HT=function(e){function FacetModel(e,t,r,n,i){var a;Object(_d.a)(this,FacetModel),(a=Object(WE.a)(this,Object(GE.a)(FacetModel).call(this,e,"facet",t,r,i,n,e.resolve))).child=buildModel(e.spec,Object(eC.a)(a),a.getName("child"),void 0,n,i,!1),a.children=[a.child];var o=function replaceRepeaterInFacet(e,t){return isFacetMapping(e)?replaceRepeater(e,t):replaceRepeaterInFieldDef(e,t)}(e.facet,n);return a.facet=a.initFacet(o),a}return Object(HE.a)(FacetModel,e),Object(bd.a)(FacetModel,[{key:"initFacet",value:function initFacet(e){return isFacetMapping(e)?encoding_reduce(e,(function(e,t,r){return util_contains([Rk,Dk],r)?void 0===t.field?(log_warn(LS.emptyFieldDef(t,r)),e):(e[r]=channeldef_normalize(t,r),e):(log_warn(LS.incompatibleChannel(r,"facet")),e)}),{}):{facet:channeldef_normalize(e,"facet")}}},{key:"channelHasField",value:function channelHasField(e){return!!this.facet[e]}},{key:"fieldDef",value:function fieldDef(e){return this.facet[e]}},{key:"parseData",value:function parseData(){this.component.data=parse_parseData(this),this.child.parseData()}},{key:"parseLayoutSize",value:function parseLayoutSize(){parseChildrenLayoutSize(this)}},{key:"parseSelections",value:function parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}},{key:"parseMarkGroup",value:function parseMarkGroup(){this.child.parseMarkGroup()}},{key:"parseAxesAndHeaders",value:function parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),function parseFacetHeaders(e){var t=!0,r=!1,n=void 0;try{for(var i,a=sS[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){parseFacetHeader(e,i.value)}}catch(o){r=!0,n=o}finally{try{t||null==a.return||a.return()}finally{if(r)throw n}}mergeChildAxis(e,"x"),mergeChildAxis(e,"y")}(this)}},{key:"assembleSelectionTopLevelSignals",value:function assembleSelectionTopLevelSignals(e){return this.child.assembleSelectionTopLevelSignals(e)}},{key:"assembleSignals",value:function assembleSignals(){return this.child.assembleSignals(),[]}},{key:"assembleSelectionData",value:function assembleSelectionData(e){return this.child.assembleSelectionData(e)}},{key:"getHeaderLayoutMixins",value:function getHeaderLayoutMixins(){var e={},t=!0,r=!1,n=void 0;try{for(var i,a=sS[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var o=i.value,s=!0,u=!1,l=void 0;try{for(var c,f=_C[Symbol.iterator]();!(s=(c=f.next()).done);s=!0){var d=c.value,h=this.component.layoutHeaders[o],p=h[d],g=h.facetFieldDef;if(g){var m=getHeaderProperty("titleOrient",g,this.config,o);if(util_contains(["right","bottom"],m)){var v=getHeaderChannel(o,m);e.titleAnchor=e.titleAnchor||{},e.titleAnchor[v]="end"}}if(p&&p[0]){var y="row"===o?"height":"width",_="header"===d?"headerBand":"footerBand";"facet"===o||this.child.component.layoutSize.get(y)||(e[_]=e[_]||{},e[_][o]=.5),h.title&&(e.offset=e.offset||{},e.offset["row"===o?"rowTitle":"columnTitle"]=10)}}}catch(b){u=!0,l=b}finally{try{s||null==f.return||f.return()}finally{if(u)throw l}}}}catch(b){r=!0,n=b}finally{try{t||null==a.return||a.return()}finally{if(r)throw n}}return e}},{key:"assembleDefaultLayout",value:function assembleDefaultLayout(){var e=this.facet,t=e.column,r=e.row,n=t?this.columnDistinctSignal():r?1:void 0,i="all";return(r||"independent"!==this.component.resolve.scale.x)&&(t||"independent"!==this.component.resolve.scale.y)||(i="none"),Object.assign({},this.getHeaderLayoutMixins(),n?{columns:n}:{},{bounds:"full",align:i})}},{key:"assembleLayoutSignals",value:function assembleLayoutSignals(){return this.child.assembleLayoutSignals()}},{key:"columnDistinctSignal",value:function columnDistinctSignal(){if(!(this.parent&&this.parent instanceof FacetModel)){var e=this.getName("column_domain");return{signal:"length(data('".concat(e,"'))")}}}},{key:"assembleGroup",value:function assembleGroup(e){return this.parent&&this.parent instanceof FacetModel?Object.assign({},this.channelHasField("column")?{encode:{update:{columns:{field:channeldef_vgField(this.facet.column,{prefix:"distinct"})}}}}:{},get_get(Object(GE.a)(FacetModel.prototype),"assembleGroup",this).call(this,e)):get_get(Object(GE.a)(FacetModel.prototype),"assembleGroup",this).call(this,e)}},{key:"getCardinalityAggregateForChild",value:function getCardinalityAggregateForChild(){var e=[],t=[],r=[];if(this.child instanceof FacetModel){if(this.child.channelHasField("column")){var n=channeldef_vgField(this.child.facet.column);e.push(n),t.push("distinct"),r.push("distinct_".concat(n))}}else for(var i=0,a=["x","y"];i<a.length;i++){var o=a[i],s=this.child.component.scales[o];if(s&&!s.merged){var u=s.get("type"),l=s.get("range");if(hasDiscreteDomain(u)&&isVgRangeStep(l)){var c=getFieldFromDomain(assembleDomain(this.child,o));c?(e.push(c),t.push("distinct"),r.push("distinct_".concat(c))):log_warn("Unknown field for ${channel}. Cannot calculate view size.")}}}return{fields:e,ops:t,as:r}}},{key:"assembleFacet",value:function assembleFacet(){var e=this.component.data.facetRoot,t=e.name,r=e.data,n=this.facet,i=n.row,a=n.column,o=this.getCardinalityAggregateForChild(),s=o.fields,u=o.ops,l=o.as,c=[],f=!0,d=!1,h=void 0;try{for(var p,g=sS[Symbol.iterator]();!(f=(p=g.next()).done);f=!0){var m=p.value,v=this.facet[m];if(v){c.push(channeldef_vgField(v));var y=v.bin,_=v.sort;if(isBinning(y)&&c.push(channeldef_vgField(v,{binSuffix:"end"})),isSortField(_)){var b=_.field,x=_.op,w=void 0===x?pC:x,k=facetSortFieldName(v,_);i&&a?(s.push(k),u.push("max"),l.push(k)):(s.push(b),u.push(w),l.push(k))}else if(Uw(_)){var S=sortArrayIndexField(v,m);s.push(S),u.push("max"),l.push(S)}}}}catch(C){d=!0,h=C}finally{try{f||null==g.return||g.return()}finally{if(d)throw h}}var E=!!i&&!!a;return Object.assign({name:t,data:r,groupby:c},E||s.length?{aggregate:Object.assign({},E?{cross:E}:{},s.length?{fields:s,ops:u,as:l}:{})}:{})}},{key:"facetSortFields",value:function facetSortFields(e){var t=this.facet[e];return t?isSortField(t.sort)?[facetSortFieldName(t,t.sort,{expr:"datum"})]:Uw(t.sort)?[sortArrayIndexField(t,e,{expr:"datum"})]:[channeldef_vgField(t,{expr:"datum"})]:[]}},{key:"facetSortOrder",value:function facetSortOrder(e){var t=this.facet[e];if(t){var r=t.sort;return[(isSortField(r)?r.order:!Uw(r)&&r)||"ascending"]}return[]}},{key:"assembleLabelTitle",value:function assembleLabelTitle(){var e=this.facet,t=this.config;if(e.facet)return assemble_assembleLabelTitle(e.facet,"facet",t);var r={row:["top","bottom"],column:["left","right"]},n=!0,i=!1,a=void 0;try{for(var o,s=yC[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var u=o.value;if(e[u]){var l=getHeaderProperty("labelOrient",e[u],t,u);if(util_contains(r[u],l))return assemble_assembleLabelTitle(e[u],u,t)}}}catch(c){i=!0,a=c}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}}},{key:"assembleMarks",value:function assembleMarks(){var e=this,t=this.child,r=function assembleFacetData(e){var t=[],r=makeWalkTree(t);return e.children.forEach((function(t){return r(t,{source:e.name,name:null,transform:[]})})),t}(this.component.data.facetRoot),n=t.assembleGroupEncodeEntry(!1),i=this.assembleLabelTitle()||t.assembleTitle(),a=t.assembleGroupStyle();return[Object.assign({name:this.getName("cell"),type:"group"},i?{title:i}:{},a?{style:a}:{},{from:{facet:this.assembleFacet()},sort:{field:util_flatten(sS.map((function(t){return e.facetSortFields(t)}))),order:util_flatten(sS.map((function(t){return e.facetSortOrder(t)})))}},r.length>0?{data:r}:{},n?{encode:{update:n}}:{},t.assembleGroup(function assembleFacetSignals(e,t){if(e.component.selection&&ak(e.component.selection).length){var r=stringValue_$(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:xb("mousemove","scope"),update:"isTuple(facet) ? facet : group(".concat(r,").datum")}]})}return t}(this,[])))]}},{key:"getMapping",value:function getMapping(){return this.facet}}]),FacetModel}(PT);function findSource(e,t){var r=!0,n=!1,i=void 0;try{for(var a,o=t[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value,u=s.data;if((!e.name||!s.hasName()||e.name===s.dataName)&&!(e.format&&e.format.mesh&&u.format&&u.format.feature))if(isInlineData(e)&&isInlineData(u)){if(rk(e.values,u.values))return s}else if(isUrlData(e)&&isUrlData(u)){if(e.url===u.url)return s}else if(isNamedData(e)&&e.name===s.dataName)return s}}catch(l){n=!0,i=l}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}return null}function parse_parseData(e){var t=function parseRoot(e,t){if(void 0===e.data&&e.parent)return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main;if(null===e.data){var r=new eT([]);return t.push(r),r}var n=findSource(e.data,t);if(n)return isGenerator(e.data)||(n.data.format=mergeDeep({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;var i=new eT(e.data);return t.push(i),i}(e,e.component.data.sources),r=e.component.data,n=r.outputNodes,i=r.outputNodeRefCounts,a=e.parent?e.parent.component.data.ancestorParse.clone():new UT,o=e.data;isGenerator(o)?(isSequenceGenerator(o)?t=new rT(t,o.sequence):isGraticuleGenerator(o)&&(t=new tT(t,o.graticule)),a.parseNothing=!0):o&&o.format&&null===o.format.parse&&(a.parseNothing=!0),t=lT.makeExplicit(t,e,a)||t,!requiresSelectionId(e)||!isUnitModel(e)&&!isLayerModel(e)||e.parent&&isLayerModel(e.parent)||(t=new NT(t));var s=e.parent&&isLayerModel(e.parent);(isUnitModel(e)||isFacetModel(e))&&s&&(t=ZC.makeFromEncoding(t,e)||t),e.transforms.length>0&&(t=function parseTransformArray(e,t,r){var n=0,i=!0,a=!1,o=void 0;try{for(var s,u=t.transforms[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var l=s.value,c=void 0,f=void 0;if(isCalculate(l))f=e=new vC(e,l),c="derived";else if(isFilter(l))f=e=lT.makeImplicitFromFilterTransform(e,l,r)||e,e=new uT(e,t,l.filter);else if(isBin(l))f=e=ZC.makeFromTransform(e,l,t),c="number";else if(transform_isTimeUnit(l)){c="date",void 0===r.getWithExplicit(l.field).value&&(e=new lT(e,Object(po.a)({},l.field,c)),r.set(l.field,c,!1)),f=e=xC.makeFromTransform(e,l)}else if(transform_isAggregate(l))f=e=oT.makeFromTransform(e,l),c="number",requiresSelectionId(t)&&(e=new NT(e));else if(isLookup(l))f=e=zT.make(e,t,l,n++),c="derived";else if(isWindow(l))f=e=new dT(e,l),c="number";else if(isJoinAggregate(l))f=e=new cT(e,l),c="number";else if(isStack(l))f=e=fT.makeFromTransform(e,l),c="derived";else if(isFold(l))f=e=new FT(e,l),c="derived";else if(isFlatten(l))f=e=new MT(e,l),c="derived";else if(isSample(l))e=new qT(e,l);else{if(!isImpute(l)){log_warn(LS.invalidTransformIgnored(l));continue}f=e=BT.makeFromTransform(e,l),c="derived"}if(f&&void 0!==c){var d=!0,h=!1,p=void 0;try{for(var g,m=f.producedFields()[Symbol.iterator]();!(d=(g=m.next()).done);d=!0){var v=g.value;r.set(v,c,!1)}}catch(y){h=!0,p=y}finally{try{d||null==m.return||m.return()}finally{if(h)throw p}}}}}catch(y){a=!0,o=y}finally{try{i||null==u.return||u.return()}finally{if(a)throw o}}return e}(t,e,a)),t=lT.makeImplicitFromEncoding(t,e,a)||t,isUnitModel(e)&&(t=IT.parseAll(t,e),t=LT.parseAll(t,e)),(isUnitModel(e)||isFacetModel(e))&&(s||(t=ZC.makeFromEncoding(t,e)||t),t=xC.makeFromEncoding(t,e)||t,t=vC.parseAllForSortIndex(t,e));var u=e.getName(rC),l=new mC(t,u,rC,i);if(n[u]=l,t=l,isUnitModel(e)){var c=oT.makeFromEncoding(t,e);c&&(t=c,requiresSelectionId(e)&&(t=new NT(t))),t=BT.makeFromEncoding(t,e)||t,t=fT.makeFromEncoding(t,e)||t}isUnitModel(e)&&(t=jT.make(t,e)||t);var f=e.getName(tC),d=new mC(t,f,tC,i);n[f]=d,t=d;var h=null;if(isFacetModel(e)){var p=e.getName("facet");t=function makeJoinAggregateFromFacet(e,t){var r=t.row,n=t.column;if(r&&n){for(var i=null,a=0,o=[r,n];a<o.length;a++){var s=o[a];if(isSortField(s.sort)){var u=s.sort,l=u.field,c=u.op;e=i=new cT(e,{joinaggregate:[{op:void 0===c?pC:c,field:l,as:facetSortFieldName(s,s.sort,{forAs:!0})}],groupby:[channeldef_vgField(s)]})}}return i}return null}(t=vC.parseAllForSortIndex(t,e),e.facet)||t,h=new sT(t,e,p,d.getSource()),n[p]=h,t=h}return Object.assign({},e.component.data,{outputNodes:n,outputNodeRefCounts:i,raw:l,main:d,facetRoot:h,ancestorParse:a})}var VT=function(e){function BaseConcatModel(e,t,r,n,i,a,o){return Object(_d.a)(this,BaseConcatModel),Object(WE.a)(this,Object(GE.a)(BaseConcatModel).call(this,e,t,r,n,i,a,o))}return Object(HE.a)(BaseConcatModel,e),Object(bd.a)(BaseConcatModel,[{key:"parseData",value:function parseData(){this.component.data=parse_parseData(this),this.children.forEach((function(e){e.parseData()}))}},{key:"parseSelections",value:function parseSelections(){var e=this;this.component.selection={};var t=!0,r=!1,n=void 0;try{for(var i,a=function _loop(){var t=i.value;t.parseSelections(),ak(t.component.selection).forEach((function(r){e.component.selection[r]=t.component.selection[r]}))},o=this.children[Symbol.iterator]();!(t=(i=o.next()).done);t=!0)a()}catch(s){r=!0,n=s}finally{try{t||null==o.return||o.return()}finally{if(r)throw n}}}},{key:"parseMarkGroup",value:function parseMarkGroup(){var e=!0,t=!1,r=void 0;try{for(var n,i=this.children[Symbol.iterator]();!(e=(n=i.next()).done);e=!0){n.value.parseMarkGroup()}}catch(a){t=!0,r=a}finally{try{e||null==i.return||i.return()}finally{if(t)throw r}}}},{key:"parseAxesAndHeaders",value:function parseAxesAndHeaders(){var e=!0,t=!1,r=void 0;try{for(var n,i=this.children[Symbol.iterator]();!(e=(n=i.next()).done);e=!0){n.value.parseAxesAndHeaders()}}catch(a){t=!0,r=a}finally{try{e||null==i.return||i.return()}finally{if(t)throw r}}}},{key:"assembleSelectionTopLevelSignals",value:function assembleSelectionTopLevelSignals(e){return this.children.reduce((function(e,t){return t.assembleSelectionTopLevelSignals(e)}),e)}},{key:"assembleSignals",value:function assembleSignals(){return this.children.forEach((function(e){return e.assembleSignals()})),[]}},{key:"assembleLayoutSignals",value:function assembleLayoutSignals(){return this.children.reduce((function(e,t){return[].concat(Object(Ra.a)(e),Object(Ra.a)(t.assembleLayoutSignals()))}),assemble_assembleLayoutSignals(this))}},{key:"assembleSelectionData",value:function assembleSelectionData(e){return this.children.reduce((function(e,t){return t.assembleSelectionData(e)}),e)}},{key:"assembleMarks",value:function assembleMarks(){return this.children.map((function(e){var t=e.assembleTitle(),r=e.assembleGroupStyle(),n=e.assembleGroupEncodeEntry(!1);return Object.assign({type:"group",name:e.getName("group")},t?{title:t}:{},r?{style:r}:{},n?{encode:{update:n}}:{},e.assembleGroup())}))}}]),BaseConcatModel}(DT),YT=function(e){function ConcatModel(e,t,r,n,i){var a;return Object(_d.a)(this,ConcatModel),a=Object(WE.a)(this,Object(GE.a)(ConcatModel).call(this,e,"concat",t,r,i,n,e.resolve)),e.resolve&&e.resolve.axis&&("shared"===e.resolve.axis.x||"shared"===e.resolve.axis.y)&&log_warn(LS.CONCAT_CANNOT_SHARE_AXIS),a.concatType=isVConcatSpec(e)?"vconcat":isHConcatSpec(e)?"hconcat":"concat",a.children=a.getChildren(e).map((function(e,t){return buildModel(e,Object(eC.a)(a),a.getName("concat_"+t),void 0,n,i,!1)})),a}return Object(HE.a)(ConcatModel,e),Object(bd.a)(ConcatModel,[{key:"getChildren",value:function getChildren(e){return isVConcatSpec(e)?e.vconcat:isHConcatSpec(e)?e.hconcat:e.concat}},{key:"parseLayoutSize",value:function parseLayoutSize(){!function parseConcatLayoutSize(e){parseChildrenLayoutSize(e);var t=e.component.layoutSize,r=GT[e.concatType];r&&t.setWithExplicit(r,parseNonUnitLayoutSizeForChannel(e,r))}(this)}},{key:"parseAxisGroup",value:function parseAxisGroup(){return null}},{key:"assembleDefaultLayout",value:function assembleDefaultLayout(){return Object.assign({},"vconcat"===this.concatType?{columns:1}:{},{bounds:"full",align:"each"})}}]),ConcatModel}(VT);var $T=function(e){function AxisComponent(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Object(_d.a)(this,AxisComponent),(e=Object(WE.a)(this,Object(GE.a)(AxisComponent).call(this))).explicit=t,e.implicit=r,e.mainExtracted=n,e}return Object(HE.a)(AxisComponent,e),Object(bd.a)(AxisComponent,[{key:"clone",value:function clone(){return new AxisComponent(nk(this.explicit),nk(this.implicit),this.mainExtracted)}},{key:"hasAxisPart",value:function hasAxisPart(e){return"axis"===e||("grid"===e||"title"===e?!!this.get(e):!function isFalseOrNull(e){return!1===e||null===e}(this.get(e)))}}]),AxisComponent}(VC);var XT={bottom:"top",top:"bottom",left:"right",right:"left"};function mergeAxisComponents(e,t){if(!e)return t.map((function(e){return e.clone()}));if(e.length===t.length){for(var r=e.length,n=0;n<r;n++){var i=e[n],a=t[n];if(!!i!==!!a)return;if(i&&a){var o=i.getWithExplicit("orient"),s=a.getWithExplicit("orient");if(o.explicit&&s.explicit&&o.value!==s.value)return;e[n]=mergeAxisComponent(i,a)}}return e}}function mergeAxisComponent(e,t){var r=!0,n=!1,i=void 0;try{for(var a,o=function _loop(){var r=a.value,n=mergeValuesWithExplicit(e.getWithExplicit(r),t.getWithExplicit(r),r,"axis",(function(e,t){switch(r){case"title":return mergeTitleComponent(e,t);case"gridScale":return{explicit:e.explicit,value:getFirstDefined(e.value,t.value)}}return defaultTieBreaker(e,t,r,"axis")}));e.setWithExplicit(r,n)},s=lC[Symbol.iterator]();!(r=(a=s.next()).done);r=!0)o()}catch(u){n=!0,i=u}finally{try{r||null==s.return||s.return()}finally{if(n)throw i}}return e}function getFieldDefTitle(e,t){var r="x"===t?"x2":"y2",n=e.fieldDef(t),i=e.fieldDef(r),a=n?n.title:void 0,o=i?i.title:void 0;return a&&o?mergeTitle(a,o):a||(o||(void 0!==a?a:void 0!==o?o:void 0))}function parseAxis(e,t){var r=t.axis(e),n=new $T;lC.forEach((function(i){var a=function parse_getProperty(e,t,r,n){var i=n.fieldDef(r),a=function properties_labelAngle(e,t,r,n){if(void 0!==t.labelAngle)return normalizeAngle(t.labelAngle);var i=getAxisConfig("labelAngle",e.config,r,properties_orient(r),e.getScaleComponent(r).get("type"));return void 0!==i?normalizeAngle(i):r===jk&&util_contains([rE,eE],n.type)?270:void 0}(n,t,r,i),o=getFirstDefined(t.orient,properties_orient(r));switch(e){case"scale":return n.scaleName(r);case"gridScale":return function gridScale(e,t){var r="x"===t?"y":"x";if(e.getScaleComponent(r))return e.scaleName(r)}(n,r);case"format":if(isTimeFormatFieldDef(i))return;return numberFormat(i,t.format,n.config);case"formatType":if(isTimeFormatFieldDef(i))return;return t.formatType;case"grid":if(bin_isBinned(n.fieldDef(r).bin))return!1;var s=n.getScaleComponent(r).get("type");return getFirstDefined(t.grid,function defaultGrid(e,t){return!hasDiscreteDomain(e)&&!isBinning(t.bin)}(s,i));case"labelAlign":return getFirstDefined(t.labelAlign,defaultLabelAlign(a,o));case"labelAngle":return a;case"labelBaseline":return getFirstDefined(t.labelBaseline,defaultLabelBaseline(a,o));case"labelFlush":return getFirstDefined(t.labelFlush,function defaultLabelFlush(e,t){if("x"===t&&util_contains(["quantitative","temporal"],e.type))return!0}(i,r));case"labelOverlap":var u=n.getScaleComponent(r).get("type");return getFirstDefined(t.labelOverlap,function defaultLabelOverlap(e,t){if("nominal"!==e.type)return"log"!==t||"greedy"}(i,u));case"orient":return o;case"tickCount":var l=n.getScaleComponent(r).get("type"),c="x"===r?"width":"y"===r?"height":void 0,f=c?n.getSizeSignalRef(c):void 0;return getFirstDefined(t.tickCount,function defaultTickCount(e){var t=e.fieldDef,r=e.scaleType,n=e.size;if(!hasDiscreteDomain(r)&&"log"!==r&&!util_contains(["month","hours","day","quarter"],t.timeUnit))return isBinning(t.bin)?{signal:"ceil(".concat(n.signal,"/10)")}:{signal:"ceil(".concat(n.signal,"/40)")}}({fieldDef:i,scaleType:l,size:f}));case"title":var d="x"===r?"x2":"y2",h=n.fieldDef(d);return getFirstDefined(t.title,getFieldDefTitle(n,r),mergeTitleFieldDefs([toFieldDefBase(i)],h?[toFieldDefBase(h)]:[]));case"values":return function properties_values(e,t,r){var n=e.values;if(n)return valueArray(r,n)}(t,0,i)}return function isAxisProperty(e){return!!sC[e]}(e)?t[e]:void 0}(i,r,e,t);if(void 0!==a){var o=function parse_isExplicit(e,t,r,n,i){switch(t){case"titleAngle":case"labelAngle":return e===normalizeAngle(r[t]);case"values":return!!r.values;case"encode":return!!r.encoding||!!r.labelAngle;case"title":if(e===getFieldDefTitle(n,i))return!0}return e===r[t]}(a,i,r,t,e),s=getAxisConfig(i,t.config,e,n.get("orient"),t.getScaleComponent(e).get("type"));o||void 0===s?n.set(i,a,o):util_contains(["grid","orient"],i)&&s&&n.set(i,s,!1)}}));var i=r.encoding||{},a=iC.reduce((function(r,a){if(!n.hasAxisPart(a))return r;var o=guideEncodeEntry(i[a]||{},t),s="labels"===a?function axis_encode_labels(e,t,r){var n=e.fieldDef(t)||("x"===t?e.fieldDef("x2"):"y"===t?e.fieldDef("y2"):void 0),i=e.axis(t),a=e.config,o={};if(isTimeFormatFieldDef(n)){var s=e.getScaleComponent(t).get("type")===vE.UTC,u=timeFormatExpression("datum.value",n.timeUnit,i.format,a.axis.shortTimeLabels,null,s);u&&(o.text={signal:u})}return o=Object.assign({},o,r),0===ak(o).length?void 0:o}(t,e,o):o;return void 0!==s&&ak(s).length>0&&(r[a]={update:s}),r}),{});return ak(a).length>0&&n.set("encode",a,!!r.encoding||void 0!==r.labelAngle),n}function normalizeMarkDef(e,t,r){var n=isMarkDef(e)?Object.assign({},e):{type:e},i=n.orient||getMarkConfig("orient",n,r);return n.orient=function init_orient(e,t,r){switch(e){case ck:case mk:case vk:case hk:case fk:return}var n=t.x,i=t.y,a=t.x2,o=t.y2;switch(e){case uk:if(isFieldDef(n)&&bin_isBinned(n.bin))return"vertical";if(isFieldDef(i)&&bin_isBinned(i.bin))return"horizontal";if(o||a){if(r)return r;if(!a&&isFieldDef(n)&&n.type===ZS&&!isBinning(n.bin))return"horizontal";if(!o&&isFieldDef(i)&&i.type===ZS&&!isBinning(i.bin))return"vertical"}case dk:if(a&&o)return;case sk:if(o)return isFieldDef(i)&&bin_isBinned(i.bin)?"horizontal":"vertical";if(a)return isFieldDef(n)&&bin_isBinned(n.bin)?"vertical":"horizontal";if(e===dk){if(t.x&&!t.y)return"vertical";if(t.y&&!t.x)return"horizontal"}case lk:case pk:var s=isFieldDef(t.x)&&channeldef_isContinuous(t.x),u=isFieldDef(t.y)&&channeldef_isContinuous(t.y);if(s&&!u)return"tick"!==e?"horizontal":"vertical";if(!s&&u)return"tick"!==e?"vertical":"horizontal";if(s&&u){var l=t.x,c=t.y,f=l.type===tE,d=c.type===tE;return f&&!d?"tick"!==e?"vertical":"horizontal":!f&&d?"tick"!==e?"horizontal":"vertical":!l.aggregate&&c.aggregate?"tick"!==e?"vertical":"horizontal":l.aggregate&&!c.aggregate?"tick"!==e?"horizontal":"vertical":r||"vertical"}return r||void 0}return"vertical"}(n.type,t,i),void 0!==i&&i!==n.orient&&log_warn(LS.orientOverridden(n.orient,i)),void 0===getFirstDefined(n.opacity,getMarkConfig("opacity",n,r))&&(n.opacity=function init_opacity(e,t){if(util_contains([ck,pk,mk,vk],e)&&!encoding_isAggregate(t))return.7;return}(n.type,t)),void 0===n.filled&&(n.filled=function init_filled(e,t){var r=getMarkConfig("filled",e,t),n=e.type;return getFirstDefined(r,n!==ck&&n!==lk&&n!==dk)}(n,r)),void 0===(n.cursor||getMarkConfig("cursor",n,r))&&(n.cursor=function init_cursor(e,t,r){if(t.href||e.href||getMarkConfig("href",e,r))return"pointer";return e.cursor}(n,t,r)),n}function rectPosition(e,t,r){var n=e.config,i=e.encoding,a=e.markDef,o="x"===t?"x2":"y2",s="x"===t?"width":"height",u=i[t],l=i[o],c=e.getScaleComponent(t),f=c?c.get("type"):void 0,d=e.scaleName(t),h=a.orient,p=i[s]||i.size||a[s]||a.size||getMarkConfig("size",a,n,{vgChannel:s}),g="x"===t?"vertical"===h:"horizontal"===h;return!isFieldDef(u)||!isBinning(u.bin)&&!bin_isBinned(u.bin)||p||hasDiscreteDomain(f)?(isFieldDef(u)&&hasDiscreteDomain(f)||g)&&!l?isFieldDef(u)&&f===vE.BAND?function bandPosition(e,t,r,n){var i,a=r.scaleName(t),o="x"===t?"width":"height";if(r.encoding.size||void 0!==r.markDef.size||n&&void 0!==n.value)if(r.markDef.orient){var s=Object(po.a)({},t+"c",valueref_fieldRef(e,a,{},{band:.5}));if(getTypedFieldDef(r.encoding.size))return Object.assign({},s,nonPosition("size",r,{vgChannel:o}));if(isValueDef(r.encoding.size))return Object.assign({},s,nonPosition("size",r,{vgChannel:o}));if(void 0!==r.markDef.size)return Object.assign({},s,Object(po.a)({},o,{value:r.markDef.size}));if(n&&void 0!==n.value)return Object.assign({},s,Object(po.a)({},o,n))}else log_warn(LS.cannotApplySizeToNonOrientedMark(r.markDef.type));return i={},Object(po.a)(i,t,valueref_fieldRef(e,a,{binSuffix:"range"},{})),Object(po.a)(i,o,n||bandRef(a)),i}(u,t,e,rect_defaultSizeRef(r,a,s,d,c,n)):function centeredPointPositionWithSize(e,t,r,n){var i="x"===e?"xc":"yc",a="x"===e?"width":"height";return Object.assign({},pointPosition(e,t,r,i),nonPosition("size",t,{defaultRef:n,vgChannel:a}))}(t,e,valueref_mid(e[s]),rect_defaultSizeRef(r,a,s,d,c,n)):Object.assign({},pointPosition(t,e,"zeroOrMax"),pointPosition2(e,"zeroOrMin",o)):function binPosition(e){var t,r,n=e.fieldDef,i=e.fieldDef2,a=e.channel,o=e.scaleName,s=e.mark,u=e.spacing,l=void 0===u?0:u,c=e.reverse,f={x:c?l:0,x2:c?0:l,y:c?0:l,y2:c?l:0},d=a===jk?Fk:Ik;return isBinning(n.bin)?(t={},Object(po.a)(t,d,valueref_bin({channel:a,fieldDef:n,scaleName:o,mark:s,side:"start",offset:f["".concat(a,"2")]})),Object(po.a)(t,a,valueref_bin({channel:a,fieldDef:n,scaleName:o,mark:s,side:"end",offset:f[a]})),t):bin_isBinned(n.bin)&&isFieldDef(i)?(r={},Object(po.a)(r,d,valueref_fieldRef(n,o,{},{offset:f["".concat(a,"2")]})),Object(po.a)(r,a,valueref_fieldRef(i,o,{},{offset:f[a]})),r):void log_warn(LS.channelRequiredForBinned(d))}({fieldDef:u,fieldDef2:l,channel:t,mark:r,scaleName:d,spacing:getFirstDefined(a.binSpacing,n[r].binSpacing),reverse:c.get("reverse")})}function rect_defaultSizeRef(e,t,r,n,i,a){var o=getFirstDefined(t[r],t.size,getMarkConfig("size",t,a,{vgChannel:r}));if(void 0!==o)return{value:o};if(i){var s=i.get("type");if("point"!==s&&"band"!==s)return{value:a[e].continuousBandSize};if(void 0!==a[e].discreteBandSize)return{value:a[e].discreteBandSize};if(s!==vE.POINT)return bandRef(n);var u=i.get("range");if(isVgRangeStep(u)&&$w(u.step))return{value:u.step-1};log_warn(LS.BAR_WITH_POINT_SCALE_AND_RANGESTEP_NULL)}return{value:getFirstDefined(a[e].discreteBandSize,a.scale.rangeStep?a.scale.rangeStep-1:void 0,20)}}function _encodeEntry(e,t){e.config;var r=e.width,n=e.height;return Object.assign({},baseEncodeEntry(e,{size:"include",orient:"ignore"}),pointPosition("x",e,valueref_mid(r)),pointPosition("y",e,valueref_mid(n)),nonPosition("size",e),function shapeMixins(e,t,r){if(r)return{shape:{value:r}};return nonPosition("shape",e)}(e,0,t))}function defaultSize(e){var t=e.config,r=e.markDef,n=r.orient,i="horizontal"===n?"width":"height",a=e.getScaleComponent("horizontal"===n?"x":"y"),o=getFirstDefined(r[i],r.size,getMarkConfig("size",r,t,{vgChannel:i}),t.tick.bandSize);if(void 0!==o)return o;var s=a?a.get("range"):void 0,u=s&&isVgRangeStep(s)?s.step:t.scale.rangeStep;if("number"!==typeof u)throw new Error("Function does not handle non-numeric rangeStep");return 3*u/4}var KT={area:{vgMark:"area",encodeEntry:function encodeEntry(e){return Object.assign({},baseEncodeEntry(e,{size:"ignore",orient:"include"}),pointPosition("x",e,"zeroOrMin"),pointPosition("y",e,"zeroOrMin"),pointPosition2(e,"zeroOrMin","horizontal"===e.markDef.orient?"x2":"y2"),mixins_defined(e))}},bar:{vgMark:"rect",encodeEntry:function encodeEntry(e){return Object.assign({},baseEncodeEntry(e,{size:"ignore",orient:"ignore"}),rectPosition(e,"x","bar"),rectPosition(e,"y","bar"))}},circle:{vgMark:"symbol",encodeEntry:function encodeEntry(e){return _encodeEntry(e,"circle")}},geoshape:{vgMark:"shape",encodeEntry:function encodeEntry(e){return Object.assign({},baseEncodeEntry(e,{size:"ignore",orient:"ignore"}))},postEncodingTransform:function postEncodingTransform(e){var t=e.encoding.shape;return[Object.assign({type:"geoshape",projection:e.projectionName()},t&&isFieldDef(t)&&t.type===nE?{field:channeldef_vgField(t,{expr:"datum"})}:{})]}},line:{vgMark:"line",encodeEntry:function encodeEntry(e){var t=e.width,r=e.height;return Object.assign({},baseEncodeEntry(e,{size:"ignore",orient:"ignore"}),pointPosition("x",e,valueref_mid(t)),pointPosition("y",e,valueref_mid(r)),nonPosition("size",e,{vgChannel:"strokeWidth"}),mixins_defined(e))}},point:{vgMark:"symbol",encodeEntry:function encodeEntry(e){return _encodeEntry(e)}},rect:{vgMark:"rect",encodeEntry:function encodeEntry(e){return Object.assign({},baseEncodeEntry(e,{size:"ignore",orient:"ignore"}),rectPosition(e,"x","rect"),rectPosition(e,"y","rect"))}},rule:{vgMark:"rule",encodeEntry:function encodeEntry(e){var t=e.markDef,r=e.width,n=e.height,i=t.orient;return e.encoding.x||e.encoding.y||e.encoding.latitude||e.encoding.longitude?Object.assign({},baseEncodeEntry(e,{size:"ignore",orient:"ignore"}),pointPosition("x",e,"horizontal"===i?"zeroOrMin":valueref_mid(r)),pointPosition("y",e,"vertical"===i?"zeroOrMin":valueref_mid(n)),"vertical"!==i?pointPosition2(e,"zeroOrMax","x2"):{},"horizontal"!==i?pointPosition2(e,"zeroOrMax","y2"):{},nonPosition("size",e,{vgChannel:"strokeWidth"})):{}}},square:{vgMark:"symbol",encodeEntry:function encodeEntry(e){return _encodeEntry(e,"square")}},text:{vgMark:"text",encodeEntry:function encodeEntry(e){var t=e.config,r=(e.encoding,e.width),n=e.height;return Object.assign({},baseEncodeEntry(e,{size:"ignore",orient:"ignore"}),pointPosition("x",e,valueref_mid(r)),pointPosition("y",e,valueref_mid(n)),mixins_text(e),nonPosition("size",e,{vgChannel:"fontSize"}),valueIfDefined("align",function text_align(e,t,r){if(void 0===(e.align||getMarkConfig("align",e,r)))return"center";return}(e.markDef,0,t)),valueIfDefined("baseline",function text_baseline(e,t,r){if(void 0===(e.baseline||getMarkConfig("baseline",e,r)))return"middle";return}(e.markDef,0,t)))}},tick:{vgMark:"rect",encodeEntry:function encodeEntry(e){var t=e.config,r=e.markDef,n=e.width,i=e.height,a=r.orient,o="horizontal"===a?"width":"height",s="horizontal"===a?"height":"width";return Object.assign({},baseEncodeEntry(e,{size:"ignore",orient:"ignore"}),pointPosition("x",e,valueref_mid(n),"xc"),pointPosition("y",e,valueref_mid(i),"yc"),nonPosition("size",e,{defaultValue:defaultSize(e),vgChannel:o}),Object(po.a)({},s,{value:getFirstDefined(r.thickness,t.tick.thickness)}))}},trail:{vgMark:"trail",encodeEntry:function encodeEntry(e){var t=e.width,r=e.height;return Object.assign({},baseEncodeEntry(e,{size:"include",orient:"ignore"}),pointPosition("x",e,valueref_mid(t)),pointPosition("y",e,valueref_mid(r)),nonPosition("size",e),mixins_defined(e))}}};function parseMarkGroups(e){return util_contains([lk,sk,gk],e.mark)?function parsePathMark(e){var t=pathGroupingFields(e.mark,e.encoding),r=getMarkGroups(e,{fromPrefix:t.length>0?JT:""});return t.length>0?[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:JT+e.requestDataName(tC),data:e.requestDataName(tC),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:r}]:r}(e):getMarkGroups(e)}var JT="faceted_path_";function getMarkGroups(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{fromPrefix:""},r=e.mark,n=getFirstDefined(e.markDef.clip,function scaleClip(e){var t=e.getScaleComponent("x"),r=e.getScaleComponent("y");return!!(t&&t.get("domainRaw")||r&&r.get("domainRaw"))||void 0}(e),function projectionClip(e){var t=e.component.projection;return!(!t||t.isFit)||void 0}(e)),i=getStyles(e.markDef),a=e.encoding.key,o=function mark_getSort(e){var t=e.encoding,r=e.stack,n=e.mark,i=e.markDef,a=e.config,o=t.order;if(!(!Uw(o)&&isValueDef(o)&&isNullOrFalse(o.value)||!o&&isNullOrFalse(i.order)||isNullOrFalse(getMarkConfig("order",i,a)))){if((Uw(o)||isFieldDef(o))&&!r)return sortParams(o,{expr:"datum"});if(isPathMark(n)){var s="horizontal"===i.orient?"y":"x",u=t[s];if(isFieldDef(u)){var l=u.sort;return Uw(l)?{field:channeldef_vgField(u,{prefix:s,suffix:"sort_index",expr:"datum"})}:isSortField(l)?{field:channeldef_vgField({aggregate:encoding_isAggregate(e.encoding)?l.op:void 0,field:l.field},{expr:"datum"})}:{field:channeldef_vgField(u,{binSuffix:e.stack&&e.stack.impute?"mid":void 0,expr:"datum"})}}}else;}}(e),s=KT[r].postEncodingTransform?KT[r].postEncodingTransform(e):null;return[Object.assign({name:e.getName("marks"),type:KT[r].vgMark},n?{clip:!0}:{},i?{style:i}:{},a?{key:{field:a.field}}:{},o?{sort:o}:{},{from:{data:t.fromPrefix+e.requestDataName(tC)},encode:{update:KT[r].encodeEntry(e)}},s?{transform:s}:{})]}var QT=function(e){function UnitModel(e,t,r){var n,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0;Object(_d.a)(this,UnitModel),(n=Object(WE.a)(this,Object(GE.a)(UnitModel).call(this,e,"unit",t,r,o,a,void 0,e.view))).fit=s,n.specifiedScales={},n.specifiedAxes={},n.specifiedLegends={},n.specifiedProjection={},n.selection={},n.children=[],n.initSize(Object.assign({},i,e.width?{width:e.width}:{},e.height?{height:e.height}:{}));var u=isMarkDef(e.mark)?e.mark.type:e.mark,l=n.encoding=normalizeEncoding(function replaceRepeaterInEncoding(e,t){return replaceRepeater(e,t)}(e.encoding||{},a),u);return n.markDef=normalizeMarkDef(e.mark,l,o),n.stack=stack_stack(u,l,n.config.stack),n.specifiedScales=n.initScales(u,l),n.specifiedAxes=n.initAxes(l),n.specifiedLegends=n.initLegend(l),n.specifiedProjection=e.projection,n.selection=e.selection,n}return Object(HE.a)(UnitModel,e),Object(bd.a)(UnitModel,[{key:"scaleDomain",value:function scaleDomain(e){var t=this.specifiedScales[e];return t?t.domain:void 0}},{key:"axis",value:function axis(e){return this.specifiedAxes[e]}},{key:"legend",value:function legend(e){return this.specifiedLegends[e]}},{key:"initScales",value:function initScales(e,t){return bS.reduce((function(e,r){var n,i,a=t[r];return isFieldDef(a)?(n=a,i=a.scale):hasConditionalFieldDef(a)&&(n=a.condition,i=a.condition.scale),n&&(e[r]=i||{}),e}),{})}},{key:"initAxes",value:function initAxes(e){return[jk,Mk].reduce((function(t,r){var n=e[r];if(isFieldDef(n)||r===jk&&isFieldDef(e.x2)||r===Mk&&isFieldDef(e.y2)){var i=isFieldDef(n)?n.axis:null;null!==i&&(t[r]=Object.assign({},i))}return t}),{})}},{key:"initLegend",value:function initLegend(e){return yS.reduce((function(t,r){var n=e[r];if(n){var i=isFieldDef(n)?n.legend:hasConditionalFieldDef(n)?n.condition.legend:null;null!==i&&!1!==i&&function supportLegend(e){switch(e){case zk:case qk:case Wk:case Hk:case Gk:case Vk:case Xk:return!0;case Yk:case $k:return!1}}(r)&&(t[r]=Object.assign({},i))}return t}),{})}},{key:"parseData",value:function parseData(){this.component.data=parse_parseData(this)}},{key:"parseLayoutSize",value:function parseLayoutSize(){!function parseUnitLayoutSize(e){var t=e.component.layoutSize;if(!t.explicit.width){var r=defaultUnitSize(e,"width");t.set("width",r,!1)}if(!t.explicit.height){var n=defaultUnitSize(e,"height");t.set("height",n,!1)}}(this)}},{key:"parseSelections",value:function parseSelections(){this.component.selection=function parseUnitSelection(e,t){var r={},n=e.config.selection;t&&(t=nk(t));var i=function _loop(i){if(!t.hasOwnProperty(i))return a=i,"continue";var o=t[i],s=n[o.type],u=(s.fields,s.encodings,__rest(s,["fields","encodings"]));for(var l in u)"encodings"===l&&o.fields||"fields"===l&&o.encodings||("mark"===l&&(o[l]=Object.assign({},u[l],o[l])),void 0!==o[l]&&!0!==o[l]||(o[l]=u[l]||o[l]));i=varName(i);var c=r[i]=Object.assign({},o,{name:i,events:qw(o.on)?xb(o.on,"scope"):o.on});forEachTransform(c,(function(t){t.parse&&t.parse(e,o,c)})),a=i};for(var a in t)i(a);return r}(this,this.selection)}},{key:"parseMarkGroup",value:function parseMarkGroup(){this.component.mark=parseMarkGroups(this)}},{key:"parseAxesAndHeaders",value:function parseAxesAndHeaders(){this.component.axes=function parseUnitAxes(e){return mS.reduce((function(t,r){return e.component.scales[r]&&e.axis(r)&&(t[r]=[parseAxis(r,e)]),t}),{})}(this)}},{key:"assembleSelectionTopLevelSignals",value:function assembleSelectionTopLevelSignals(e){return function assembleTopLevelSignals(e,t){var r=!1;return forEachSelection(e,(function(n,i){var a=n.name,o=stringValue_$(a+AC);t.filter((function(e){return e.name===a})).length||t.push({name:n.name,update:"".concat(jC,"(").concat(o)+("global"===n.resolve?")":", ".concat(stringValue_$(n.resolve),")"))}),r=!0,i.topLevelSignals&&(t=i.topLevelSignals(e,n,t)),forEachTransform(n,(function(r){r.topLevelSignals&&(t=r.topLevelSignals(e,n,t))}))})),r&&(t.filter((function(e){return"unit"===e.name})).length||t.unshift({name:"unit",value:{},on:[{events:"mousemove",update:"isTuple(group()) ? group() : unit"}]})),t}(this,e)}},{key:"assembleSignals",value:function assembleSignals(){return[].concat(Object(Ra.a)(assembleAxisSignals(this)),Object(Ra.a)(function assembleUnitSelectionSignals(e,t){return forEachSelection(e,(function(r,n){var i,a=r.name,o=n.modifyExpr(e,r);(i=t).push.apply(i,Object(Ra.a)(n.signals(e,r))),forEachTransform(r,(function(n){n.signals&&(t=n.signals(e,r,t)),n.modifyExpr&&(o=n.modifyExpr(e,r,o))})),t.push({name:a+DC,update:"modify(".concat(stringValue_$(r.name+AC),", ").concat(o,")")})})),t}(this,[])))}},{key:"assembleSelectionData",value:function assembleSelectionData(e){return assembleUnitSelectionData(this,e)}},{key:"assembleLayout",value:function assembleLayout(){return null}},{key:"assembleLayoutSignals",value:function assembleLayoutSignals(){return assemble_assembleLayoutSignals(this)}},{key:"assembleMarks",value:function assembleMarks(){var e=this.component.mark||[];return this.parent&&isLayerModel(this.parent)||(e=assembleUnitSelectionMarks(this,e)),e.map(this.correctDataNames)}},{key:"getMapping",value:function getMapping(){return this.encoding}},{key:"channelHasField",value:function channelHasField(e){return encoding_channelHasField(this.encoding,e)}},{key:"fieldDef",value:function fieldDef(e){return getTypedFieldDef(this.encoding[e])}},{key:"hasProjection",get:function get(){var e=this.encoding,t=this.mark===yk,r=e&&iS.some((function(t){return isFieldDef(e[t])}));return t||r}},{key:"mark",get:function get(){return this.markDef.type}}]),UnitModel}(PT),ZT=function(e){function LayerModel(e,t,r,n,i,a,o){var s;Object(_d.a)(this,LayerModel),s=Object(WE.a)(this,Object(GE.a)(LayerModel).call(this,e,"layer",t,r,a,i,e.resolve,e.view));var u=Object.assign({},n,e.width?{width:e.width}:{},e.height?{height:e.height}:{});return s.initSize(u),s.children=e.layer.map((function(e,t){if(isLayerSpec(e))return new LayerModel(e,Object(eC.a)(s),s.getName("layer_"+t),u,i,a,o);if(isUnitSpec(e))return new QT(e,Object(eC.a)(s),s.getName("layer_"+t),u,i,a,o);throw new Error(LS.INVALID_SPEC)})),s}return Object(HE.a)(LayerModel,e),Object(bd.a)(LayerModel,[{key:"parseData",value:function parseData(){this.component.data=parse_parseData(this);var e=!0,t=!1,r=void 0;try{for(var n,i=this.children[Symbol.iterator]();!(e=(n=i.next()).done);e=!0){n.value.parseData()}}catch(a){t=!0,r=a}finally{try{e||null==i.return||i.return()}finally{if(t)throw r}}}},{key:"parseLayoutSize",value:function parseLayoutSize(){parseLayerLayoutSize(this)}},{key:"parseSelections",value:function parseSelections(){var e=this;this.component.selection={};var t=!0,r=!1,n=void 0;try{for(var i,a=function _loop(){var t=i.value;t.parseSelections(),ak(t.component.selection).forEach((function(r){e.component.selection[r]=t.component.selection[r]}))},o=this.children[Symbol.iterator]();!(t=(i=o.next()).done);t=!0)a()}catch(s){r=!0,n=s}finally{try{t||null==o.return||o.return()}finally{if(r)throw n}}}},{key:"parseMarkGroup",value:function parseMarkGroup(){var e=!0,t=!1,r=void 0;try{for(var n,i=this.children[Symbol.iterator]();!(e=(n=i.next()).done);e=!0){n.value.parseMarkGroup()}}catch(a){t=!0,r=a}finally{try{e||null==i.return||i.return()}finally{if(t)throw r}}}},{key:"parseAxesAndHeaders",value:function parseAxesAndHeaders(){!function parseLayerAxes(e){var t=e.component,r=t.axes,n=t.resolve,i={top:0,bottom:0,right:0,left:0},a=!0,o=!1,s=void 0;try{for(var u,l=e.children[Symbol.iterator]();!(a=(u=l.next()).done);a=!0){var c=u.value;c.parseAxesAndHeaders();var f=!0,d=!1,h=void 0;try{for(var p,g=ak(c.component.axes)[Symbol.iterator]();!(f=(p=g.next()).done);f=!0){var m=p.value;n.axis[m]=parseGuideResolve(e.component.resolve,m),"shared"===n.axis[m]&&(r[m]=mergeAxisComponents(r[m],c.component.axes[m]),r[m]||(n.axis[m]="independent",delete r[m]))}}catch(q){d=!0,h=q}finally{try{f||null==g.return||g.return()}finally{if(d)throw h}}}}catch(q){o=!0,s=q}finally{try{a||null==l.return||l.return()}finally{if(o)throw s}}for(var v=0,y=[jk,Mk];v<y.length;v++){var _=y[v],b=!0,x=!1,w=void 0;try{for(var k,S=e.children[Symbol.iterator]();!(b=(k=S.next()).done);b=!0){var E=k.value;if(E.component.axes[_]){if("independent"===n.axis[_]){r[_]=(r[_]||[]).concat(E.component.axes[_]);var C=!0,T=!1,O=void 0;try{for(var A,R=E.component.axes[_][Symbol.iterator]();!(C=(A=R.next()).done);C=!0){var D=A.value,P=D.getWithExplicit("orient"),j=P.value,M=P.explicit;if(i[j]>0&&!M){var F=XT[j];i[j]>i[F]&&D.set("orient",F,!1)}i[j]++}}catch(q){T=!0,O=q}finally{try{C||null==R.return||R.return()}finally{if(T)throw O}}}delete E.component.axes[_]}}}catch(q){x=!0,w=q}finally{try{b||null==S.return||S.return()}finally{if(x)throw w}}if("independent"===n.axis[_]&&r[_]&&r[_].length>1){var I=!0,L=!1,N=void 0;try{for(var B,U=r[_][Symbol.iterator]();!(I=(B=U.next()).done);I=!0){var z=B.value;z.get("grid")&&!z.explicit.grid&&(z.implicit.grid=!1)}}catch(q){L=!0,N=q}finally{try{I||null==U.return||U.return()}finally{if(L)throw N}}}}}(this)}},{key:"assembleSelectionTopLevelSignals",value:function assembleSelectionTopLevelSignals(e){return this.children.reduce((function(e,t){return t.assembleSelectionTopLevelSignals(e)}),e)}},{key:"assembleSignals",value:function assembleSignals(){return this.children.reduce((function(e,t){return e.concat(t.assembleSignals())}),assembleAxisSignals(this))}},{key:"assembleLayoutSignals",value:function assembleLayoutSignals(){return this.children.reduce((function(e,t){return e.concat(t.assembleLayoutSignals())}),assemble_assembleLayoutSignals(this))}},{key:"assembleSelectionData",value:function assembleSelectionData(e){return this.children.reduce((function(e,t){return t.assembleSelectionData(e)}),e)}},{key:"assembleTitle",value:function assembleTitle(){var e=get_get(Object(GE.a)(LayerModel.prototype),"assembleTitle",this).call(this);if(e)return e;var t=!0,r=!1,n=void 0;try{for(var i,a=this.children[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){if(e=i.value.assembleTitle())return e}}catch(o){r=!0,n=o}finally{try{t||null==a.return||a.return()}finally{if(r)throw n}}}},{key:"assembleLayout",value:function assembleLayout(){return null}},{key:"assembleMarks",value:function assembleMarks(){return function assembleLayerSelectionMarks(e,t){var r=!0,n=!1,i=void 0;try{for(var a,o=e.children[Symbol.iterator]();!(r=(a=o.next()).done);r=!0){var s=a.value;isUnitModel(s)&&(t=assembleUnitSelectionMarks(s,t))}}catch(u){n=!0,i=u}finally{try{r||null==o.return||o.return()}finally{if(n)throw i}}return t}(this,util_flatten(this.children.map((function(e){return e.assembleMarks()}))))}},{key:"assembleLegends",value:function assembleLegends(){return this.children.reduce((function(e,t){return e.concat(t.assembleLegends())}),assemble_assembleLegends(this))}}]),LayerModel}(DT),eO=function(e){function RepeatModel(e,t,r,n,i){var a;return Object(_d.a)(this,RepeatModel),a=Object(WE.a)(this,Object(GE.a)(RepeatModel).call(this,e,"repeat",t,r,i,n,e.resolve)),e.resolve&&e.resolve.axis&&("shared"===e.resolve.axis.x||"shared"===e.resolve.axis.y)&&log_warn(LS.REPEAT_CANNOT_SHARE_AXIS),a.repeat=e.repeat,a.children=a._initChildren(e,a.repeat,n,i),a}return Object(HE.a)(RepeatModel,e),Object(bd.a)(RepeatModel,[{key:"_initChildren",value:function _initChildren(e,t,r,n){var i=[],a=!Uw(t)&&t.row||[r?r.row:null],o=!Uw(t)&&t.column||[r?r.column:null],s=Uw(t)&&t||[r?r.repeat:null],u=!0,l=!1,c=void 0;try{for(var f,d=s[Symbol.iterator]();!(u=(f=d.next()).done);u=!0){var h=f.value,p=!0,g=!1,m=void 0;try{for(var v,y=a[Symbol.iterator]();!(p=(v=y.next()).done);p=!0){var _=v.value,b=!0,x=!1,w=void 0;try{for(var k,S=o[Symbol.iterator]();!(b=(k=S.next()).done);b=!0){var E=k.value,C=(h?"__repeat_repeat_".concat(h):"")+(_?"__repeat_row_".concat(_):"")+(E?"__repeat_column_".concat(E):""),T={repeat:h,row:_,column:E};i.push(buildModel(e.spec,this,this.getName("child"+C),void 0,T,n,!1))}}catch(O){x=!0,w=O}finally{try{b||null==S.return||S.return()}finally{if(x)throw w}}}}catch(O){g=!0,m=O}finally{try{p||null==y.return||y.return()}finally{if(g)throw m}}}}catch(O){l=!0,c=O}finally{try{u||null==d.return||d.return()}finally{if(l)throw c}}return i}},{key:"parseLayoutSize",value:function parseLayoutSize(){WT(this)}},{key:"assembleDefaultLayout",value:function assembleDefaultLayout(){var e=this.repeat,t=Uw(e)?void 0:e.column?e.column.length:1;return Object.assign({},t?{columns:t}:{},{bounds:"full",align:"all"})}}]),RepeatModel}(VT);function buildModel(e,t,r,n,i,a,o){if(isFacetSpec(e))return new HT(e,t,r,i,a);if(isLayerSpec(e))return new ZT(e,t,r,n,i,a,o);if(isUnitSpec(e))return new QT(e,t,r,n,i,a,o);if(isRepeatSpec(e))return new eO(e,t,r,i,a);if(function isAnyConcatSpec(e){return isVConcatSpec(e)||isHConcatSpec(e)||isConcatSpec(e)}(e))return new YT(e,t,r,i,a);throw new Error(LS.INVALID_SPEC)}function compile(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.logger&&function log_set(e){return BS=e}(t.logger),t.fieldTitle&&setTitleFormatter(t.fieldTitle);try{var r=initConfig(mergeDeep({},t.config,e.config)),n=normalize_normalize(e,r),i=function normalizeAutoSize(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=Object.assign({type:"pad"},_normalizeAutoSize(t),_normalizeAutoSize(e));return"fit"===n.type&&(r||(log_warn(LS.FIT_NON_SINGLE),n.type="pad")),n}(e.autosize,r.autosize,isLayerSpec(n)||isUnitSpec(n)),a=buildModel(n,null,"",void 0,void 0,r,"fit"===i.type);return a.parse(),function optimizeDataflow(e,t){checkLinks(e.sources);for(var r=0,n=0,i=0;i<ST&&optimizationDataflowHelper(e,t);i++)r++;e.sources.map(moveFacetDown);for(var a=0;a<ST&&optimizationDataflowHelper(e,t);a++)n++;checkLinks(e.sources),Math.max(r,n)===ST&&log_warn("Maximum optimization runs(".concat(ST,") reached."))}(a.component.data,a),function assembleTopLevelModel(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0,i=e.config?stripAndRedirectConfig(e.config):void 0,a=[].concat(e.assembleSelectionData([]),function assembleRootData(e,t){var r=[],n=makeWalkTree(r),i=0;e.sources.forEach((function(e){e.hasName()||(e.dataName="source_".concat(i++));var t=e.assemble();n(e,t)})),r.forEach((function(e){0===e.transform.length&&delete e.transform}));var a=0,o=!0,s=!1,u=void 0;try{for(var l,c=r.entries()[Symbol.iterator]();!(o=(l=c.next()).done);o=!0){var f=l.value,d=Object(qt.a)(f,2),h=d[0],p=d[1];0!==(p.transform||[]).length||p.source||r.splice(a++,0,r.splice(h,1)[0])}}catch(T){s=!0,u=T}finally{try{o||null==c.return||c.return()}finally{if(s)throw u}}for(var g=0,m=r;g<m.length;g++){var v=m[g],y=!0,_=!1,b=void 0;try{for(var x,w=(v.transform||[])[Symbol.iterator]();!(y=(x=w.next()).done);y=!0){var k=x.value;"lookup"===k.type&&(k.from=e.outputNodes[k.from].getSource())}}catch(T){_=!0,b=T}finally{try{y||null==w.return||w.return()}finally{if(_)throw b}}}for(var S=0,E=r;S<E.length;S++){var C=E[S];C.name in t&&(C.values=t[C.name])}return r}(e.component.data,r)),o=e.assembleProjections(),s=e.assembleTitle(),u=e.assembleGroupStyle(),l=e.assembleGroupEncodeEntry(!0),c=e.assembleLayoutSignals();return c=c.filter((function(e){return"width"!==e.name&&"height"!==e.name||void 0===e.value||(t[e.name]=+e.value,!1)})),{spec:Object.assign({$schema:"https://vega.github.io/schema/vega/v5.json"},e.description?{description:e.description}:{},t,s?{title:s}:{},u?{style:u}:{},l?{encode:{update:l}}:{},{data:a},o.length>0?{projections:o}:{},e.assembleGroup([].concat(Object(Ra.a)(c),Object(Ra.a)(e.assembleSelectionTopLevelSignals([])))),i?{config:i}:{},n?{usermeta:n}:{})}}(a,function getTopLevelProperties(e,t,r){return Object.assign({autosize:1===ak(r).length&&r.type?r.type:r},extractTopLevelProperties(t),extractTopLevelProperties(e))}(e,r,i),e.datasets,e.usermeta)}finally{t.logger&&log_reset(),t.fieldTitle&&function resetTitleFormatter(){setTitleFormatter(iE)}()}}var tO=new(function(e){function TransformExtractMapper(){return Object(_d.a)(this,TransformExtractMapper),Object(WE.a)(this,Object(GE.a)(TransformExtractMapper).apply(this,arguments))}return Object(HE.a)(TransformExtractMapper,e),Object(bd.a)(TransformExtractMapper,[{key:"mapUnit",value:function mapUnit(e,t){var r=t.config;if(e.encoding){var n=e.encoding,i=e.transform,a=extractTransformsFromEncoding(n,r),o=a.bins,s=a.timeUnits,u=a.aggregate,l=a.groupby,c=a.encoding,f=[].concat(Object(Ra.a)(i||[]),Object(Ra.a)(o),Object(Ra.a)(s),Object(Ra.a)(u.length?[{aggregate:u,groupby:l}]:[]));return Object.assign({},e,f.length>0?{transform:f}:{},{encoding:c})}return e}}]),TransformExtractMapper}(VE));function extractTransforms(e,t){return tO.map(e,{config:t})}var rO=Iw.version,nO=r(139),iO=r.n(nO),aO=r(237),oO={background:"#333",title:{color:"#fff"},style:{"guide-label":{fill:"#fff"},"guide-title":{fill:"#fff"}},axis:{domainColor:"#fff",gridColor:"#888",tickColor:"#fff"}},sO={background:"#fff",arc:{fill:"#4572a7"},area:{fill:"#4572a7"},line:{stroke:"#4572a7",strokeWidth:2},path:{stroke:"#4572a7"},rect:{fill:"#4572a7"},shape:{stroke:"#4572a7"},symbol:{fill:"#4572a7",strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},uO={arc:{fill:"#30a2da"},area:{fill:"#30a2da"},axis:{domainColor:"#cbcbcb",grid:!0,gridColor:"#cbcbcb",gridWidth:1,labelColor:"#999",labelFontSize:10,titleColor:"#333",tickColor:"#cbcbcb",tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:"#f0f0f0",group:{fill:"#f0f0f0"},legend:{labelColor:"#333",labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:"#333",titleFontSize:14,titlePadding:10},line:{stroke:"#30a2da",strokeWidth:2},path:{stroke:"#30a2da",strokeWidth:.5},rect:{fill:"#30a2da"},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:"#30a2da"},style:{bar:{binSpacing:2,fill:"#30a2da",stroke:null}},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},lO={group:{fill:"#e5e5e5"},arc:{fill:"#000"},area:{fill:"#000"},line:{stroke:"#000"},path:{stroke:"#000"},rect:{fill:"#000"},shape:{stroke:"#000"},symbol:{fill:"#000",size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},cO="Benton Gothic Bold, sans-serif",fO={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"ice-7":["#edefee","#dadfe2","#c4ccd2","#a6b7c6","#849eae","#607785","#47525d"]},dO={background:"#ffffff",title:{anchor:"start",color:"#000000",font:cO,fontSize:22,fontWeight:"normal"},arc:{fill:"#82c6df"},area:{fill:"#82c6df"},line:{stroke:"#82c6df",strokeWidth:2},path:{stroke:"#82c6df"},rect:{fill:"#82c6df"},shape:{stroke:"#82c6df"},symbol:{fill:"#82c6df",size:30},axis:{labelFont:"Benton Gothic, sans-serif",labelFontSize:11.5,labelFontWeight:"normal",titleFont:cO,titleFontSize:13,titleFontWeight:"normal"},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:"Benton Gothic, sans-serif",labelFontSize:11.5,symbolType:"square",titleFont:cO,titleFontSize:13,titleFontWeight:"normal"},range:{category:fO["category-6"],diverging:fO["fireandice-6"],heatmap:fO["fire-7"],ordinal:fO["fire-7"],ramp:fO["fire-7"]}},hO={background:"#f9f9f9",arc:{fill:"#ab5787"},area:{fill:"#ab5787"},line:{stroke:"#ab5787"},path:{stroke:"#ab5787"},rect:{fill:"#ab5787"},shape:{stroke:"#ab5787"},symbol:{fill:"#ab5787",size:30},axis:{domainColor:"#979797",domainWidth:.5,gridWidth:.2,labelColor:"#979797",tickColor:"#979797",tickWidth:.2,titleColor:"#979797"},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},pO={background:"#fff",arc:{fill:"#3e5c69"},area:{fill:"#3e5c69"},line:{stroke:"#3e5c69"},path:{stroke:"#3e5c69"},rect:{fill:"#3e5c69"},shape:{stroke:"#3e5c69"},symbol:{fill:"#3e5c69"},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},gO=aO.version,mO=r(238),vO="#vg-tooltip-element {\n visibility: hidden;\n padding: 8px;\n position: fixed;\n z-index: 1000;\n font-family: sans-serif;\n font-size: 11px;\n border-radius: 3px;\n box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);\n /* The default theme is the light theme. */\n background-color: rgba(255, 255, 255, 0.95);\n border: 1px solid #d9d9d9;\n color: black; }\n #vg-tooltip-element.visible {\n visibility: visible; }\n #vg-tooltip-element h2 {\n margin-top: 0;\n margin-bottom: 10px;\n font-size: 13px; }\n #vg-tooltip-element table {\n border-spacing: 0; }\n #vg-tooltip-element table tr {\n border: none; }\n #vg-tooltip-element table tr td {\n overflow: hidden;\n text-overflow: ellipsis;\n padding-top: 2px;\n padding-bottom: 2px; }\n #vg-tooltip-element table tr td.key {\n color: #808080;\n max-width: 150px;\n text-align: right;\n padding-right: 4px; }\n #vg-tooltip-element table tr td.value {\n display: block;\n max-width: 300px;\n max-height: 7em;\n text-align: left; }\n #vg-tooltip-element.dark-theme {\n background-color: rgba(32, 32, 32, 0.9);\n border: 1px solid #f5f5f5;\n color: white; }\n #vg-tooltip-element.dark-theme td.key {\n color: #bfbfbf; }\n",yO="vg-tooltip-element",_O={offsetX:10,offsetY:10,id:yO,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:function escapeHTML(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;")},maxDepth:2};var bO=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};function formatValue_stringify(e,t){return JSON.stringify(e,function replacer(e){var t=[];return function(r,n){if("object"!==typeof n||null===n)return n;var i=t.indexOf(this)+1;return t.length=i,t.length>e?"[Object]":t.indexOf(n)>=0?"[Circular]":(t.push(n),n)}}(t))}var xO=function(){function Handler(e){Object(_d.a)(this,Handler),this.options=Object.assign({},_O,e);var t=this.options.id;if(this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){var r=document.createElement("style");r.setAttribute("id",this.options.styleId),r.innerHTML=function createDefaultStyle(e){if(!/^[A-Za-z]+[-:.\w]*$/.test(e))throw new Error("Invalid HTML ID");return vO.toString().replace(yO,e)}(t);var n=document.head;n.childNodes.length>0?n.insertBefore(r,n.childNodes[0]):n.appendChild(r)}this.el=document.getElementById(t),this.el||(this.el=document.createElement("div"),this.el.setAttribute("id",t),this.el.classList.add("vg-tooltip"),document.body.appendChild(this.el))}return Object(bd.a)(Handler,[{key:"tooltipHandler",value:function tooltipHandler(e,t,r,n){if(null!=n&&""!==n){this.el.innerHTML=function formatValue_formatValue(e,t,r){if(Object(V.A)(e))return"[".concat(e.map((function(e){return t(Object(V.H)(e)?e:formatValue_stringify(e,r))})).join(", "),"]");if(Object(V.F)(e)){var n="",i=e,a=i.title,o=bO(i,["title"]);a&&(n+="<h2>".concat(t(a),"</h2>"));var s=Object.keys(o);if(s.length>0){n+="<table>";var u=!0,l=!1,c=void 0;try{for(var f,d=s[Symbol.iterator]();!(u=(f=d.next()).done);u=!0){var h=f.value,p=o[h];void 0!==p&&(Object(V.F)(p)&&(p=formatValue_stringify(p,r)),n+='<tr><td class="key">'.concat(t(h),':</td><td class="value">').concat(t(p),"</td></tr>"))}}catch(g){l=!0,c=g}finally{try{u||null==d.return||d.return()}finally{if(l)throw c}}n+="</table>"}return n||"{}"}return t(e)}(n,this.options.sanitize,this.options.maxDepth),this.el.classList.add("visible","".concat(this.options.theme,"-theme"));var i=function calculatePosition(e,t,r,n){var i=e.clientX+r;i+t.width>window.innerWidth&&(i=+e.clientX-r-t.width);var a=e.clientY+n;return a+t.height>window.innerHeight&&(a=+e.clientY-n-t.height),{x:i,y:a}}(t,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY),a=i.x,o=i.y;this.el.setAttribute("style","top: ".concat(o,"px; left: ").concat(a,"px"))}else this.el.classList.remove("visible","".concat(this.options.theme,"-theme"))}}]),Handler}(),wO=(mO.version,function(e,t,r){var n=e.open(t),i=250,a=~~(1e4/i);e.addEventListener("message",(function listen(t){t.source===n&&(a=0,e.removeEventListener("message",listen,!1))}),!1),setTimeout((function send(){a<=0||(n.postMessage(r,"*"),setTimeout(send,i),a-=1)}),i)}),kO='.vega-embed {\n position: relative;\n display: inline-block;\n padding-right: 38px; }\n .vega-embed details:not([open]) > :not(summary) {\n display: none !important; }\n .vega-embed summary {\n list-style: none;\n display: flex;\n position: absolute;\n top: 0;\n right: 0;\n padding: 6px;\n z-index: 1000;\n background: white;\n box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);\n color: #1b1e23;\n border: 1px solid #aaa;\n border-radius: 999px;\n opacity: 0.2;\n transition: opacity 0.4s ease-in;\n outline: none;\n cursor: pointer; }\n .vega-embed summary::-webkit-details-marker {\n display: none; }\n .vega-embed details[open] summary {\n opacity: 0.7; }\n .vega-embed:hover summary,\n .vega-embed:focus summary {\n opacity: 1 !important;\n transition: opacity 0.2s ease; }\n .vega-embed .vega-actions {\n position: absolute;\n top: 35px;\n right: -9px;\n display: flex;\n flex-direction: column;\n padding-bottom: 8px;\n padding-top: 8px;\n border-radius: 4px;\n box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);\n border: 1px solid #d9d9d9;\n background: white;\n animation-duration: 0.15s;\n animation-name: scale-in;\n animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5); }\n .vega-embed .vega-actions a {\n padding: 8px 16px;\n font-family: sans-serif;\n font-size: 14px;\n font-weight: 600;\n white-space: nowrap;\n color: #434a56;\n text-decoration: none; }\n .vega-embed .vega-actions a:hover {\n background-color: #f7f7f9;\n color: black; }\n .vega-embed .vega-actions::before, .vega-embed .vega-actions::after {\n content: "";\n display: inline-block;\n position: absolute; }\n .vega-embed .vega-actions::before {\n left: auto;\n right: 14px;\n top: -16px;\n border: 8px solid #0000;\n border-bottom-color: #d9d9d9; }\n .vega-embed .vega-actions::after {\n left: auto;\n right: 15px;\n top: -14px;\n border: 7px solid #0000;\n border-bottom-color: #fff; }\n\n.vega-embed-wrapper {\n max-width: 100%;\n overflow: scroll;\n padding-right: 14px; }\n\n@keyframes scale-in {\n from {\n opacity: 0;\n transform: scale(0.6); }\n to {\n opacity: 1;\n transform: scale(1); } }\n';function util_deepMerge_(e,t){if("object"!==typeof t||null===t)return e;for(var r in t)t.hasOwnProperty(r)&&void 0!==t[r]&&("object"!==typeof t[r]||Object(V.A)(t[r])||null===t[r]?e[r]=t[r]:"object"!==typeof e[r]||null===e[r]?e[r]=util_mergeDeep(Object(V.A)(t[r].constructor)?[]:{},t[r]):util_mergeDeep(e[r],t[r]));return e}function util_mergeDeep(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(var i=0,a=r;i<a.length;i++){e=util_deepMerge_(e,a[i])}return e}String.prototype.startsWith||(String.prototype.startsWith=function(e,t){return this.substr(!t||t<0?0:+t,e.length)===e});var SO=v,EO=w,CO={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},TO={vega:"Vega","vega-lite":"Vega-Lite"},OO={vega:SO.version,"vega-lite":EO?EO.version:"not available"},AO={vega:function vega(e){return e},"vega-lite":function vegaLite(e,t){return EO.compile(e,{config:t}).spec}},RO='\n<svg viewBox="0 0 16 16" fill="currentColor" stroke="none" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" width="14" height="14">\n <circle r="2" cy="8" cx="2"></circle>\n <circle r="2" cy="8" cx="8"></circle>\n <circle r="2" cy="8" cx="14"></circle>\n</svg>';function viewSource(e,t,r,n){var i="<html><head>".concat(t,'</head><body><pre><code class="json">'),a="</code></pre>".concat(r,"</body></html>"),o=window.open("");o.document.write(i+e+a),o.document.title="".concat(TO[n]," JSON Source")}function guessMode(e,t){if(e.$schema){var r=iO()(e.$schema);t&&t!==r.library&&console.warn("The given visualization spec is written in ".concat(TO[r.library],", but mode argument sets ").concat(TO[t]||t,"."));var n=r.library;return Object(H.satisfies)(OO[n],"^".concat(r.version.slice(1)))||console.warn("The input spec uses ".concat(TO[n]," ").concat(r.version,", but the current version of ").concat(TO[n]," is v").concat(OO[n],".")),n}return"mark"in e||"encoding"in e||"layer"in e||"hconcat"in e||"vconcat"in e||"facet"in e||"repeat"in e?"vega-lite":"marks"in e||"signals"in e||"scales"in e||"axes"in e?"vega":t||"vega"}function embed_embed(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function __awaiter(e,t,r,n){return new(r||(r=Promise))((function(i,a){function fulfilled(e){try{step(n.next(e))}catch(t){a(t)}}function rejected(e){try{step(n.throw(e))}catch(t){a(t)}}function step(e){e.done?i(e.value):new r((function(t){t(e.value)})).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,A.a.mark((function _callee(){var n,i,a,o,s,u,l,c,f,d,h,p,g,m,v,y,_,b,x,w,S,E,C,T,O,R,D,P,j,M,F,I;return A.a.wrap((function _callee$(A){for(;;)switch(A.prev=A.next){case 0:if(N=r.loader,n=N&&"load"in N?r.loader:SO.loader(r.loader),!SO.isString(t)){A.next=6;break}return A.next=4,n.load(t);case 4:return i=A.sent,A.abrupt("return",embed_embed(e,JSON.parse(i),r));case 6:if(r=util_mergeDeep(r,t.usermeta&&t.usermeta.embedOptions),a=r.patch||r.onBeforeParse,o=!0===r.actions||!1===r.actions?r.actions:util_mergeDeep({},{export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},r.actions||{}),s=Object.assign({},CO,r.i18n),u=r.renderer||"canvas",l=r.logLevel||SO.Warn,c=r.downloadFileName||"visualization",f=r.config||{},!SO.isString(f)){A.next=19;break}return A.next=17,n.load(f);case 17:return d=A.sent,A.abrupt("return",embed_embed(e,t,Object.assign({},r,{config:JSON.parse(d)})));case 19:if(!1!==r.defaultStyle&&(h="vega-embed-style",document.getElementById(h)||((p=document.createElement("style")).id=h,p.innerText=void 0===r.defaultStyle||!0===r.defaultStyle?(kO||"").toString():r.defaultStyle,document.head.appendChild(p))),r.theme&&(f=util_mergeDeep({},k[r.theme],f)),g=guessMode(t,r.mode),m=AO[g](t,f),"vega-lite"===g&&m.$schema&&(v=iO()(m.$schema),Object(H.satisfies)(OO.vega,"^".concat(v.version.slice(1)))||console.warn("The compiled spec uses Vega ".concat(v.version,", but current version is v").concat(OO.vega,"."))),y=z(e).classed("vega-embed",!0).html(""),!a){A.next=38;break}if(!(a instanceof Function)){A.next=30;break}m=a(m),A.next=38;break;case 30:if(!SO.isString(a)){A.next=37;break}return A.next=33,n.load(a);case 33:_=A.sent,m=util_mergeDeep({},m,JSON.parse(_)),A.next=38;break;case 37:m=util_mergeDeep({},m,a);case 38:return b=SO.parse(m,"vega-lite"===g?{}:f),x=new SO.View(b,{loader:n,logLevel:l,renderer:u}),!1!==r.tooltip&&(L=r.tooltip,w="function"===typeof L?r.tooltip:new xO(!0===r.tooltip?{}:r.tooltip).call,x.tooltip(w)),void 0===(S=r.hover)&&(S="vega"===g),S&&(C=(E="boolean"===typeof S?{}:S).hoverSet,T=E.updateSet,x.hover(C,T)),r&&(r.width&&x.width(r.width),r.height&&x.height(r.height),r.padding&&x.padding(r.padding)),A.next=47,x.initialize(e).runAsync();case 47:if(!1!==o){if(O=y,!1!==r.defaultStyle&&(R=y.append("details").attr("title",s.CLICK_TO_VIEW_ACTIONS),O=R,R.insert("summary").html(RO),D=R.node(),document.addEventListener("click",(function(e){D.contains(e.target)||D.removeAttribute("open")}))),P=O.insert("div").attr("class","vega-actions"),!0===o||!1!==o.export)for(j=function _loop(){var e=F[M];if(!0===o||!0===o.export||o.export[e]){var t=s["".concat(e.toUpperCase(),"_ACTION")];P.append("a").text(t).attr("href","#").attr("target","_blank").attr("download","".concat(c,".").concat(e)).on("mousedown",(function(){var t=this;x.toImageURL(e,r.scaleFactor).then((function(e){t.href=e})).catch((function(e){throw e})),B.preventDefault()}))}},M=0,F=["svg","png"];M<F.length;M++)j();!0!==o&&!1===o.source||P.append("a").text(s.SOURCE_ACTION).attr("href","#").on("mousedown",(function(){viewSource(G()(t),r.sourceHeader||"",r.sourceFooter||"",g),B.preventDefault()})),"vega-lite"!==g||!0!==o&&!1===o.compiled||P.append("a").text(s.COMPILED_ACTION).attr("href","#").on("mousedown",(function(){viewSource(G()(m),r.sourceHeader||"",r.sourceFooter||"","vega"),B.preventDefault()})),!0!==o&&!1===o.editor||(I=r.editorUrl||"https://vega.github.io/editor/",P.append("a").text(s.EDITOR_ACTION).attr("href","#").on("mousedown",(function(){wO(window,I,{config:f,mode:g,renderer:u,spec:G()(t)}),B.preventDefault()})))}return A.abrupt("return",{view:x,spec:t,vgSpec:m});case 49:case"end":return A.stop()}var L,N}),_callee)})))}var DO={};function shallowEqual(e,t){void 0===e&&(e=DO),void 0===t&&(t=DO);var r=Object.keys(e),n=Object.keys(t);return e===t||r.length===n.length&&r.every((function(r){return e[r]===t[r]}))}var PO=function NOOP(){};function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var jO=function(e){function b(){for(var t,r=arguments.length,n=Array(r),i=0;i<r;i++)n[i]=arguments[i];return _defineProperty(_assertThisInitialized(t=e.call.apply(e,[this].concat(n))||this),"containerRef",T.a.createRef()),_defineProperty(_assertThisInitialized(t),"viewPromise",void 0),_defineProperty(_assertThisInitialized(t),"handleError",(function(e){var r=t.props.onError;return(void 0===r?PO:r)(e),void console.warn(e)})),_defineProperty(_assertThisInitialized(t),"modifyView",(function(e){t.viewPromise&&t.viewPromise.then((function(t){return t&&e(t),!0})).catch(t.handleError)})),t}!function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(b,e);var t=b.prototype;return t.componentDidMount=function componentDidMount(){this.createView()},t.componentDidUpdate=function componentDidUpdate(e){var t=this,r=function getUniqueFieldNames(e){var t=new Set;return e.forEach((function(e){Object.keys(e).forEach((function(e){t.add(e)}))})),t}([this.props,e]);r.delete("className"),r.delete("style"),r.delete("signalListeners"),(Array.from(r).some((function(r){return t.props[r]!==e[r]}))||!shallowEqual(this.props.signalListeners,e.signalListeners))&&(this.clearView(),this.createView())},t.componentWillUnmount=function componentWillUnmount(){this.clearView()},t.createView=function createView(){var e=this.props,t=e.spec,r=e.onNewView,n=(e.onError,e.signalListeners),i=void 0===n?{}:n,a=function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],0<=t.indexOf(r)||(i[r]=e[r]);return i}(e,["spec","onNewView","onError","signalListeners"]);this.containerRef.current&&(this.viewPromise=embed_embed(this.containerRef.current,t,a).then((function(e){var t=e.view,r=Object.keys(i);return r.forEach((function(e){try{t.addSignalListener(e,i[e])}catch(e){console.warn("Cannot add invalid signal handler >>",e)}})),0<r.length&&t.run(),t})).catch(this.handleError),r&&this.modifyView(r))},t.clearView=function clearView(){return this.modifyView((function(e){e.finalize()})),this.viewPromise=void 0,this},t.render=function render(){var e=this.props,t=e.className,r=e.style;return T.a.createElement("div",{ref:this.containerRef,className:t,style:r})},b}(T.a.PureComponent);function _extends(){return(_extends=Object.assign||function(e){for(var t,r=1;r<arguments.length;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)}function Vega_assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Vega_defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}_defineProperty(jO,"propTypes",{className:E.a.string,spec:E.a.any.isRequired,signalListeners:E.a.any,style:E.a.any,onNewView:E.a.any,onError:E.a.func}),r.d(t,"a",(function(){return MO}));var MO=function(e){function b(){for(var t,r=arguments.length,n=Array(r),i=0;i<r;i++)n[i]=arguments[i];return Vega_defineProperty(Vega_assertThisInitialized(t=e.call.apply(e,[this].concat(n))||this),"vegaEmbed",T.a.createRef()),Vega_defineProperty(Vega_assertThisInitialized(t),"handleNewView",(function(e){t.update();var r=t.props.onNewView;(void 0===r?PO:r)(e)})),t}!function Vega_inheritsLoose(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(b,e);var t=b.prototype;return t.componentDidMount=function componentDidMount(){this.update()},t.componentDidUpdate=function componentDidUpdate(e){shallowEqual(this.props.data,e.data)||this.update()},t.update=function update(){var e=this.props,t=e.data,r=e.spec;if(t){var n=function getDatasetNamesFromSpec(e){var t=e.data;if(t){if(Array.isArray(t))return t.map((function(e){return e.name}));if("string"==typeof t.name)return[t.name]}return[]}(r).filter((function(e){return t[e]}));this.vegaEmbed.current&&0<n.length&&this.vegaEmbed.current.modifyView((function(e){n.forEach((function(r){!function updateData(e,t,r){r&&(function isFunction_isFunction(e){return!!e&&"[object Function]"==={}.toString.call(e)}(r)?r(e.data(t)):e.change(t,SO.changeset().remove((function(){return!0})).insert(r)))}(e,r,t[r])})),e.run()}))}},t.render=function render(){var e=this.props,t=(e.data,function Vega_objectWithoutPropertiesLoose(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],0<=t.indexOf(r)||(i[r]=e[r]);return i}(e,["data"]));return T.a.createElement(jO,_extends({ref:this.vegaEmbed},t,{onNewView:this.handleNewView}))},b}(T.a.PureComponent);Vega_defineProperty(MO,"propTypes",{data:E.a.any}),Vega_defineProperty(MO,"defaultProps",{data:{}})}]]);
//# sourceMappingURL=2.a84bf109.chunk.js.map